Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mencached cluster deployment

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Overview of Mencached basic deployment Mamcached

Memcached is a distributed cache system that runs in memory. Memcached lacks authentication and security control, which means that the memcached server should be placed behind the firewall.

Lab preparation name role address centos7-1 server 192.168.142.66centos7-2 client 192.168.142.77 experiment step memcached server

Install the environment package

[root@localhost libevent-2.1.8-stable] # yum install gcc gcc-c++ make-y

Install the Libevent software ontology

[root@localhost memcached] # tar zxf libevent-2.1.8-stable.tar.gz-C / opt/ [root@localhost memcached] # cd / opt/libevent-2.1.8-stable/// configuration and compilation installation [root@localhost libevent-2.1.8-stable] # / configure\-- prefix=/usr/local/libevent [root@localhost libevent-2.1.8-stable] # make & & make install

Configure, install Memcached

[root@localhost memcached] # tar zxf memcached-1.5.6.tar.gz-C / opt/ [root@localhost memcached] # cd / opt/memcached-1.5.6/ [root@localhost memcached-1.5.6] #. / configure\-- prefix=/usr/local/memached\-- with-libevent=/usr/local/libevent/ [root@localhost memcached-1.5.6] # make & & make install// establish a soft link [root@localhost memcached-1.5.6 ] # ln-s / usr/local/memached/bin/* / usr/local/bin/

Start the service

[root@localhost memcached-1.5.6] # memcached- d-m 32m-p 11211-u root// "- d": run as daemon (running in the background) / / "- m": specify the maximum amount of memory used / / "- p": specify port / / "- u": specify user [root@localhost memcached-1.5.6] # netstat-atnp | grep 11211tcp 000.0.0.0 : 11211 0.0.0.0 LISTEN 12591/memcached tcp6 0: 11211:: * LISTEN 12591/memcached [root@localhost memcached-1.5.6] # systemctl stop firewalld.service [root@localhost memcached-1.5.6] # setenforce 0

Install Telent to connect to Memcached

[root@localhost memcached-1.5.6] # yum install telnet-yamp / connect memcached [root@localhost memcached-1.5.6] # telnet 192.168.142.66 11211Trying 192.168.142.66...Connected to 192.168.142.66.Escape character is'^]'. Client

Install the LAMP schema

For details, please see my previous blog, where there is a detailed deployment process, so I will not repeat it here.

Blog address:

Lift the right in the database

Mysql "> [root@localhost ~] # mysql-uroot-pmysql > create database sky;mysql > grant all on sky.* to 'skyuser'@'%' identified by' 123123 transactions MySQL > flush privileges

Test whether the PHP tool can connect to the database

```php+HTML

[root@localhost htdocs] # vim / usr/local/httpd/htdocs/index.php

* * installation, Configure the memcache client * * ```java [root @ localhost memcached] # tar zxf memcache-2.2.7.tgz-C / opt/ [root@localhost memcached] # cd / opt/memcache-2.2.7/ [root@localhost memcache-2.2.7] # / usr/local/php5/bin/phpize / / generate a startup script [root@localhost memcache-2.2.7] # / configure\-enable-memcache\-- with-php-config=/usr/ for memcache Local/php5/bin/php-config// compilation & install [root@localhost memcache-2.2.7] # make & & make install

Modify the configuration file of PHP

[root@localhost memcache-2.2.7] # vim / usr/local/php5/php.ini//736 add extension_dir = "/ usr/local/php5/lib/php/extensions/no-debug-zts-20131226/" extension = memcache.so after the line

Set up a test page

```php+HTML

[root@localhost memcache-2.2.7] # vim / usr/local/httpd/htdocs/index.php

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report