centos7 安装 redis-4.0.9
下载地址:https://redis.io/download
下载 安装:
$ wget http://download.redis.io/releases/redis-4.0.9.tar.gz $ tar xzf redis-4.0.9.tar.gz $ cd redis-4.0.9 $ yum install gcc tcl -y $ make $ mkdir -p /usr/local/redis $ make PREFIX=/usr/local/redis install
设置全局变量
$ cd redis-4.0.9/src $ cp redis-sentinel /usr/local/redis/bin/ $ vim /etc/profile $ export REDIS_HOME=/usr/local/redis $ export PATH=$PATH:$REDIS_HOME/bin $ source ~/.bash_profile
测试安装并设置环境变量成功:
redis-server --help
做成后台daemon
$ cd redis-4.0.9/utils/ $ ./install_server.sh<br /> 把编译好的redis作为一个服务,把6379.cof放到了/etc/init.d/redis_6379 $ cd /etc/init.d $ mv redis_6379 redisd (chkconfig --add redisd) $ service redisd start $ ss -tanl
客户端:
$ redis-cli --help $ vim /etc/redis/6379.conf $ redis-cli $ redis-cli -n 0 $ set mykey 123 $ get mykey
相关推荐
王道革 2020-11-25
wangdonghello 2020-11-03
Langeldep 2020-11-16
chenhualong0 2020-11-16
聚合室 2020-11-16
koushr 2020-11-12
MRFENGG 2020-11-11
guoyanga 2020-11-10
fackyou00 2020-11-10
Orangesss 2020-11-03
dongCSDN 2020-10-31
rainandtear 2020-10-30
Quietboy 2020-10-30
liuyulong 2020-10-29
fansili 2020-10-29
温攀峰 2020-10-23
jackbon 2020-10-19
kaixinfelix 2020-10-04