安装RedisLive
成都创新互联网站建设公司,提供成都做网站、网站建设、外贸营销网站建设,网页设计,建网站,PHP网站建设等专业做网站服务;可快速的进行网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,是专业的做网站团队,希望更多企业前来合作!升级python
1.1.安装:
tar -xf Python-2.7.10.tar.xz cd Python-2.7.10 ./configure --prefix=/usr/local/pyhon2.7 make make install1.2.备份老版本文件
mv /usr/bin/python /usr/bin/python2.6.61.3.连接新文件
ln -s /usr/local/pyhon2.7/bin/python /usr/bin/python安装完成
验证:
[root@ckl-soft]# python Python 2.7.10 (default, Jun 21 2016, 09:33:37)2.安装setuptools
tar -xf setuptools-23.0.0.tar.gz cd setuptools-23.0.0 python setup.py install3.安装tornado
git https://github.com/tornadoweb/tornado.git unzip tornado-master.zip cd tornado-master python setup.py install4.安装redis-py
wget https://github.com/andymccurdy/redis-py/archive/master.zip unzip master cd redis-py-master/ python setup.py install5.安装python-dateutil
tar -xf python-dateutil-2.4.2.tar.gz cd python-dateutil-2.4.2 python setup.py install6.安装argparse
tar -xf argparse-1.4.0.tar.gz cd argparse-1.4.0 python setup.py install7.安装RedisLive
https://github.com/nkrode/RedisLive tar -xf RedisLive-master.zip -C /data/ cd /data/ mv RedisLive-master RedisLive修改配置文件:
cd /data/RedisLive/src cp redis-live.conf.example cp redis-live.conf vim redis-live.conf { "RedisServers": [ { "server": "192.168.1.11", "port" : 6379, "password" : "112233" } ], "DataStoreType" : "sqlite", "RedisStatsServer": { "server" : "127.0.0.1", "port" : 6385 }, "SqliteStatsStore" : { "path": "/data/RedisLive/src/db/redislive.sqlite" } }增加crontab
*/3 * * * * cd /data/RedisLive/src/;./redis-monitor.py --duration 20 >/dev/null 2>&1启动进程:
./redis-live.py &
[1] 9483 [root@pro-kibana src]# Traceback (most recent call last): File "./redis-live.py", line 10, in解决:安装sqlite
tar -xf setuptools-23.0.0.tar.gz cd sqlite-autoconf-3130000 ./configure --prefix=/usr/local/sqlite3 make && make install重新编译python:
vi Python-2.7.10/setup.py ... sqlite_inc_paths = [ '/usr/include', '/usr/local/sqlite3/include', #增加到这里 '/usr/include/sqlite', '/usr/include/sqlite3', '/usr/local/include', '/usr/local/include/sqlite',重新编译即可
再次启动:
./redis-live.py &
[1] 21249 [root@pro-kibana src]# Traceback (most recent call last): File "./redis-live.py", line 10, in检查配置文件json格式语法有错误,少了一个","
启动后8888端口
http://192.168.1.80:8888/index.html
安装redis-stat
卸载老版本:
yum erase ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs1.安装ruby 2.0以上
tar -xf ruby-2.1.9.tar.gz cd ruby-2.1.9 ./configure --prefix=/usr/local/ruby2.0 make make install配置连接:
cd /usr/local/ruby2.0/ for i in `ls`;do ln -s /usr/local/ruby2.0/bin/$i /usr/bin/$i;done添加淘宝源:
gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/2.安装redis-stat
cd /data/ git clone https://github.com/junegunn/redis-stat.git cd /data/redis-stat/bin/ # ./redis-stat --help usage: redis-stat [HOST[:PORT] ...] [INTERVAL [COUNT]] -a, --auth=PASSWORD Password -v, --verbose Show more info --style=STYLE Output style: unicode|ascii --no-color Suppress ANSI color codes --csv[=CSV_FILE] Print or save the result in CSV --es=ELASTICSEARCH_URL Send results to ElasticSearch: [http://]HOST[:PORT][/INDEX] --server[=PORT] Launch redis-stat web server (default port: 63790) --daemon Daemonize redis-stat. Must be used with --server option. --version Show version --help Show this message命令行运行:
redis-stat redis-stat 1 redis-stat 1 10 redis-stat --verbose redis-stat localhost:6380 1 10 redis-stat localhost localhost:6380 localhost:6381 5 redis-stat localhost localhost:6380 1 10 --csv=/tmp/output.csv --verboseredis-stat运行为服务:
redis-stat --server redis-stat --verbose --server=8080 5 # redis-stat server can be daemonized redis-stat --server --daemon # Kill the daemon killall -9 redis-stat-daemon以守护进程模式启动:
redis-stat --verbose --server=8080 5 --daemon运行其它主机实例:
./redis-stat 192.168.1.12 --auth='1234' --verbose --server=8080 5 --daemon另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。