{"id":5815,"date":"2024-11-14T08:18:54","date_gmt":"2024-11-14T00:18:54","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5815\/"},"modified":"2024-11-14T08:18:54","modified_gmt":"2024-11-14T00:18:54","slug":"%e6%80%8e%e4%b9%88%e5%88%a4%e6%96%adredis%e6%98%af%e5%90%a6%e5%90%af%e5%8a%a8%e6%88%90%e5%8a%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5815\/","title":{"rendered":"\u600e\u4e48\u5224\u65adredis\u662f\u5426\u542f\u52a8\u6210\u529f"},"content":{"rendered":"<blockquote><p>\n  \u5224\u65ad redis \u662f\u5426\u542f\u52a8\u6210\u529f\uff1a\u68c0\u67e5\u8fdb\u7a0b\u662f\u5426\u5b58\u5728\u5e76\u6b63\u5728\u8fd0\u884c\u3002\u4f7f\u7528 telnet \u5ba2\u6237\u7aef\u8fde\u63a5\u5230 redis \u670d\u52a1\u5668\u5e76\u67e5\u770b\u662f\u5426\u6536\u5230\u547d\u4ee4\u63d0\u793a\u7b26\u3002\u8f93\u5165 ping \u547d\u4ee4\u5e76\u68c0\u67e5\u662f\u5426\u6536\u5230 &#8220;pong&#8221; \u54cd\u5e94\u3002\u67e5\u770b redis \u65e5\u5fd7\u6587\u4ef6\u662f\u5426\u6709\u9519\u8bef\u6216\u8b66\u544a\u6d88\u606f\u3002\u5728\u67d0\u4e9b\u7cfb\u7edf\u4e0a\uff0c\u8fd8\u53ef\u4ee5\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\u4ee5\u67e5\u627e\u6709\u5173 redis \u542f\u52a8\u72b6\u6001\u7684\u6d88\u606f\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/03\/2024060320032021330.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u5224\u65adredis\u662f\u5426\u542f\u52a8\u6210\u529f\u63d2\u56fe\" alt=\"\u600e\u4e48\u5224\u65adredis\u662f\u5426\u542f\u52a8\u6210\u529f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5224\u65ad Redis \u662f\u5426\u542f\u52a8\u6210\u529f<\/strong><\/p>\n<p>\u5224\u65ad Redis \u662f\u5426\u6210\u529f\u542f\u52a8\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<p><strong>1. \u68c0\u67e5\u8fdb\u7a0b<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 ps aux | grep  \u547d\u4ee4\u68c0\u67e5 Redis \u8fdb\u7a0b\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002<\/li>\n<li>\n<p>\u5982\u679c\u8f93\u51fa\u7c7b\u4f3c\u4e8e\u4ee5\u4e0b\u5185\u5bb9\uff0c\u5219 Redis \u5df2\u6210\u529f\u542f\u52a8\uff1a<\/p>\n<pre>redis-server 774  0.0  0.2 131792 16316 ?  Ssl  Jan05   0:04 \/usr\/local\/bin\/redis-server 127.0.0.1:6379<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>2. Telnet \u8fde\u63a5<\/strong><\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528 Telnet \u5ba2\u6237\u7aef\u8fde\u63a5\u5230 Redis \u670d\u52a1\u5668\uff1a<\/p>\n<pre>telnet 127.0.0.1 6379<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p>\u5982\u679c\u8fde\u63a5\u6210\u529f\uff0c\u60a8\u5c06\u770b\u5230 Redis \u547d\u4ee4\u63d0\u793a\u7b26\uff1a<\/p>\n<pre>redis 127.0.0.1:6379&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>3. Ping \u547d\u4ee4<\/strong><\/p>\n<ul>\n<li>\n<p>\u5728 Redis \u547d\u4ee4\u63d0\u793a\u7b26\u4e0b\u8f93\u5165 ping \u547d\u4ee4\uff1a<\/p>\n<pre>redis 127.0.0.1:6379&gt; ping\nPONG<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\u5982\u679c\u6536\u5230 &#8220;PONG&#8221; \u54cd\u5e94\uff0c\u5219 Redis \u6b63\u5728\u8fd0\u884c\u5e76\u53ef\u4ee5\u8bbf\u95ee\u3002<\/li>\n<\/ul>\n<p><strong>4. \u68c0\u67e5\u65e5\u5fd7\u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u67e5\u770b Redis \u65e5\u5fd7\u6587\u4ef6\uff08\u901a\u5e38\u4f4d\u4e8e \/var\/log\/redis\/redis.log\uff09\u662f\u5426\u6709\u9519\u8bef\u6216\u8b66\u544a\u6d88\u606f\u3002<\/li>\n<li>\u5982\u679c\u65e5\u5fd7\u6587\u4ef6\u4e3a\u7a7a\u6216\u6ca1\u6709\u9519\u8bef\u6d88\u606f\uff0c\u5219 Redis \u53ef\u80fd\u5df2\u6210\u529f\u542f\u52a8\u3002<\/li>\n<\/ul>\n<p><strong>5. \u7cfb\u7edf\u65e5\u5fd7<\/strong><\/p>\n<ul>\n<li>\u5728\u67d0\u4e9b\u7cfb\u7edf\u4e0a\uff0c\u60a8\u8fd8\u53ef\u4ee5\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\uff08\u4f8b\u5982 \/var\/log\/messages\uff09\u4ee5\u67e5\u627e\u6709\u5173 Redis \u542f\u52a8\u72b6\u6001\u7684\u6d88\u606f\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5224\u65ad\u662f\u5426\u542f\u52a8\u6210\u529f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5224\u65ad redis \u662f\u5426\u542f\u52a8\u6210\u529f\uff1a\u68c0\u67e5\u8fdb\u7a0b\u662f\u5426\u5b58\u5728\u5e76\u6b63\u5728\u8fd0\u884c\u3002\u4f7f\u7528 telnet \u5ba2\u6237\u7aef\u8fde\u63a5\u5230 redis \u670d\u52a1\u5668\u5e76\u67e5\u770b\u662f\u5426\u6536\u5230\u547d\u4ee4\u63d0\u793a\u7b26\u3002\u8f93\u5165 ping \u547d\u4ee4\u5e76\u68c0\u67e5\u662f\u5426\u6536\u5230 &#8220;pong&#8221; \u54cd\u5e94\u3002\u67e5\u770b redis \u65e5\u5fd7\u6587\u4ef6\u662f\u5426\u6709\u9519\u8bef\u6216\u8b66\u544a\u6d88\u606f\u3002\u5728\u67d0\u4e9b\u7cfb\u7edf\u4e0a\uff0c\u8fd8\u53ef\u4ee5\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\u4ee5\u67e5\u627e\u6709\u5173 redis \u542f\u52a8\u72b6\u6001\u7684\u6d88\u606f\u3002 \u5982\u4f55\u5224\u65ad Redis \u662f\u5426\u542f\u52a8\u6210\u529f \u5224\u65ad Redis \u662f\u5426\u6210\u529f\u542f\u52a8\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a 1. \u68c0\u67e5\u8fdb\u7a0b \u4f7f\u7528 ps aux | grep \u547d\u4ee4\u68c0\u67e5 Redis \u8fdb\u7a0b\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002 \u5982\u679c\u8f93\u51fa\u7c7b\u4f3c\u4e8e\u4ee5\u4e0b\u5185\u5bb9\uff0c\u5219 Redis \u5df2\u6210\u529f\u542f\u52a8\uff1a redis-server 774 0.0 0.2 131792 16316 ? Ssl Jan05 0:04 \/usr\/local\/bin\/redis-server 127.0.0.1:6379 \u767b\u5f55\u540e\u590d\u5236 2. Telnet \u8fde\u63a5 \u4f7f\u7528 Telnet \u5ba2\u6237\u7aef\u8fde\u63a5\u5230 Redis \u670d\u52a1\u5668\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-5815","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5815","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=5815"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5815\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}