安裝RedisLive
成都創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司,提供成都做網(wǎng)站、網(wǎng)站建設(shè)、外貿(mào)營銷網(wǎng)站建設(shè),網(wǎng)頁設(shè)計,建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務;可快速的進行網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,是專業(yè)的做網(wǎng)站團隊,希望更多企業(yè)前來合作!升級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 <module> from api.controller.ServerListController import ServerListController File "/data/RedisLive/src/api/controller/ServerListController.py", line 1, in <module> from BaseController import BaseController File "/data/RedisLive/src/api/controller/BaseController.py", line 1, in <module> from dataprovider.dataprovider import RedisLiveDataProvider File "/data/RedisLive/src/dataprovider/dataprovider.py", line 2, in <module> import sqliteprovider File "/data/RedisLive/src/dataprovider/sqliteprovider.py", line 3, in <module> import sqlite3 File "/usr/local/python2.7/lib/python2.7/sqlite3/__init__.py", line 24, in <module> from dbapi2 import * File "/usr/local/python2.7/lib/python2.7/sqlite3/dbapi2.py", line 28, in <module> from _sqlite3 import * ImportError: No module named _sqlite3解決:安裝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 <module> from api.controller.ServerListController import ServerListController File "/data/RedisLive/src/api/controller/ServerListController.py", line 1, in <module> from BaseController import BaseController File "/data/RedisLive/src/api/controller/BaseController.py", line 7, in <module> class BaseController(tornado.web.RequestHandler): File "/data/RedisLive/src/api/controller/BaseController.py", line 9, in BaseController stats_provider = RedisLiveDataProvider.get_provider() File "/data/RedisLive/src/dataprovider/dataprovider.py", line 16, in get_provider data_store_type = settings.get_data_store_type() File "/data/RedisLive/src/api/util/settings.py", line 24, in get_data_store_type config = get_settings() File "/data/RedisLive/src/api/util/settings.py", line 10, in get_settings return json.load(config) File "/usr/local/python2.7/lib/python2.7/json/__init__.py", line 290, in load **kw) File "/usr/local/python2.7/lib/python2.7/json/__init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/local/python2.7/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/python2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Expecting , delimiter: line 7 column 25 (char 101) [1]+ Exit 1 ./redis-live.py檢查配置文件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另外有需要云服務器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
本文標題:RedisLive&redis-stat監(jiān)控工具部署-創(chuàng)新互聯(lián)
當前URL:http://muchs.cn/article4/iosie.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、網(wǎng)站設(shè)計、軟件開發(fā)、網(wǎng)站排名、商城網(wǎng)站、做網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容