运维自动化之ansible playbook一键化安装redis主从
# ssh 172.16.1.57root@172.16.1.57's password:
Last login: Mon Nov 17 14:10:39 2014 from 172.17.42.1
root@6388c15147d9:~
09:28:39 # netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 172.16.1.57:6379 0.0.0.0:* LISTEN 412/redis-server
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 266/sshd
tcp 0 0 :::80 :::* LISTEN 13/httpd
tcp 0 0 :::22 :::* LISTEN 266/sshd
root@6388c15147d9:~
09:28:41 # ps -ef|grep redis
root 412 10 09:25 ? 00:00:00 /usr/bin/redis-server /data/redis-2.6.17/conf/redis_6379.conf
root 443 4280 09:28 pts/0 00:00:00 grep redis
root@6388c15147d9:~
09:28:43 # redis-cli -h 172.16.1.57 -p 6379
redis 172.16.1.57:6379> keys *
(empty list or set)
redis 172.16.1.57:6379> set abc 1
OK
redis 172.16.1.57:6379> set test a
OK
redis 172.16.1.57:6379> get abc
"1"
redis 172.16.1.57:6379> get test
"a"
redis 172.16.1.57:6379>
页:
[1]