\u914d\u7f6e<\/strong><\/div>\n\u524d\u9762\u5728\u542f\u52a8redis\u670d\u52a1\u5668\u540e\uff0c\u90fd\u662f\u5728\u524d\u53f0\u542f\u52a8\u7684\uff0c\u9700\u8981\u91cd\u65b0\u542f\u52a8\u4e00\u4e2a\u5ba2\u6237\u7aef\u6765\u8fdb\u884c\u767b\u9646\u64cd\u4f5c\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u9700\u8981\u8bbe\u7f6e\u540e\u53f0\u542f\u52a8\u3002<\/p>\n
1. \u4fee\u6539redis.conf\u6587\u4ef6\uff0cdaemonize no\u4fee\u6539\u4e3adaemonize yes \u8fd9\u91cc\u8868\u793a\u5c06redis\u4ee5\u5b88\u62a4\u8fdb\u7a0b\u7684\u65b9\u5f0f\u5728\u540e\u53f0\u8fd0\u884c\uff1b<\/p>\n
2. \u8bbe\u7f6eredis\u670d\u52a1\u5f00\u673a\u81ea\u52a8\u542f\u52a8<\/p>\n
\u5728\/etc\/init.d\u76ee\u5f55\u4e0b\u521b\u5efaredis\u7684\u542f\u52a8\u811a\u672c\uff1b
\n\u5c06redis\u5b89\u88c5\u76ee\u5f55\u4e0b\u7684utils\/redis_init_script\u590d\u5236\u5230\/etc\/init.d\u76ee\u5f55\u4e0b\uff0c\u547d\u540d\u4e3aredis\uff1b
\n\u7ee7\u7eed\u7f16\u8f91\u542f\u52a8\u6587\u4ef6\uff0c\u4fee\u6539\u5176\u4e2d\u6307\u5b9a\u7684pid\u548c\u914d\u7f6e\u6587\u4ef6\uff1b<\/p>\n
\r\ncp utils\/redis_init_script \/etc\/init.d\/redis\r\nll \/etc\/init.d\/redis\r\n-rwxr-xr-x. 1 root root 1352 4\u6708 11 15:18 \/etc\/init.d\/redis\r\nvim \/etc\/init.d\/redis # \u7f16\u8f91\u542f\u52a8\u6587\u4ef6\r\nPIDFILE=\/var\/run\/redis_${REDISPORT}.pid\r\nCONF=\"\/etc\/redis\/${REDISPORT}.conf\"\r\n\u4fee\u6539\u4e3a\r\nPIDFILE=\/var\/redis\/run\/redis_${REDISPORT}.pid # \u5b58\u653epid\u7684\u76ee\u5f55\uff0c\u5982\u679c\u6ca1\u6709\u8bb0\u5f97\u521b\u5efa\r\nCONF=\"\/etc\/redis\/redis.conf\"\r\nmkdir -p \/var\/redis\/run # \u521b\u5efa\u5b58\u653epid\u76ee\u5f55\r\n<\/pre>\n3. \u628a\u914d\u7f6e\u6587\u4ef6\u590d\u5236\u4e00\u4efd\u5230\/etc\/redis\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u9762\uff0c\u7136\u540e\u4fee\u6539\u6587\u4ef6pid\u5730\u5740\u4e3a\u524d\u9762\u914d\u7f6e\u7684\u5730\u5740<\/p>\n
\r\nmkdir -p \/etc\/redis\r\ncp \/usr\/local\/redis\/redis.conf \/etc\/redis\/redis.conf\r\nvim \/etc\/redis\/redis.conf\r\npidfile \/var\/run\/redis_6379.pid\r\n\u4fee\u6539\u4e3a\r\npidfile \/var\/redis\/run\/redis_6379.pid\r\n<\/pre>\n\u81ea\u6b64\uff0c\u6211\u4eec\u5df2\u7ecf\u53ef\u4ee5\u901a\u8fc7service redis start\/stop\u6765\u542f\u52a8\u548c\u5173\u95edredis\u670d\u52a1\u4e86\u3002<\/p>\n
\u6700\u540e\u53ea\u9700\u8981\u901a\u8fc7chkconfig redis on\u547d\u4ee4\u6765\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\u5373\u53ef\u3002<\/p>\n
\u5982\u679c\u63d0\u793aredis \u670d\u52a1\u4e0d\u652f\u6301 chkconfig\u7684\u8bdd\uff0c\u53ea\u9700\u8981\u5728\/etc\/init.d\/redis\u8fd9\u4e2a\u542f\u52a8\u811a\u672c\u7684\u7b2c\u4e8c\u884c\u540e\u9762\u52a0\u4e0a\u4e0b\u9762\u7684\u5185\u5bb9\u5373\u53ef<\/p>\n
\r\n# chkconfig:2345 90 10\r\n#\r\n# description:Redis is a persistent key-value database\r\n<\/pre>\n\u5378\u8f7d<\/strong><\/div>\n1. \u505c\u6b62redis\u670d\u52a1\u5668\uff0c\u901a\u8fc7\u547d\u4ee4ps aux|grep redis\u67e5\u770bredis\u670d\u52a1\u662f\u5426\u5728\u8fd0\u884c\u3002\u53ef\u4ee5\u770b\u5230\u57286379\u7aef\u53e3\uff0c\u6709redis-server\u7684\u76d1\u542c\u3002<\/p>\n
<\/p>\n
\u4f7f\u7528\u547d\u4ee4redis-cli shutdown\u505c\u6b62redis\u670d\u52a1\u5668\u3002<\/p>\n
\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7531\u4e8e\u6211\u7684redis\u547d\u4ee4\u90fd\u5b89\u88c5\u5230\/usr\/local\/bin\u76ee\u5f55\u4e0b\u9762\u4e86\uff0c\u5e76\u4e14\u6dfb\u52a0\u5230\u73af\u5883\u53d8\u91cfPATH\u91cc\u9762\u4e86\uff0c\u6240\u4ee5\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u3002<\/p>\n
2. \u5220\u9664make\u7684\u65f6\u5019\u751f\u6210\u7684\u51e0\u4e2aredis-***\u7684\u6587\u4ef6rm -f \/usr\/local\/bin\/redis*<\/p>\n
3. \u5220\u9664\u6389\u89e3\u538b\u540e\u7684\u6587\u4ef6\u76ee\u5f55\u548c\u6240\u6709\u6587\u4ef6<\/p>\n
\u8fd9\u6837redis\u5c31\u5378\u8f7d\u5b8c\u6210\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
1. \u9996\u5148\u5728Redis\u5b98\u7f51\u4e0b\u8f7dtar.gz\u7684\u5b89\u88c5\u5305\uff0c\u6216\u8005\u901a\u8fc7wget\u7684\u65b9\u5f0f\u5728Redis\u91ca\u51fa\u7248\u672c\u91cc\u76f4\u63a5\u4e0b\u8f7d\uff1b 2 […]<\/p>\n","protected":false},"author":1903,"featured_media":254717,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-254713","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/254713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1903"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=254713"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/254713\/revisions"}],"predecessor-version":[{"id":254716,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/254713\/revisions\/254716"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/254717"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=254713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=254713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=254713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}