Redis 管理工具

版权声明:微信:15216874307 QQ:1009002494 https://blog.csdn.net/Doudou_Mylove/article/details/89353039

phpredisadmin

另外站在性能的角度上看,我不建议在线上redis环境中使用,毕竟PHPredisadmin是一款对海量大数据进行管理的web界面,会消耗比较大的系统资源

这个工具只有github上面有,并且需要编译安装redis模块会用到php和php-redis

安装启动httpd

yum -y install httpd

/etc/init.d/httpd start

先安装git

卸载自带的git:  yum remove git -t

下载地址:https://mirrors.edge.kernel.org/pub/software/scm/git/

安装依赖

yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel libcurl4-gnutls-dev libexpat1-dev gettext  libz-dev libssl-dev asciidoc xmlto docbook2x

下面一步是为了避免执行make all doc info时报:/bin/sh: line 1: docbook2x-texi: command not found

ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz

tar xf git-2.9.5.tar.gz

cd git-2.9.5

编译安装

make configure

./configure --prefix=/usr/local/git            // 配置安装路径

make all doc info                    // 编译

make install install-doc install-html install-info   // 安装

#完成后,你可以使用 Git 来获取 Git 的升级: 可选  

git clone git://git.kernel.org/pub/scm/git/git.git

修改环境变量

echo -e "# git\nexport PATH=/usr/local/git/bin:\$PATH"> /etc/profile.d/git.sh

查看是否安装成功

[root@localhost git-2.9.5]# git --version

git version 2.9.5

克隆安装phpredisadmin配置

cd /var/www/html

升级ssl证书

yum update -y nss curl libcurl openssh

执行克隆命令

git clone https://github.com/erikdubbelboer/phpRedisAdmin.git

继续执行

cd phpRedisAdmin

git clone https://github.com/nrk/predis.git vendor

mv phpRedisAdmin admin

yum install php-mbstring -y

/etc/init.d/httpd restart

浏览器访问:10.3.45.233/admin

配置添加多个server节点

[root@localhost ~]# cd /var/www/html/admin/includes/

[root@localhost includes]# ll

总用量 36

-rw-r--r--. 1 apache apache 3482 12月  7 17:18 common.inc.php

-rw-r--r--. 1 apache apache  992 12月  7 17:18 config.environment.inc.php

-rw-r--r--. 1 apache apache 3081 12月  7 17:18 config.sample.inc.php

-rw-r--r--. 1 apache apache   16 12月  7 17:18 footer.inc.php

-rw-r--r--. 1 apache apache 2775 12月  7 17:18 functions.inc.php

-rw-r--r--. 1 apache apache 1066 12月  7 17:18 header.inc.php

-rw-r--r--. 1 apache apache 5002 12月  7 17:18 login.inc.php

-rw-r--r--. 1 apache apache  310 12月  7 17:18 page.inc.php

[root@localhost includes]# cp config.sample.inc.php ./config.sample.inc.php.bak

[root@localhost includes]# vim config.sample.inc.php

工具rdbtools

生产中会用来分析内存

下载安装pip

wget --no-check-certificate https://bootstrap.pypa.io/3.2/get-pip.py
python get-pip.py
pip -V  #查看pip版本

用pip安装rdbtools

pip install rdbtools

生成内存报告

运行时会 -c memory生成一个CSV报告,其中包含该密钥使用的大致内存。--bytes C并且'--largest N可用于将输出限制为大于C字节的键或N个最大键。

rdb -c memory /var/redis/6379/dump.rdb --bytes 128 -f memory.csv

或者rdb -c memory /var/redis/6379/dump.rdb >> memory.csv

cat memory.csv

还可以把生成的scv表格导入到本地查看。

.........

未完结,请稍等...

猜你喜欢

转载自blog.csdn.net/Doudou_Mylove/article/details/89353039