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