{"id":445,"date":"2018-07-05T10:08:28","date_gmt":"2018-07-05T09:08:28","guid":{"rendered":"http:\/\/blog.chen-hongyi.com\/?p=445"},"modified":"2018-07-05T10:08:28","modified_gmt":"2018-07-05T09:08:28","slug":"redis-sentinel-%e6%95%85%e9%9a%9c","status":"publish","type":"post","link":"https:\/\/chen-hongyi.com\/?p=445","title":{"rendered":"redis sentinel \u6545\u969c"},"content":{"rendered":"<p>\u540c\u4e8b\u628asentinel monistor mymaster \u7684ip\u7ed9\u6539\u4e86,\u9020\u6210\u65e0\u6cd5\u83b7\u53d6sentinel\u9519\u8bef.<\/p>\n<p>PHP Redis\u5ba2\u6237\u7aef\u62a5\u9519\u5982\u4e0b:<\/p>\n<blockquote><p>\nPSRedis\\Exception\\ConnectionError: All sentinels are unreachable in \/home\/xxxx\/vendor\/jamescauwelier\/psredis\/lib\/PSRedis\/MasterDiscovery.php:153\n<\/p><\/blockquote>\n<p>\u7528netstat\u68c0\u67e5\u7aef\u53e3\u60c5\u51b5<br \/>\n<code> sudo netstat -tulpn<\/code><br \/>\n\u8fd4\u56de<br \/>\n<code><br \/>\nActive Internet connections (only servers)<br \/>\nProto Recv-Q Send-Q Local Address           Foreign Address         State       PID\/Program name<br \/>\ntcp        0      0 0.0.0.0:26379           0.0.0.0:*               LISTEN      1857\/redis-sentinel<br \/>\ntcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      1025\/redis-server 1<br \/>\ntcp        0      0 0.0.0.0:58543           0.0.0.0:*               LISTEN      728\/rpc.statd<br \/>\ntcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      689\/rpcbind<br \/>\ntcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1310\/sshd<br \/>\ntcp6       0      0 :::8025                 :::*                    LISTEN      978\/mailhog<br \/>\ntcp6       0      0 :::443                  :::*                    LISTEN      1106\/apache2<br \/>\ntcp6       0      0 :::1025                 :::*                    LISTEN      978\/mailhog<br \/>\ntcp6       0      0 :::26379                :::*                    LISTEN      1857\/redis-sentinel<br \/>\ntcp6       0      0 :::111                  :::*                    LISTEN      689\/rpcbind<br \/>\ntcp6       0      0 :::80                   :::*                    LISTEN      1106\/apache2<br \/>\ntcp6       0      0 :::53301                :::*                    LISTEN      728\/rpc.statd<br \/>\ntcp6       0      0 :::22                   :::*                    LISTEN      1310\/sshd<br \/>\nudp        0      0 0.0.0.0:8869            0.0.0.0:*                           583\/dhclient<br \/>\nudp        0      0 0.0.0.0:56035           0.0.0.0:*                           728\/rpc.statd<br \/>\nudp        0      0 0.0.0.0:851             0.0.0.0:*                           689\/rpcbind<br \/>\nudp        0      0 127.0.0.1:904           0.0.0.0:*                           728\/rpc.statd<br \/>\nudp        0      0 0.0.0.0:68              0.0.0.0:*                           583\/dhclient<br \/>\nudp        0      0 0.0.0.0:111             0.0.0.0:*                           689\/rpcbind<br \/>\nudp6       0      0 :::43606                :::*                                583\/dhclient<br \/>\nudp6       0      0 :::851                  :::*                                689\/rpcbind<br \/>\nudp6       0      0 :::60366                :::*                                728\/rpc.statd<br \/>\nudp6       0      0 :::111                  :::*                                689\/rpcbind<br \/>\n<\/code><\/p>\n<p>\u539f\u56e0\u662f\u628asentiel ip\u4ece127.0.0.1 \u6539\u4e3a\u67d0\u4e2a192\u7684ip\u4e86. \u6539\u56de\u6765\u540e,\u91cd\u542fsentinel\u670d\u52a1.\u95ee\u9898\u89e3\u51b3.<\/p>\n<p><code>sudo service redis-sentinel restart<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u540c\u4e8b\u628asentinel monistor mymaster \u7684ip\u7ed9\u6539\u4e86,\u9020\u6210\u65e0 &hellip; <a href=\"https:\/\/chen-hongyi.com\/?p=445\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-445","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=445"}],"version-history":[{"count":1,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/445\/revisions"}],"predecessor-version":[{"id":446,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/445\/revisions\/446"}],"wp:attachment":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}