{"id":3069,"date":"2016-12-17T00:35:47","date_gmt":"2016-12-16T16:35:47","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=3069"},"modified":"2016-12-17T00:35:47","modified_gmt":"2016-12-16T16:35:47","slug":"%e7%94%a8rsyslog%e8%bf%9b%e8%a1%8c%e5%8f%af%e9%9d%a0%e7%9a%84%e6%97%a5%e5%bf%97%e8%bd%ac%e5%8f%91","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/3069.html","title":{"rendered":"\u7528Rsyslog\u8fdb\u884c\u53ef\u9760\u7684\u65e5\u5fd7\u8f6c\u53d1"},"content":{"rendered":"<p>=Start=<\/p>\n<h4>\u7f18\u7531\uff1a<\/h4>\n<p>\u6700\u8fd1\u5728\u5b66\u4e60\u7814\u7a76rsyslog\u7684\u914d\u7f6e\u548c\u4f7f\u7528\uff0c\u770b\u7740\u8fd9\u4e2a\u529f\u80fd\u633a\u5b9e\u7528\u7684\uff0c\u5c31\u60f3\u7740\u7ffb\u8bd1\u6210\u4e2d\u6587\uff0c\u65b9\u4fbf\u81ea\u5df1\u53c2\u8003\u3002<\/p>\n<p>\u82f1\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.rsyslog.com\/doc\/v8-stable\/tutorials\/reliable_forwarding.html\">http:\/\/www.rsyslog.com\/doc\/v8-stable\/tutorials\/reliable_forwarding.html<\/a><\/p>\n<h4>\u6b63\u6587\uff1a<\/h4>\n<h5>\u53c2\u8003\u89e3\u7b54\uff1a<\/h5>\n<h6>\u6458\u8981\uff1a<\/h6>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4f1a\u63cf\u8ff0\u5982\u4f55(\u975e\u5e38)\u53ef\u9760\u7684\u901a\u8fc7rsyslog\u8f6c\u53d1syslog\u65e5\u5fd7\u5230\u4e00\u4e2a\u4e2d\u592e\u65e5\u5fd7\u670d\u52a1\u5668\u4e0a\u53bb\u3002\u8fd9\u9700\u8981\u5728client\u673a\u5668\u4e0a\u5b89\u88c5\u6709rsyslog\uff0c\u540c\u65f6\u4e5f\u63a8\u8350\u5728server\u673a\u5668\u4e0a\u5b89\u88c5rsyslog\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a\u5de5\u4e1a\u6807\u51c6\u7684plain-TCP-syslog\u534f\u8bae\u5e76\u4e0d\u662f\u5b8c\u5168\u53ef\u9760\u7684\u3002\u5982\u679c\u4f60\u9700\u8981\u4e00\u4e2a\u771f\u7684\u975e\u5e38\u53ef\u9760\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u53ef\u4ee5\u8bd5\u8bd5rsyslog\u652f\u6301\u7684 RELP \u534f\u8bae\u3002<\/p>\n<h6>\u76ee\u6807\uff1a<\/h6>\n<p>\u53ea\u89812\u4e2a\u7cfb\u7edf\u901a\u8fc7\u7f51\u7edc\u8fdb\u884c\u901a\u4fe1\uff0c\u9519\u8bef\u5c31\u53ef\u80fd\u4f1a\u53d1\u751f\u3002\u6bd4\u5982\uff1a\u901a\u4fe1\u94fe\u8def\u53ef\u80fd\u4f1adown\u6389\uff0c\u5ba2\u6237\u7aef\u6216\u670d\u52a1\u5668\u7aef\u53ef\u80fd\u4f1a\u7ec8\u6b62\uff0c\u5373\u4fbf\u662f\u5728\u5e38\u89c4\u573a\u666f\u4e2d\uff0c\u670d\u52a1\u5668\u4e5f\u53ef\u80fd\u56e0\u4e3a\u4f8b\u884c\u7ef4\u62a4\u800c\u505c\u6b62\u670d\u52a1\u4e00\u6bb5\u65f6\u95f4\u3002<\/p>\n<p>\u4e00\u4e2a\u53ef\u9760\u7684\u65e5\u5fd7\u7cfb\u7edf\u5e94\u8be5\u5728server\u7aef\u4e0d\u53ef\u8fbe\u7684\u65f6\u5019\u4fdd\u8bc1\u65e5\u5fd7\u4e0d\u4e22\u5931\uff0c\u4e3a\u4e86\u505a\u5230\u8fd9\u70b9\uff0c\u5728server\u7aef\u4e0d\u53ef\u7528\u7684\u65f6\u5019\uff0c\u672a\u53d1\u9001\u7684\u6570\u636e\u5c31\u5e94\u8be5\u88ab\u7f13\u5b58\u5728client\u4e0a\u3002\u56e0\u6b64\u5f53server\u7aef\u91cd\u542f\u4e4b\u540e\uff0c\u6d88\u606f\u53c8\u80fd\u591f\u88ab\u91cd\u65b0\u53d1\u9001\u51fa\u53bb\u3002<\/p>\n<p>\u901a\u8fc7rsyslog\u4f60\u53ef\u4ee5\u8f7b\u6613\u5730\u505a\u5230\u8fd9\u4e00\u70b9\u3002\u5728rsyslog\u4e2d\uff0c\u6bcf\u4e00\u4e2aAction\u90fd\u662f\u8fd0\u884c\u5728\u81ea\u5df1\u7684queue\u4e2d\u7684\uff0c\u800c\u4e14\u6bcf\u4e2aqueue\u5728Action\u6ca1\u6709\u51c6\u5907\u597d\u7684\u65f6\u5019\u90fd\u80fd\u591f\u7f13\u5b58\u6570\u636e\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u53ea\u80fd\u901a\u8fc7plain-tcp-rsyslog\u534f\u8bae\u548cRELP\u534f\u8bae\u505a\u5230\u8fd9\u4e00\u70b9(\u68c0\u6d4bAction\u51c6\u5907\u597d\u4e86\u6ca1\u6709)\u3002<\/p>\n<p>\u6211\u4eec\u8fd9\u5728\u8bb2\u7684\u5185\u5bb9\u662frsyslog\u7684\u7279\u6027\uff0c\u6240\u4ee5\u5728client\u4e0a\u5fc5\u987b\u8981\u88c5\u6709rsyslog\u3002<\/p>\n<p>\u65e5\u5fd7\u5185\u5bb9\u5148\u662f\u4f1a\u88ab\u7f13\u5b58\u5230\u5185\u5b58\u91cc\u9762\uff0cqueue\u7684\u5185\u5b58\u4e0d\u591f\u7528\u4e86\u4e4b\u540e\u624d\u4f1a\u7f13\u5b58\u81f3\u78c1\u76d8\u3002\u8fd9\u4e48\u505a\u662f\u51fa\u4e8e\u6027\u80fd\u7684\u8003\u8651\u3002<\/p>\n<h6>\u5982\u4f55\u8bbe\u7f6e\uff1a<\/h6>\n<pre class=\"lang:default decode:true \">$WorkDirectory \/rsyslog\/work # \u8bbe\u7f6e\u9ed8\u8ba4\u7684\u5b58\u653e\u8def\u5f84\n# ...\n$ActionQueueType LinkedList # use asynchronous processing\n$ActionQueueFileName srvrfwd # \u8bbe\u7f6e\u78c1\u76d8\u4e0a\u7684\u6587\u4ef6\u540d\n$ActionResumeRetryCount -1 # infinite retries on insert failure\n$ActionQueueSaveOnShutdown on # save in-memory data if rsyslog shuts down\n# ...<\/pre>\n<h6>\u5982\u4f55\u8f6c\u53d1\u81f3\u591a\u53f0\u673a\u5668\uff1a<\/h6>\n<p>\u4e00\u4e2a\u8f6c\u53d1\u76ee\u6807\u5bf9\u5e94\u4e00\u4e2a\u8f6c\u53d1\u89c4\u5219(\u9664\u4e86WorkDirectory\u4e4b\u5916\uff0c\u5176\u5b83\u90fd\u9700\u8981\u5199\u5168)<\/p>\n<h6>\u5173\u4e8e\u53ef\u9760\u6027\u8fd8\u6709\u4e00\u70b9\u8981\u8bf4\u7684\u662f\uff1a<\/h6>\n<p>\u4f7f\u7528plain-tcp-syslog\u534f\u8bae\u4f1a\u6bd4\u666e\u901a\u7684UDP-syslog\u534f\u8bae\u53ef\u9760\u5f88\u591a\uff0c\u4f46\u662f\uff0c\u5b83\u4e5f\u4e0d\u662f\u5b8c\u5168\u53ef\u9760\u7684\uff0c\u5982\u679c\u4f60\u9700\u8981\u5b8c\u5168\u53ef\u9760\uff0c\u8bf7\u4f7f\u7528 RELP \u534f\u8bae\u3002\u539f\u56e0\u7684\u8bdd\u53ef\u4ee5\u53c2\u8003\u6587\u7ae0\uff1a<a href=\"http:\/\/blog.gerhards.net\/2008\/04\/on-unreliability-of-plain-tcp-syslog.html\">http:\/\/blog.gerhards.net\/2008\/04\/on-unreliability-of-plain-tcp-syslog.html<\/a>\u00a0\u3002<\/p>\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u6700\u8fd1\u5728\u5b66\u4e60\u7814\u7a76rsyslog\u7684\u914d\u7f6e\u548c\u4f7f\u7528\uff0c\u770b\u7740\u8fd9\u4e2a\u529f\u80fd\u633a\u5b9e\u7528\u7684\uff0c\u5c31\u60f3\u7740\u7ffb\u8bd1\u6210\u4e2d\u6587\uff0c\u65b9\u4fbf [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,11,12],"tags":[692],"class_list":["post-3069","post","type-post","status-publish","format-standard","hentry","category-knowledgebase-2","category-linux","category-tools","tag-rsyslog"],"views":8364,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=3069"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3069\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=3069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=3069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=3069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}