redis 安装与使用

1.redis安装redis

wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
make install

2.配置shell

cp redis.conf /etc/redis.conf
nano /etc/redis.conf
修改
pidfile /var/run/redis.pid
logfile /var/log/redis.log
bind 127.0.0.1 #绑定ip
requirepass 123456 #设置密码

3.测试测试

redis-server /etc/redis.conf #启动
redis-cli && auth 123456 #登陆
redis-cli -h 192.168.1.121 -a 123456 #带密码登陆目标ip

redis-cli shutdown #重启
相关文章
相关标签/搜索