客户端登录redis
[root@node120 bin]# ./redis-cli -h 192.168.2.120 -p 6379
192.168.2.120:6379>
修改redis默认监听的IP:
vim /etc/redis326/6379.conf
59 # JUST COMMENTTHE FOLLOWING LINE.
60 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 #bind127.0.0.1
62 bind192.168.2.120
63
64 # Protectedmode is a layer of security protection, in order to avoid that
service redis stop
service redis start
[root@node120 redis326]# ps -ef | grep redis
root 6230 6191 009:05 pts/1 00:00:00 vim/etc/init.d/redis
root 6318 1 009:12 ? 00:00:00/usr/local/redis326/bin/redis-server 192.168.2.120:6379
root 6326 6191 009:13 pts/1 00:00:00 ./redis-cli -h192.168.2.120 -p 6379
root 6369 6339 009:16 pts/2 00:00:00 grep --color=autoredis
[root@node120 bin]# ./redis-cli -h 192.168.2.120 -p 6379
192.168.2.120:6379>