Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
126 lines (98 sloc) 4.65 KB

redis-stat

  • 官网

  • 安装

    • MAC
    brew install ruby
    sudo gem install redis-stat
    
    • Linux
    sudo apt-get install ruby
    sudo apt-get install rubygems
    sudo apt-get install ruby-dev
    sudo gem install redis-stat
    
  • 运行及后台

     sudo redis-stat --server=8080 xxx.xxx.xx.xxx:xxxx -a first_redis_pass yy.yyy.yy.yyy:yyyy -a second_redis_pass
    
     == Sinatra/1.3.6 has taken the stage on 8080 for production with backup from Thin
     >> Thin web server (v1.5.1 codename Straight Razor)
     >> Maximum connections set to 1024
     >> Listening on 0.0.0.0:8080, CTRL+C to stop
     ┌────────────────────────┬─────────────────────┬────────────────────┐
     │                        │ xxx.xxx.xx.xxx:xxxx │ yy.yyy.yy.yyy:yyyy │
     ├────────────────────────┼─────────────────────┼────────────────────┤
     │          redis_version │               2.8.4 │              2.8.4 │
     │             redis_mode │          standalone │         standalone │
     │             process_id │               10359 │               7487 │
     │      uptime_in_seconds │            16384980 │            8531498 │
     │         uptime_in_days │                 189 │                 98 │
     │                   role │              master │             master │
     │       connected_slaves │                   0 │                  0 │
     │            aof_enabled │                   0 │                  0 │
     │ rdb_bgsave_in_progress │                   0 │                  0 │
     │     rdb_last_save_time │          1489681520 │         1490060556 │
     └────────────────────────┴─────────────────────┴────────────────────┘
    
     ┌────────┬──┬──┬─────┬───┬──────┬──────┬────┬─────┬─────┬─────┬──────┬─────┬─────┬─────┐
          time us sy    cl bcl    mem    rss keys cmd/s exp/s evt/s hit%/s hit/s mis/s aofcs 
     ├────────┼──┼──┼─────┼───┼──────┼──────┼────┼─────┼─────┼─────┼──────┼─────┼─────┼─────┤
      09:45:27  -  - 8.39k  44 5.80GB 5.69GB  918     -     -     -      -     -     -    0B 
      09:45:29  3  0 8.39k  44 5.80GB 5.69GB  918  24.4     0     0    100  2.00     0    0B 
      09:45:31  0  1 8.39k  44 5.80GB 5.69GB  918  27.5     0     0    100  4.01     0    0B 
      09:45:33  0  0 8.39k  44 5.80GB 5.69GB  918  31.0     0     0    100  5.00     0    0B 
      09:45:35  0  0 8.39k  44 5.80GB 5.69GB  918  24.0     0     0    100  1.00     0    0B 
      09:45:37  0  0 8.39k  44 5.80GB 5.69GB  918  27.5     0     0    100  4.00     0    0B 
     └────────┴──┴──┴─────┴───┴──────┴──────┴────┴─────┴─────┴─────┴──────┴─────┴─────┴─────┘
    
  • 守护进程

     sudo redis-stat --server=8080 xxx.xxx.xx.xxx:xxxx -a first_redis_pass yy.yyy.yy.yyy:yyyy -a second_redis_pass --daemon
    
  • 可视化web

    http://0.0.0.0:8080/


redis-live

pip install tornado
pip install redis
pip install python-dateutil
pip install argparse(python < 2.7)
  • redis-live 下载
git clone https://github.com/nkrode/RedisLive.git
  • 修改配置文件
{
	"RedisServers":
	[ 
		{
  			"server": "your_server_ip",
  			"port" : your_redis_port_default_6379
		}

	],

	"DataStoreType" : "redis",

	"RedisStatsServer":
	{
		"server" : "your_server_ip",
		"port" : your_redis_live_port_diff_6379
	},
	
	"SqliteStatsStore" :
	{
		"path":  "to your sql lite file"
	}
}

  • 运行

    • 进入 ./RedisLive/src
    • ./redis-monitor.py --duration =30 <---时间,单位,秒 这个指令执行后会 shut down... 不要理会
    • 另起一个终端 ./redis-live.py
  • 可视化web

You can’t perform that action at this time.