热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

linuxredis监控工具,Redis服务器监控工具redislive

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

目前来说,越来越多的使用多了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&#39;ll also need argparse if you&#39;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&#39;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&#61;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.

安装好之后就可以配置了&#xff1a;

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类型的&#xff0c;下面的RedisStatsServer就不用配置了

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

"RedisServers":

[

{

"server" : "127.0.0.1",

"port" : 6379,

"password":"xxxxxx"

}

],

配置好之后&#xff0c;就可以启动服务了。

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

./redis-live.py &

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

[root&#64;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&#61;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&#61;debug|info|warning|error|none

Set the Python log level. If &#39;none&#39;, tornado

won&#39;t touch the logging configuration.

(default info)

可以看到有日志大小&#xff0c;路径&#xff0c;级别等等的选项。

最后来看下监控效果图&#xff1a;

2320eb87610b802fd6f5bf7bcddc0895.png

参考推荐&#xff1a;



推荐阅读
  • .NetCore+DDD基础分层+项目基本框架+个人总结
    为什么要写这篇文章1,在大半年前,公司开发任务比较轻松,自己不知道干什么,但是又想要学习技术,比较迷茫,后面我接触到了博客园,看了一个帖子,深有感触,我当时不知道学习什么,于是我信 ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • EPICS Archiver Appliance存储waveform记录的尝试及资源需求分析
    本文介绍了EPICS Archiver Appliance存储waveform记录的尝试过程,并分析了其所需的资源容量。通过解决错误提示和调整内存大小,成功存储了波形数据。然后,讨论了储存环逐束团信号的意义,以及通过记录多圈的束团信号进行参数分析的可能性。波形数据的存储需求巨大,每天需要近250G,一年需要90T。然而,储存环逐束团信号具有重要意义,可以揭示出每个束团的纵向振荡频率和模式。 ... [详细]
  • 云原生边缘计算之KubeEdge简介及功能特点
    本文介绍了云原生边缘计算中的KubeEdge系统,该系统是一个开源系统,用于将容器化应用程序编排功能扩展到Edge的主机。它基于Kubernetes构建,并为网络应用程序提供基础架构支持。同时,KubeEdge具有离线模式、基于Kubernetes的节点、群集、应用程序和设备管理、资源优化等特点。此外,KubeEdge还支持跨平台工作,在私有、公共和混合云中都可以运行。同时,KubeEdge还提供数据管理和数据分析管道引擎的支持。最后,本文还介绍了KubeEdge系统生成证书的方法。 ... [详细]
  • 如何去除Win7快捷方式的箭头
    本文介绍了如何去除Win7快捷方式的箭头的方法,通过生成一个透明的ico图标并将其命名为Empty.ico,将图标复制到windows目录下,并导入注册表,即可去除箭头。这样做可以改善默认快捷方式的外观,提升桌面整洁度。 ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • baresip android编译、运行教程1语音通话
    本文介绍了如何在安卓平台上编译和运行baresip android,包括下载相关的sdk和ndk,修改ndk路径和输出目录,以及创建一个c++的安卓工程并将目录考到cpp下。详细步骤可参考给出的链接和文档。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 本文介绍了Android 7的学习笔记总结,包括最新的移动架构视频、大厂安卓面试真题和项目实战源码讲义。同时还分享了开源的完整内容,并提醒读者在使用FileProvider适配时要注意不同模块的AndroidManfiest.xml中配置的xml文件名必须不同,否则会出现问题。 ... [详细]
  • 有意向可以发简历到邮箱内推.简历直达组内Leader.能做同事的话,内推奖励全给你. ... [详细]
  • 【技术分享】一个 ELF 蠕虫分析
    【技术分享】一个 ELF 蠕虫分析 ... [详细]
  • 文章目录一、前文二、接口文档2.1请求地址2.2请求方式2.3请求参数2.4公共参数2.5签名规则三、Md5Utils工具类四、HttpUtils工具类(过时)五、HttpUtil ... [详细]
  • 多个子流程_Assets Bundle 大厅子游戏热更的新姿势!
    前言CocosCreator2.4版本出来很久了,期待了许久的新功能AssetBundle也出来了。论坛上关于bundle的帖子很多,但是没有一篇关于b ... [详细]
  • 前面刚有AWS开战MongoDB,双方“隔空互呛”,这厢又曝出2亿+简历信息泄露——MongoDB的这场开年似乎“充实”得过分了些。长期以来,作为“最受欢迎的NoSQL数据库”,M ... [详细]
author-avatar
raultch
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有