Memcache installation Deployment (Session hold)

Source: Internet
Author: User
Tags fpm memcached pkill

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.