一些经常使用的配置:html
requirepass admin #服务链接密码 bind 192.168.0.13 127.0.0.1 #ip绑定,可配多个(全部远程客户端想要链接,须要注释掉) protected-mode no #关闭安全模式(就能够远程链接了) port 6379 #端口配置 daemonize yes #开启后台启动 logfile /home/hadoop/redis-5.0.5/logs/redis.log #日志路径配置 dir /home/hadoop/redis-5.0.5/cache/ #数据持久化路径 masterauth:xxx #主从同步须要配置主节点的密码(哨兵模式下主从都配配置) slaveof 192.168.0.23 6379 #主从配置,从节点须要配置
二话不说先上图,能看上再玩,看不上略过,网上各类监控软件还得用本身喜欢的不是!项目地址:https://github.com/nkrode/RedisLive
python
下载redislive源代码,解压配置redis-liver-conf文件,监控数据存储方案的配置,可选择redis或sqllitelinux
{ "RedisServers": [ { "server": "192.21.126.13", "port" : 6379, "password" : "haina" } ], "DataStoreType" : "redis", "RedisStatsServer": { "server" : "192.21.126.23", "port" : 6380 }, "SqliteStatsStore" : { "path" : "/home/hadoop/hainascript/redis-live/sqlitedata/redislive.db" } }
注意:配置为linu系统的定时任务时,提示找不到redis-liver-conf文件,这时候须要编辑redis-monitor.py文件,以下:git
#引入以下依赖 import os import sys #主函数执行以前,先切换到脚本所在目录 SCRIPT_ROOT = sys.path[0] os.chdir(SCRIPT_ROOT)
启动Web服务
* ./redis-live.py
* 默认端口为8888,咱们能够编辑redis-live.py文件来修改端口github
打开浏览器,访问host:port/index.html便可看到你期待的页面!!!redis
我的博客地址:sql
csdn:https://blog.csdn.net/tiantuo6513
cnblogs:https://www.cnblogs.com/baixianlong
segmentfault:https://segmentfault.com/u/baixianlong
github:https://github.com/xianlongbaisegmentfault