memadmin - memcached监控工具

【基本介绍】
memadmin是可视化的memcached管理与监控工具。

【安装配置】
memadmin运行在支持memcache扩展的php环境中,服务器上需要安装memcache+php+apache/ng
现在新的版本php一般都默认有了memcahce扩展。

php扩展memcache
wget http://pecl.php.net/get/memcache-2.2.5.tgz
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
/usr/bin/phpize
#(生成config编译文件)
./configure --enable-memcache  --enable-shared  --with-php-config=/usr/bin/php-config --with-zlib-dir
make && make install

vi /etc/php.ini
extension_dir = "/usr/lib/php/modules" (首先确认extension_dir位置)
extension=memcache.so

memadmin
解压memadmin( https://github.com/junstor/memadmin)放入web目录
重启apache或者nginx即可!


【遇到的问题】
发现有时候memadmin不能读取到部分key的值,代码在set键值的时候使用memcached方式(php支持memcache,memcached2个模块),这样memadmin就不能获取到值。
我们可以修改memcached的配置文件支持的序列化,默认是igbinary 改为php。配置对php的使用性能有影响(未测试)
/etc/php.d/z-memcached.ini
; Set the default serializer for new memcached objects.
; valid values are: php, igbinary, json, json_array, msgpack
;
; json - standard php JSON encoding. This serializer
;        is fast and compact but only works on UTF-8
;        encoded data and does not fully implement
;        serializing. See the JSON extension.
; json_array - as json, but decodes into arrays
; php - the standard php serializer
; igbinary - a binary serializer
; msgpack - a cross-language binary serializer
;
; The default is igbinary if available, then msgpack if available, then php otherwise.
memcached.serializer = "php"


【php apc风格的memcached监控】
memcached.php livebookmark.net/memcachephp/memcachephp.zip
直接用web服务器访问这个文件就可以。

【参考引用】
http://blog.csdn.net/czp11210/article/details/8750506
http://www.sohailriaz.com/how-to-install-memcached-with-memcache-php-extension-on-centos-5x/
http://88fly.blog.163.com/blog/static/12268039020128611345727/

你可能感兴趣的:(PHP,memcached,memcache)