Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(): Failed opening '/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear') in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723
{"id":186,"date":"2012-09-30T07:21:26","date_gmt":"2012-09-30T15:21:26","guid":{"rendered":"http:\/\/blog.unethost.com\/?p=186"},"modified":"2014-04-16T16:34:22","modified_gmt":"2014-04-16T08:34:22","slug":"centos_5_memcached_install","status":"publish","type":"post","link":"https:\/\/blog.unethost.com\/centos_5_memcached_install\/","title":{"rendered":"\u704cMemcached\u65bcFedora 17\/16, CentOS(RHEL) 6.3\/5.8"},"content":{"rendered":"

\u5728\u90e8\u5206\u820a\u7248\u7684fedora\u6216\u662fCentOS\u4e0a\uff0c\u76f4\u63a5\u7528yum\u662f\u6c92\u6709\u8fa6\u6cd5\u88ddmemcached\u7684\u3002\u6240\u4ee5\u9019\u7a2e\u6642\u5019\uff0c\u5fc5\u9808\u8981\u5f15\u5165\u984d\u5916\u7684repositories<\/p>\n

(1)\u5b89\u88ddRemi repository<\/strong> (Fedora 12~17, RHEL 6\u4e0d\u9700\u8981)<\/p>\n

## Remi Dependency on CentOS and Red Hat (RHEL)\r\nrpm -Uvh http:\/\/dl.fedoraproject.org\/pub\/epel\/5\/i386\/epel-release-5-4.noarch.rpm\r\n\r\nrpm -Uvh http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-5.rpm<\/pre>\n

(2) \u5b89\u88ddmemcached\u7684\u8edf\u4f53\u5305(package)<\/strong>
\n\u5982\u679c\u662ffedora 17\/16\/15\/14\/13\/12\u6216CentOS 6.3\/6.2\/6.1\/6<\/p>\n

yum install memcached<\/pre>\n

\u5982\u679c\u662f CentOS 5.8<\/p>\n

yum --enablerepo=remi install memcached<\/pre>\n

(3) \u8a2d\u7f6ememcached<\/strong><\/p>\n

vim \/etc\/sysconfig\/memcached\r\nPORT=\"11211\"\r\nUSER=\"memcached\"\r\nMAXCONN=\"1024\"\r\nCACHESIZE=\"512\"\r\nOPTIONS=\"\"<\/pre>\n

(4) \u555f\u52d5memcached<\/strong><\/p>\n

# Set Memcached to start automatically on boot\r\nchkconfig memcached on\r\n# Start Memcached\r\n\/etc\/init.d\/memcached start\r\n## OR ##\r\nservice memcached start<\/pre>\n

(5) \u6aa2\u67e5memcached\u662f\u5426\u6b63\u5e38\u7684\u904b\u4f5c\u3002<\/strong><\/p>\n

echo stats | nc localhost 11211\r\nSTAT pid 7599\r\nSTAT uptime 10\r\nSTAT time 1265288542\r\nSTAT version 1.4.4\r\nSTAT pointer_size 32\r\nSTAT rusage_user 0.003999\r\nSTAT rusage_system 0.052991\r\nSTAT curr_connections 10\r\nSTAT total_connections 11\r\nSTAT connection_structures 11\r\nSTAT cmd_get 0\r\nSTAT cmd_set 0\r\nSTAT cmd_flush 0\r\nSTAT get_hits 0\r\nSTAT get_misses 0\r\nSTAT delete_misses 0\r\nSTAT delete_hits 0\r\nSTAT incr_misses 0\r\nSTAT incr_hits 0\r\nSTAT decr_misses 0\r\nSTAT decr_hits 0\r\nSTAT cas_misses 0\r\nSTAT cas_hits 0\r\nSTAT cas_badval 0\r\nSTAT auth_cmds 0\r\nSTAT auth_errors 0\r\nSTAT bytes_read 6\r\nSTAT bytes_written 0\r\nSTAT limit_maxbytes 536870912\r\nSTAT accepting_conns 1\r\nSTAT listen_disabled_num 0\r\nSTAT threads 4\r\nSTAT conn_yields 0\r\nSTAT bytes 0\r\nSTAT curr_items 0\r\nSTAT total_items 0\r\nSTAT evictions 0\r\nEND\r\n\r\n# Try to get some value\r\necho get some_value | nc localhost 11211\r\nEND\r\n\r\n# Not found, but check the stats again\r\necho stats | nc localhost 11211\r\nSTAT pid 7599\r\nSTAT uptime 10\r\nSTAT time 1265288542\r\nSTAT version 1.4.4\r\n[...]\r\nSTAT cmd_get 1\r\nSTAT cmd_set 0\r\nSTAT cmd_flush 0\r\nSTAT get_hits 0\r\nSTAT get_misses 1\r\nSTAT delete_misses 0\r\n[...]\r\nSTAT evictions 0\r\nEND<\/pre>\n

(6) \u6253\u958bfirewall<\/strong><\/p>\n

\u52a0\u4e0b\u65b9\u7684 INPUT \u898f\u5247:<\/h3>\n
\n
-A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT<\/pre>\n<\/div>\n

\u91cd\u65b0\u555f\u52d5 Firewall:<\/h3>\n
\n
service iptables restart\r\n## OR ##\r\n\/etc\/init.d\/iptables restart<\/pre>\n<\/div>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u90e8\u5206\u820a\u7248\u7684fedora\u6216\u662fCentOS\u4e0a\uff0c\u76f4\u63a5\u7528yum\u662f\u6c92\u6709\u8fa6\u6cd5\u88ddmemcached\u7684\u3002\u6240\u4ee5\u9019\u7a2e\u6642\u5019\uff0c\u5fc5\u9808\u8981 … \u95b1\u8b80\u5168\u6587 \u704cMemcached\u65bcFedora 17\/16, CentOS(RHEL) 6.3\/5.8<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[1],"tags":[48],"_links":{"self":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/186"}],"collection":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/comments?post=186"}],"version-history":[{"count":2,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/186\/revisions"}],"predecessor-version":[{"id":647,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/186\/revisions\/647"}],"wp:attachment":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/media?parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/categories?post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/tags?post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}