标签:star 共享 emctl tar mic 更改 数据库 最大 echo
yum -y install memcached nc telnet rpm -qa |egrep "memcached|nc|telnet" vim /etc/sysconfig/memcached PORT="11211" #默认端口号,实际工作中要改掉 USER="memcached" MAXCONN="1024" #最大连接数 CACHESIZE="64" #缓存大小 MB OPTIONS="-l 172.16.1.21" systemctl restart memcached.service systemctl enable memcached.service
tar xf 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 sed -i ‘$a extension=memcache.so‘ /application/php/lib/php.ini pkill php #killall php-fpm /application/php/sbin/php-fpm -t /application/php/sbin/php-fpm /application/php/bin/php -m|grep memcache
cat >/application/nginx/html/www/mc.php<<‘EOF‘
<?php
$memcache = new Memcache;
$memcache->connect(‘172.16.1.25‘, 11211) or die ("Could not connect");
$memcache->set(‘key_oldboy0‘, ‘hello,oldgirl0‘);
$memcache->set(‘key_oldboy1‘, ‘hello,oldgirl1‘);
$memcache->set(‘key_oldboy2‘, ‘hello,oldgirl2‘);
$get_value1 = $memcache->get(‘key_oldboy0‘);
$get_value2 = $memcache->get(‘key_oldboy1‘);
$get_value3 = $memcache->get(‘key_oldboy2‘);
echo "$get_value1 $get_value2 $get_value3";
?>
EOF
[root@cache01 ~]# printf "get key_oldboy0\r\n"|nc 172.16.1.21 11211
VALUE key_oldboy 0 14
hello,oldgirl0
END
find /application/nginx/html/www/memadmin -type d |xargs chmod 755 find /application/nginx/html/www/memadmin -type f |xargs chmod 644
默认账号密码:admin
标签:star 共享 emctl tar mic 更改 数据库 最大 echo
原文地址:https://www.cnblogs.com/lj7xun/p/11132799.html