Introduction to Simple configuration of memcached database

Source: Internet
Author: User
Tags install php memcached php script

I. memcached database (memory-based storage; default port 11211)
1. Package yum-y install memcached telnet (telnet is a remote access tool, MEM software does not have a client, so you need to install Telnet connection server)
2. Starting service: Systemctl Restart Memcached.server
To see if the port is enabled: NETSTAT-ANTPU | grep mem
3. View the configuration file (no modification is required by default): Vim/etc/sysconfig/memcached
4. Connection database validation is available: Telnet 127.0.0.1 11211 (tool used by the test environment)
Set name 0 180 3 Add a data
Get name to view the added data
#0代表数据不压缩
#180数据在内存里只存180秒
#3代表存3个字符的数据
5. Installing PHP and database-associated software
Normally, the database is associated with the PHP script, the PHP package does not have the associated function, need to install manually;
Packages can be viewed by search: Yum List | grep memcached
Yum-y Install Php-pecl-memcache (installs software that can correlate mem databases)
Turn on the secondary service systemctl restart PHP-FPM
6. Prior to the Nginx static and dynamic separation, now you can directly put a PHP page directly under the HTML access;

I. Java-based Web cluster specifying a common database
1. This environment needs to be configured on two Web servers, first CP software
Need to install a jave associated memcached software, this software only need in LNMP CP corresponding file can be implemented;
CD lnmp_soft/session
CP *jar/usr/local/tomcat/lib (associated software related packages)
CP context.xml/usr/local/tomcat/conf/(config file)
2. Modify the configuration file Vim/usr/local/tomcat/conf/context.xml
Just modify the 36-line configuration to write the IP address of the memcached database shared by our web cluster
3. Restart the Web service; start the database

Introduction to Simple configuration of memcached database

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.