目前来说,越来越多的使用多了NOSQL的业务,但是这方面的监控缺不多。今天给大家介绍几个专业监控redis服务的工具,便于大家进行redis性能分析。

一、redmon

这个工具是用ruby语言写的,ruby是小鬼子弄出来的,个人真心觉得比较难用。这个语言的包需要安装rvm(ruby version manager)来管理。所以首先要部署rvm的环境,虽然说不是很复杂,但是真心觉得不想用这个,以后有时间了会给大家介绍这个的。

二、redis-live

Github 下载: RedisLive

Centos 安装 python-pip

2) 直接下载: wget https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz

3) 解压安装: tar zxvf pip-1.5.6.tar.gz ;   python setup.py install

Centos 安装setuptools

2) 直接下载: wget https://pypi.python.org/packages/source/s/setuptools/setuptools-5.4.1.tar.gz#md5=3540a44b90017cbb851840934156848e

3) 解压安装:tar zxvf setuptools-5.4.1.tar.gz ;  python setup.py install

今天的主要目的是redis-live这个软件。相对于redmon来说,部署相对来说简单的多了,而且功能上面也丝毫不逊色于redmon

安装redis-live:

因为redis-live是基于python开发的,所以首先要部署所需要的python环境

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/python-pip-0.8-1.el6.noarch.rpm

rpm -ivh python-pip-0.8-1.el6.noarch.rpm

pip install tornado

pip install redis// 需安装,跟redis-server不同

pip install python-dateutil

pip install argparse

环境部署完了之后,就需要开始安装软件了。

git clone https://github.com/kumarnitin/RedisLive.git

Initialized empty Git repository in /root/RedisLive/.git/

remote: Counting objects: 715, done.

remote: Compressing objects: 100% (377/377), done.

remote: Total 715 (delta 338), reused 699 (delta 323)

Receiving objects: 100% (715/715), 2.59 MiB | 353 KiB/s, done.

Resolving deltas: 100% (338/338), done.

因为没有打包的安装包,所以只能下载安装git的源码

Install Dependencies

tornado pip install tornado

redis.py pip install redis

python-dateutil pip install python-dateutil

You'll also need argparse if you're running Python < 2.7:

argparse pip install argparse

Get RedisLive

Clone the repo git clone https://github.com/kumarnitin/RedisLive.git , ordownload the latest release

Configuration

edit redis-live.conf :

update the value of the key RedisServers to the redis instances you want to monitor. You can monitor multiple instances by appending more values to the RedisServers list.

update the value of the key RedisStatsServer to the redis instance you will use to store RedisLive data (this redis instance is different from the redis instances you are monitoring).

passwords can be added as an optional parameter for any redis instance

if you don't have a spare redis instance to use to store Redis Live data, then you can configure to use sqlite by changing "DataStoreType" : "sqlite"

Start RedisLive

start the monitoring script ./redis-monitor.py --duration=120 duration is in seconds (see caveat)

start the webserver ./redis-live.py

Caveat on monitoring redis

Currently the only hook into monitoring a redis instance is Redis MONITOR command, which streams back every command processed and reduces the throughput of the redis instance. It is recommended to run redis-monitor with --duration suitable for your redis deployment and scheduling it to run periodically as a cron job.

安装好之后就可以配置了:

cd RedisLive/src

vi redis-live.conf

{

"RedisServers":

[

{

"server" : "127.0.0.1",

"port" : 6379

}

],

"DataStoreType" : "sqlite",

"RedisStatsServer":

{

"server" : "127.0.0.1",

"port" : 6381

}

"SqliteStatsStore" :

{

"path": "db/redislive.sqlite"

}

}

RedisServers这个是redis服务器的配置

RedisStatsServer是redis服务器的监控信息可以存放在其他的redis服务器中.也就是RedisStatsServe

一般的是把”DataStoreType”改成sqlite类型的,下面的RedisStatsServer就不用配置了

注:因为有些redis服务器是需要密码进行访问的,所以如果有密码的话,需要在RedisServers里面写上密码:如下:

"RedisServers":

[

{

"server" : "127.0.0.1",

"port" : 6379,

"password":"xxxxxx"

}

],

配置好之后,就可以启动服务了。

./redis-monitor.py --duration 120 &

./redis-live.py &

注:启动服务之后,如果访问web页面的话,会在当前终端输出日志,如果不想在终端输出,可以查看redis-live.py的参数

[root@localhost src]# ./redis-live.py --help

Usage: ./redis-live.py [OPTIONS]

Options:

--help show this help information

--log_file_max_size max size of log files before rollover

(default 100000000)

--log_file_num_backups number of log files to keep (default 10)

--log_file_prefix=PATH Path prefix for log files. Note that if you

are running multiple tornado processes,

log_file_prefix must be different for each

of them (e.g. include the port number)

--log_to_stderr Send log output to stderr (colorized if

possible). By default use stderr if

--log_file_prefix is not set and no other

logging is configured.

--logging=debug|info|warning|error|none

Set the Python log level. If 'none', tornado

won't touch the logging configuration.

(default info)

可以看到有日志大小,路径,级别等等的选项。

最后来看下监控效果图:

参考推荐:

linux redis 监控工具,Redis服务器监控工具redis-live相关推荐

  1. linux亚马逊服务器-安装redis

    安装redis命令 安装命令 # sudo amazon-linux-extras install redis6 -y 启动redis # systemctl start redis (启动) # s ...

  2. 部署redis mysql_【服务器部署Redis、Mysql等】-解决方式

    在服务器上部署Redis集群.mysql等服务时,没有经验的程序员们经常会按照自己在本地虚拟机里的配置一样,但总会代码报错-连接超时, 百般无解,一样的配置,为什么部署在服务器上就不行了呢? 首先,本 ...

  3. redis运行状态图形化监控工具 — RedisLive

    redis运行状态图形化监控工具 - RedisLive 学习了:https://www.cnblogs.com/Leo_wl/p/5870006.html python开发,前端bootstrap: ...

  4. 深入redis内部--初始化服务器

    初始化服务器代码如下: void initServer() {int j;signal(SIGHUP, SIG_IGN); signal(SIGPIPE, SIG_IGN);setupSignalHa ...

  5. HAProxy 的负载均衡服务器,Redis 的缓存服务器

    问答社区网络 StackExchange 由 100 多个网站构成,其中包括了 Alexa 排名第 54 的 StackOverflow.StackExchang 有 400 万用户,每月 5.6 亿 ...

  6. Linux+Nginx+Apache+Atlas+Mysql+Php+Redis 分部式部署详细版

    环境描述: 192.168.30.131 Nginx-proxy.test.com 192.168.30.132 Apache1.test.com 192.168.30.133 Apache2.tes ...

  7. Redis集群~StackExchange.redis连接Sentinel服务器并订阅相关事件

    对于redis-sentinel我在之前的文章中Redis集群~StackExchange.redis连接Twemproxy代理服务器 已经说过,它是一个仲裁者,当主master挂了后,它将在所有sl ...

  8. linux系统下安装和配置redis(2021版)

    前言:最近在阿里云市场中租用了一台ESC,学习和研发用途.操作系统版本为CentOS 7.9 64位,需要配置一些基础环境,其中就包括redis.在此记录下redis的安装和配置过程,方便自己和后来者 ...

  9. Linux上安装集群版Redis

    [前言] 之前自己在Windows中玩过一段时间Redis(感兴趣的朋友可以看下-Redis系列博客),这次在项目中也有幸能负责起Redis,也由于前两天服务器硬盘损坏导致开发的Redis服务器重新装 ...

  10. 多台云服务器中Redis的主从复制

    为了解决单点故障问题,分布式系统中通常会建立集群等方式将数据复制多个副本,部署在多个服务器上,达到容灾和负载均衡等需求,Redis也提供了复制功能,可以将相同数据复制多个副本,实现Redis的高可用. ...

最新文章

  1. bash-shell高级编程--引用
  2. HTTP状态码一览表(HTTP Status Code)
  3. 还在犹豫吗?现在参与 OCM 社区正是时候
  4. 突破极限–如何将AeroGear Unified Push用于Java EE和Node.js
  5. 企业级工作流解决方案(十六)--工作流--工作流实体模型
  6. 【Spring AOP】基于注解的 AOP 编程
  7. 最大功率点跟踪测试软件,最大功率点跟踪控制压电能量获取系统
  8. VSCode下载安装和配置Java环境
  9. mac u盘linux 双系统安装教程,苹果电脑怎么安装双系统 苹果电脑安装双系统教程...
  10. RocketMQ 内存优化
  11. 用计算机弹歌旧梦一场歌词,早知惊鸿一场何必情深一往是什么歌 《旧梦一场》歌词哪里听...
  12. Unit 2, TCP header recap
  13. 整除分块 B - Make Divisible
  14. IBM JDK(J9)垃圾回收(GC)策略
  15. 将数据库中用户表 名称设置对应的拼音账号sql
  16. PDFlib 开发指南
  17. T-SQL与PL/SQL的比较
  18. EasyMonitor 视频监控开发平台 安装教程(保姆式教程)
  19. 20位活跃在Github上的国内技术大牛 leij 何小鹏 亚信
  20. 腾讯程序员晒出了自己近五年的年薪,这涨幅简直叫人羡慕

热门文章

  1. docker 中安装 mongodb
  2. 记一次ajax交互问题
  3. mysql mysqlslap压力测试用例
  4. Web-HTML特殊符号的表示
  5. svn拉取文件合并_四、Jenkins+SVN拉取文件下发
  6. ewsa 字典_汉语字典小程序
  7. java中文乱码decode_JAVA中文字符乱码解决详解
  8. 电脑显示器闪屏_时尚超薄可升降:华硕新品家用护眼显示器MZ27AQL
  9. html 请求体 响应体,Http协议抓包详解
  10. html拖拽吸附插件,前端拖拽插件gridster.js