1. 在 salt-minion 上配置
- Redis.db: '0'
- Redis.host: '服务器 IP 或者域名'
- Redis.port: '6379'
2. 使用命令查看是否安装 python Redis client
python -c 'import redis; print redis.VERSION'
如果没有安装
- wget -no-check-certificate https://pypi.python.org/packages/source/r/redis/redis-2.8.0.tar.gz
- tar -zvxf Redis-2.8.0.tar.gz
- mv Redis-2.8.0 python-Redis-2.8.0
- cd python-Redis-2.8.0
- python setup.py install
在执行
python -c 'import redis; print redis.VERSION' 显示出版本安装完毕
3. 重启 / etc/init.d/salt-minion restart
4. 在 master 上 salt 'node1' cmd.run 'hostname' --return Redis 执行
5. 这时候就能看到
- [root@node2 Redis-4.0.10]# Redis-cli monitor
- OK
来源: http://www.bubuko.com/infodetail-2899779.html