Linux-redis-cli 만 설치
Redis가 설치된 Linux 서버가 있고 로컬 Linux 시스템에서 명령 행을 통해 서버에 연결하려고합니다.
설치 및 기타 도구 redis-cli
없이 만 설치할 수 redis-server
있습니까?
redis-cli
로컬 컴퓨터에 파일을 복사 하여 실행하면 다음 오류가 발생합니다.
./redis-cli: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./redis-cli)
우분투 (14.04에서 테스트 됨)에는 다른 도구 redis-tools
가 들어있는 패키지 가 있습니다 redis-cli
. 설치하려면 다음을 입력하십시오.
sudo apt-get install redis-tools
대신 redis-cli
간단하게 사용할 수 있습니다 nc
!
nc -v --ssl redis.mydomain.com 6380
그런 다음 명령을 제출하십시오.
에서 http://redis.io/topics/quickstart
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make redis-cli
sudo cp src/redis-cli /usr/local/bin/
Docker에서는 일반적으로 https://registry.hub.docker.com/_/redis/를 사용 합니다. 이미지에 redis-cli를 추가 해야하는 경우 다음 스 니펫을 사용합니다.
RUN cd /tmp &&\
curl http://download.redis.io/redis-stable.tar.gz | tar xz &&\
make -C redis-stable &&\
cp redis-stable/src/redis-cli /usr/local/bin &&\
rm -rf /tmp/redis-stable
$ git clone http://github.com/antirez/redis.git
$ cd redis && git checkout 3.0
$ make redis-cli
선택적으로 편의를 위해 컴파일 된 실행 파일을로드 경로에 넣을 수 있습니다.
$ ln -s src/redis-cli /usr/local/bin/redis-cli
centOS의 경우 다음 단계를 시도해 볼 수 있습니다.
cd /tmp
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
cp src/redis-cli /usr/local/bin/
chmod 755 /usr/local/bin/redis-cli
필자의 경우 RedHat 또는 Centos 에서 빌드하기 위해 몇 가지 단계를 더 수행해야합니다 .
# get system libraries
sudo yum install -y gcc wget
# get stable version and untar it
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
# build dependencies too!
cd deps
make hiredis jemalloc linenoise lua geohash-int
cd ..
# compile it
make
# make it globally accesible
sudo cp src/redis-cli /usr/bin/
@Agis의 답변을 확장하려면 다음을 실행하여 Redis CLI를 설치할 수도 있습니다
$ git clone -b v2.8.7 git@github.com:antirez/redis.git
$ make -C redis install redis-cli /usr/bin
Redis CLI를 빌드하고 바이너리를 / usr / bin에 넣습니다. Docker 를 사용하는 사람에게는 https://github.com/bacongobbler/dockerfiles/blob/master/redis-cli/Dockerfile 도 사용 하는 Dockerfile도 작성했습니다.
Docker를 사용하면 이 명령을 실행하여 Redis CLI를 얻을 수 있습니다.
docker run -it redis redis-cli -h redis.mycompany.org -p 6379
where redis
is the redis
docker image from Docker Hub,
redis-cli
is pre-installed in that image, and all after that are parameters to redis-cli
:
-h
is hostname to connect to,
-p
is apparently the port to connect to.
You can also use telnet instead
telnet redis-host 6379
And then issue the command, for example for monitoring
monitor
you may scp it from your redis machine if you have one, its just single binary. Or copy with nc if private network (this method is insecure):
redisclient: nc -l 8888 > /usr/local/bin/redis-cli
redisserver: cat /usr/local/bin/redis-cli | nc redisclient 8888
I made a simple pure-go solution, which is under development.
redis-cli: https://github.com/holys/redis-cli
Build once, and run everywhere. Fully portable.
Please feel free to have a try.
There are many way to install radis-cli
. It comes with redis-tools
and redis-server
. Installing any of them will install redis-cli
too. But it will also install other tools too. As you have redis-server
installed somewhere and only interested to install redis-cli
. To install install only redis-cli
without other unnecessary tools follow below command
cd /tmp
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
cp src/redis-cli /usr/local/bin/
chmod 755 /usr/local/bin/redis-cli
참고URL : https://stackoverflow.com/questions/21795340/linux-install-redis-cli-only
'Programing' 카테고리의 다른 글
파이썬은 텍스트 파일을 연결 (0) | 2020.06.14 |
---|---|
OSX에서 zsh에서 bash로 전환했다가 다시? (0) | 2020.06.14 |
iOS 10.0 런타임 충돌의 NSCameraUsageDescription? (0) | 2020.06.14 |
Xcode 7.2 일치하는 프로비저닝 프로파일이 없습니다. (0) | 2020.06.14 |
MySQL : 조인 유형의 빠른 분석 (0) | 2020.06.14 |