Client Software memcache-2.25.tar.gz
Service-side software memcached-1.4.13.tar.gz
Install on the server (DB01, others can also)
Yum-y Install memcached
Memcached-h View Help
Start the service
/etc/init.d/memcached start
Installation commands
Yum-y Install NC telnet
printf "Set key008 0 0 10\r\noldboy0987\r\n" |nc 127.0.0.1 11211
Display stored is correct.
[[email protected] ~]# printf "Get key008\r\n" |nc 127.0.0.1 11211
VALUE key008 0 10
oldboy0987
END
[Email protected] ~]#
10 corresponds to the number of oldboy0987
The second 0 0 0 10 represents the past time if it is 10 then expires after 10 seconds
Client
Telnet 10.0.0.51 11211
Set User01 0 0 8
12345678
STORED
Get User01
VALUE User01 0 8
12345678
END
To go in and press CTRL +] Exit Press Q
Set User01 0 0 8
12345678
Get User01
Cd/home/oldboy/tools
RZ memcache-2.2.5.tgz
RZ memadmin-1.0.12.tar.gz
Tar zxvf memcache-2.2.5.tgz
CD memcache-2.2.5
/application/php/bin/phpize
./configure--enable-memcache--with-php-config=/application/php/bin/php-config--with-zlib-dir
Make
Make install
echo "Extension=memcache.so" >>/application/php/lib/php.ini
Pkill PHP
/application/php/sbin/php-fpm
Test
vim/application/nginx/html/blog/info.php
[Email protected] blog]# pwd
/application/nginx/html/blog
[email protected] blog]# cat info.php
<?php
Phpinfo ();
?>
Cluster Sharing Session Sessions
# cd/application/php/lib/
# vim PHP.ini
Session.save_handler = Memcache
Session.save_path = "tcp://172.16.1.51:11211"
# Pkill PHP
#/application/php/sbin/php-fpm-t
Tar XF memadmin-1.0.12.tar.gz-c/application/nginx/html/blog/
http://blog.etiantian.org/memadmin/
RZ object-cache.php to/application/nginx/html/blog/wp-content
Vim object-cache.php
365 $buckets = Array (' 172.16.1.51 ');
This article is from the "12215961" blog, please be sure to keep this source http://12225961.blog.51cto.com/12215961/1902074
Memcache installation Deployment (Session hold)