Redis 在線管理工具(phpRedisAdmin)介紹

phpRedisAdmin is a simple web interface to manage Redis databases.php

phpRedisAdmin 在 Redis clients 的列表中,目前還零星有更新;nginx

It is released under the Creative Commons Attribution 3.0 license. This code is being developed and maintained by Erik Dubbelboer.git

Example,感覺一下

You can find an example database at http://dubbelboer.com/phpRedisAdmin/github

 
體會一下
  • server:同時能夠管理若干個 server;每一個 server 是 redis 的一個實例;
  • database:每一個 server 默認劃分爲 16 個庫,用於 key 空間的隔離;
  • 第 1 個filter是過濾 server 的(type here to server filter),默認 * 星號便可;
  • 第 2 個filter是過濾 key 的(type here to filter),即 KEYS 命令;
  • 藍色 i 圖標能夠查看 INFO 命令結果;
安裝
  • 下載版本包
    從 github 下載 [phpRedisAdmin],最新版 v1.6.0。依賴 predis 1.0.3 及以上;
    從 github 下載 predis,最新 v1.1.1。
  • 或者從 git 庫直接 clone
git clone https://github.com/ErikDubbelboer/phpRedisAdmin.git cd phpRedisAdmin git clone https://github.com/nrk/predis.git vendor 
配置
  • Predis 代碼直接放在 phpRedisAdmin 的 vendor 子目錄下;
    若是 predis 不存在,報 500 錯誤。
    Predis:Flexible and feature-complete Redis client for PHP and HHVM;
  • 配置 config.inc.php
    You may also want to copy includes/config.simple.inc.php to includes/config.inc.php and edit it with your specific redis configuration.
    若是你要修改配置,則複製 config.simple.inc.php 到 config.inc.php 進行修改便可;一般沒必要修改;
    訪問 redis 數據一般要進行認證,要確保數據安全;
    login 變量就是負責認證的;
  • 直接使用 nginx HTTP Basic Authentication 進行認證便可(沒必要配置修改 login 變量);
redisadmin.conf 配置片斷 の nginx
auth_basic "redisadmin authentication required"; auth_basic_user_file htpasswd/redisadmin.example.com; index index.php; location ~ ".*\.php$" { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } 
Troubleshooting(性能問題)
  • 初始頁面會加載所有數據;
  • 當 keys 上萬時,篩選是比較耗時的;
  • 內存分配耗盡問題
    error.log 以下:

2016/10/25 12:23:36 [error] 19098#0: *3394834 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/app/example/phpRedisAdmin/index.php on line 53" while reading response header from upstream, client: 1.202.201.13, server: redisadmin.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "redisadmin.example.com"
注:memory_limit 128M 內存限制問題,修改 /usr/local/php/lib/php.ini,或者 php 腳本加入 ini_set('memory_limit', '256M'); 詳見 ini_set 函數web

sasanrose/phpredmin

Sasan Rose 主導開發的這個 Web 界面,頗具特點,支持 console 命令,有統計圖形,操控性看起來很強大;redis

做者:michael_jia 連接:https://www.jianshu.com/p/0792472b4a1d 來源:簡書 著做權歸做者全部。商業轉載請聯繫做者得到受權,非商業轉載請註明出處。
相關文章
相關標籤/搜索