{"id":905,"date":"2013-05-15T10:23:58","date_gmt":"2013-05-15T02:23:58","guid":{"rendered":"https:\/\/www.ipcpu.com\/?p=905"},"modified":"2013-05-15T10:23:58","modified_gmt":"2013-05-15T02:23:58","slug":"keepalived%e8%ae%be%e7%bd%ae%e9%9d%9e%e6%8a%a2%e5%8d%a0%e6%a8%a1%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/c.ipcpu.com\/2013\/05\/keepalived%e8%ae%be%e7%bd%ae%e9%9d%9e%e6%8a%a2%e5%8d%a0%e6%a8%a1%e5%bc%8f\/","title":{"rendered":"Keepalived\u8bbe\u7f6e\u975e\u62a2\u5360\u6a21\u5f0f"},"content":{"rendered":"

Keepalived\u8bbe\u7f6e\u975e\u62a2\u5360\u6a21\u5f0f.md<\/p>\n

\u6982\u8ff0<\/h2>\n

\u6709\u65f6\u5019\u6211\u4eec\u4f7f\u7528keepalived\u6765\u5904\u7406\u6570\u636e\u5e93\u7b49\u7cfb\u7edf\u7684\u9ad8\u53ef\u7528\uff0c\u6700\u4e0d\u5e0c\u671b\u770b\u5230\u7684\u60c5\u51b5\u5c31\u662f\u5df2\u7ecf\u6b7b\u6389\u7684\u673a\u5668\u53c8\u6d3b\u4e86\u8fc7\u6765\uff0c\u56e0\u6b64\u975e\u62a2\u5360\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u914d\u7f6e\u3002<\/p>\n

Keepalived\u975e\u62a2\u5360\u914d\u7f6e\u6587\u4ef6<\/h2>\n
  1. #@MASTER\u914d\u7f6e<\/span><\/code><\/li>
  2. vrrp_instance VI_1 <\/span>{<\/span><\/code><\/li>
  3. state BACKUP <\/span>#master or slave<\/span><\/code><\/li>
  4. <\/span>interface<\/span> eth0 <\/span>#interface<\/span><\/code><\/li>
  5. virtual_router_id <\/span>51<\/span> <\/span>#router-id<\/span><\/code><\/li>
  6. priority <\/span>101<\/span> <\/span>#priority<\/span><\/code><\/li>
  7. nopreempt<\/span><\/code><\/li>
  8. advert_int <\/span>1<\/span><\/code><\/li>
  9. authentication <\/span>{<\/span><\/code><\/li>
  10. auth_type PASS<\/span><\/code><\/li>
  11. auth_pass ipcpu<\/span>.<\/span>com<\/span><\/code><\/li>
  12. <\/span>}<\/span><\/code><\/li>
  13. virtual_ipaddress <\/span>{<\/span><\/code><\/li>
  14. <\/span>211.81<\/span>.<\/span>175.208<\/span> label eth0<\/span>:<\/span>1<\/span><\/code><\/li>
  15. <\/span>}<\/span><\/code><\/li>
  16. }<\/span><\/code><\/li>
  17. #@BACKUP\u914d\u7f6e<\/span><\/code><\/li>
  18. vrrp_instance VI_1 <\/span>{<\/span><\/code><\/li>
  19. state BACKUP <\/span>#master or slave<\/span><\/code><\/li>
  20. <\/span>interface<\/span> eth0 <\/span>#interface<\/span><\/code><\/li>
  21. virtual_router_id <\/span>51<\/span> <\/span>#router-id<\/span><\/code><\/li>
  22. priority <\/span>100<\/span> <\/span>#priority<\/span><\/code><\/li>
  23. advert_int <\/span>1<\/span><\/code><\/li>
  24. authentication <\/span>{<\/span><\/code><\/li>
  25. auth_type PASS<\/span><\/code><\/li>
  26. auth_pass ipcpu<\/span>.<\/span>com<\/span><\/code><\/li>
  27. <\/span>}<\/span><\/code><\/li>
  28. virtual_ipaddress <\/span>{<\/span><\/code><\/li>
  29. <\/span>211.81<\/span>.<\/span>175.208<\/span> label eth0<\/span>:<\/span>1<\/span><\/code><\/li>
  30. <\/span>}<\/span><\/code><\/li>
  31. }<\/span><\/code><\/li><\/ol><\/pre>\n

    \u603b\u7ed3<\/h2>\n

    Keepalived\u4e0d\u62a2\u5360\u6709\u4e24\u79cd\u5199\u6cd5\uff0c\u7b2c\u4e00\u79cd\u5c31\u662f\u4e0a\u9762\u7684\u4e3e\u4f8b\uff1a
    \n\u4e3b backup priority100 nopreempt
    \n\u5907 backup priority50 <\/p>\n

    \u7b2c\u4e8c\u79cd\u5c31\u662f\u8bb2\u4f18\u5148\u7ea7\u8bbe\u7f6e\u6210\u4e00\u6837\u7684\uff0c\u8fd9\u6837\u540e\u9762\u542f\u52a8\u7684\u4e0d\u4f1a\u62a2\u5360\u3002
    \n\u4e3b backup priority100
    \n\u5907 backup priority100<\/p>\n

    \u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1aIPCPU-\u7f51\u7edc\u4e4b\u8def<\/a> » Keepalived\u8bbe\u7f6e\u975e\u62a2\u5360\u6a21\u5f0f<\/a><\/p>","protected":false},"excerpt":{"rendered":"

    Keepalived\u8bbe\u7f6e\u975e\u62a2\u5360\u6a21\u5f0f.md \u6982\u8ff0 \u6709\u65f6\u5019\u6211\u4eec\u4f7f\u7528keepalived\u6765\u5904\u7406\u6570\u636e\u5e93\u7b49\u7cfb\u7edf\u7684\u9ad8\u53ef\u7528\uff0c\u6700\u4e0d\u5e0c\u671b\u770b\u5230\u7684\u60c5\u51b5\u5c31\u662f\u5df2\u7ecf\u6b7b\u6389\u7684\u673a\u5668\u53c8\u6d3b\u4e86\u8fc7\u6765\uff0c\u56e0\u6b64\u975e\u62a2\u5360\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u914d\u7f6e\u3002 Keepalived\u975e\u62a2\u5360\u914d\u7f6e\u6587\u4ef6 #@MASTER\u914d\u7f6evrrp_instance VI_1 { state BACKUP #master or slave interface eth0 #interface virtual_router_id 51 #router-id priority 101 #priority nopreempt advert_int 1 authentication { auth_type PASS auth_pass ipcpu.com } virtual_ipaddress { 211.81.175.208 label eth0:1 }}#@BACKUP\u914d\u7f6evrrp_instance VI_1 { state BACKUP #master or slave interface eth0 #interface virtual_router_id 51 #router-id priority 100 #priority advert_int 1 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[17],"_links":{"self":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/905"}],"collection":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/comments?post=905"}],"version-history":[{"count":0,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/905\/revisions"}],"wp:attachment":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/media?parent=905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/categories?post=905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/tags?post=905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}