{"id":26020,"date":"2020-02-17T14:30:48","date_gmt":"2020-02-17T06:30:48","guid":{"rendered":"http:\/\/4563.org\/?p=26020"},"modified":"2020-02-17T14:30:48","modified_gmt":"2020-02-17T06:30:48","slug":"%e5%be%88%e5%a4%9a%e4%ba%ba%e9%97%ae%e6%88%91%ef%bc%8c%e5%a6%82%e4%bd%95%e8%bd%ac%e5%8f%91tg%e4%bb%a3%e7%90%86%e8%83%bd%e7%a8%b3%e5%ae%9a%e4%b8%80%e7%82%b9%ef%bc%8c%e4%bb%8a%e5%a4%a9%e4%bb%96%e6%9d%a5","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=26020","title":{"rendered":"\u5f88\u591a\u4eba\u95ee\u6211\uff0c\u5982\u4f55\u8f6c\u53d1TG\u4ee3\u7406\u80fd\u7a33\u5b9a\u4e00\u70b9\uff0c\u4eca\u5929\u4ed6\u6765\u4e86"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>dtkevin<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u5f88\u591a\u4eba\u95ee\u6211\uff0c\u5982\u4f55\u8f6c\u53d1TG\u4ee3\u7406\u80fd\u7a33\u5b9a\u4e00\u70b9\uff0c\u4eca\u5929\u4ed6\u6765\u4e86<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 dtkevin \u4e8e 2020-2-17 14:23 \u7f16\u8f91 <\/p>\n<p> \u6700\u8fd1\u505a\u9879\u76ee\u53ef\u80fd\u4f1a\u8d54\u5f88\u591a\u94b1\uff0c\u70e6\u8e81\uff0c\u5199\u4e2a\u6559\u7a0b\u5427\u3002\u53ef\u4ee5\u89e3\u4e00\u65f6\u71c3\u7709\u4e4b\u6025<\/p>\n<p>  \u5199\u70b9\u4e1c\u897f\u4e0d\u5bb9\u6613\uff0c\u6c42\u4f60\u4eec\u522b\u6495\u903c\u3002\u597d\u4e0d\u597d\u7528\uff0c\u81ea\u5df1\u7528\u4e86\u624d\u77e5\u9053\u3002<\/p>\n<p>  \u8fd9\u4e2a\u5b8c\u5168\u590d\u5236\u7c98\u8d34\u5c31\u884c\uff0c\u6ca1\u6709\u4efb\u4f55\u9690\u85cf\u6b65\u9aa4<\/p>\n<p>  \u672c\u6587\u7531n2n+sprov-ui+Haproxy <\/p>\n<p>  n2n\u662f\u4e00\u4e2a\u4e8c\u5c42\u67b6\u6784\u7684\u6276\u5899\u7f51\u7edc\uff0c\u5176\u4e2dsuper node\u63d0\u4f9b\u573a\u6240\uff0c\u8ba9\u4e24\u4e2a\u4f4d\u4e8eNAT\/\u9632\u706b\u5899\u4e4b\u540e\u7684edge node\u8fdb\u884c\u4f1a\u9762\uff0c\u4e00\u65e6\u53cc\u65b9\u5b8c\u6210\u9996\u6b21\u63e1\u624b\uff0c\u5269\u4e0b\u7684\u6570\u636e\u6d41\u5c31\u4e4b\u53d1\u751f\u5728\u4e24\u4e2aedge node\u4e4b\u95f4\uff0c\u5982\u679c\u6709\u4e00\u65b9\u7684NAT\u5c5e\u4e8e\u5bf9\u79f0\u578b(symmetrical)\uff0csuper node\u5219\u8fd8\u9700\u7ee7\u7eed\u4e3a\u53cc\u65b9\u63d0\u4f9b\u6570\u636e\u5305\u7684\u8f6c\u53d1;edge node\u8d1f\u8d23\u6570\u636e\u6d41\u7684\u52a0\u89e3\u5bc6\uff0c\u539f\u7406\u5f88\u7b80\u5355\u3002<\/p>\n<p>  \u81f3\u6b64\uff0c\u6211\u4eec\u5df2\u7ecf\u4e86\u89e3\uff0c\u90e8\u7f72n2n\u81f3\u5c11\u9700\u8981\u4e24\u53f0\u4ee5\u4e0a\u7684\u673a\u5668\u3002(\u6211\u8fd9\u91cc\u662f\u56fd\u5185\u4e00\u53f0\uff0c\u56fd\u5916\u4e00\u53f0)<\/p>\n<p>  \u6211\u4eec\u6b64\u6587\u91c7\u7528\u4e24\u53f0centos\u3002<\/p>\n<p>  centos7\uff08super node\uff09 \u2013 149.0.0.1 \uff08\u516c\u7f51IP\uff09<br \/>  centos7&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;-10.0.0.1(n2n\u7684ip)<\/p>\n<p>  \u4f7f\u7528n2n\u4ea7\u751f\u7684\u865a\u62df\u7f51\u6bb5\uff0c\u5c06\u4e3a 10.0.0.1 ~ 10.0.0.255<\/p>\n<p>  \u65e0\u8bba\u662fedgenode\u8fd8\u662fsupernode \u90fd\u9700\u8981\u5b89\u88c5n2n\uff0c\u6240\u4ee5\u4e0b\u9762\u5b89\u88c5\u65b9\u6cd5\u901a\u7528\uff0c\u63d0\u4f9b\u4e24\u79cdn2n\u8d44\u6e90\uff0c\u5747\u53ef\u3002<\/p>\n<p>  git clone https:\/\/github.com\/meyerd\/n2n.git<\/p>\n<p>  yum install -y openssl-devel<br \/>  yum install -y cmake<br \/>  yum install -y net-tools<br \/>  yum install -y git<br \/>  yum install -y gcc gcc-c++<\/p>\n<p>  cd n2n\/n2n_v2<\/p>\n<p>  mkdir build<br \/>  cd build<br \/>  cmake ..<br \/>  make &amp;&amp; make install<\/p>\n<p>  supernode\uff08\u670d\u52a1\u7aef\u8fd0\u884c\uff09<br \/>  supernode -l 5000<\/p>\n<p>  \u670d\u52a1\u7aef\u4e5f\u53ef\u4ee5\u540c\u65f6\u5f53\u505a\u5ba2\u6237\u7aef\u4f7f\u7528\uff0c\u5c06\u670d\u52a1\u7aef\u52a0\u5165\u5230\u865a\u62df\u7f51\u7edc\u4e2d\u3002<\/p>\n<p>  edge -a 10.0.0.10 -c edge0 -k wss -l 149.0.0.1:5000<\/p>\n<p>  \u5ba2\u6237\u7aef<br \/>  edge -a 10.0.0.11 -c edge0 -k wss -l 149.0.0.1:5000<br \/>  10.0.0.11 \u8fd9\u4e2aIP\u662f\u865a\u62df\u7f51\u6bb5\uff0c\u5176\u4ed6\u52a0\u5165\u865a\u62df\u7f51\u7edc\u4e2d\u7684IP\u5730\u5740\u9700\u8981\u5728\u540c\u4e00\u7f51\u6bb5\uff0c\u7edf\u4e00key\uff0c\u5373wss\uff08\u53ef\u8bbe\u7f6e\u4e3a\u5176\u4ed6\uff09\u3002<\/p>\n<p>  \u56fd\u5916\u673a\u5668\u5b89\u88c5sprov-ui<br \/>  wget -O \/usr\/bin\/sprov-ui -N &#8211;no-check-certificate https:\/\/github.com\/mikewubox\/sprov-ui\/raw\/master\/sprov-ui.sh &amp;&amp; chmod +x \/usr\/bin\/sprov-ui &amp;&amp; sprov-ui<\/p>\n<p>  \u88c5\u5b8c\u4e86\u4ee5\u540e\uff0c\u65b0\u52a0\u4ee3\u7406\u7684\u65f6\u5019\u628aIP\u6539\u6210\u5185\u7f51\u6bb5\u7684<br \/>  https:\/\/gra.nx6x.com\/images\/2020\/02\/13\/28.png<\/p>\n<p>  \u7136\u540e\u56fd\u5185\u673a\u5668\u5b89\u88c5Haproxy <\/p>\n<p>  yum -y install Haproxy <br \/>  vi \/etc\/haproxy\/haproxy.cfg<\/p>\n<p>  \u5728centos7\u4e0a\u5b89\u88c5\u597d\u540e\u4f7f\u7528\u7684\u65f6\u5019\u8981\u628a\u4e0b\u9762\u4e24\u4e2a\u53c2\u6570\u6ce8\u91ca\u3002\u7136\u540e\u5c31\u884c\u914d\u7f6e\u3002\u4e0d\u7136\u4f1a\u62a5\u9519http\u53c2\u6570\u95ee\u9898<\/p>\n<p>  defaults<br \/>  &nbsp; &nbsp; mode&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;http<br \/>  &nbsp; &nbsp; log&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;global<br \/>  #&nbsp; &nbsp; option&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;httplog<br \/>  &nbsp; &nbsp; option&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;dontlognull<br \/>  &nbsp; &nbsp; option http-server-close<br \/>  #&nbsp; &nbsp; option forwardfor&nbsp; &nbsp;&nbsp; &nbsp; except 127.0.0.0\/8<br \/>  &nbsp; &nbsp; option&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;redispatch<br \/>  &nbsp; &nbsp; retries&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;3<br \/>  &nbsp; &nbsp; timeout http-request&nbsp; &nbsp; 10s<br \/>  &nbsp; &nbsp; timeout queue&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;1m<br \/>  &nbsp; &nbsp; timeout connect&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;10s<br \/>  &nbsp; &nbsp; timeout client&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 1m<br \/>  &nbsp; &nbsp; timeout server&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 1m<br \/>  &nbsp; &nbsp; timeout http-keep-alive 10s<br \/>  &nbsp; &nbsp; timeout check&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;10s<br \/>  &nbsp; &nbsp; maxconn&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;3000<br \/>  \u540e\u9762\u65b0\u52a0\u7aef\u53e3\u8f6c\u53d1<br \/>  frontend tcp-2013-front<br \/>  &nbsp; &nbsp; bind 172.24.19.176:1204&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; \u56fd\u5185\u673a\u5668IP\u7aef\u53e3<br \/>  &nbsp; &nbsp; mode tcp<br \/>  &nbsp; &nbsp; default_backend&nbsp; &nbsp;tcp-2013-back<\/p>\n<p>  backend tcp-2013-back<br \/>  &nbsp; &nbsp;mode tcp<br \/>  &nbsp; &nbsp;balance leastconn<br \/>  &nbsp; &nbsp;server tcp-2013 10.0.0.10:1204&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;\u56fd\u5916\u673a\u5668n2nIP\u7aef\u53e3<\/p>\n<p>  haproxy -c -V -f \/etc\/haproxy\/haproxy.cfg&nbsp; &nbsp;\u9a8c\u8bc1<\/p>\n<p>  \u9a8c\u8bc1\u6ca1\u95ee\u9898\uff0c\u542f\u52a8\u62a5\u9519 \uff0c\u5173\u95edsLinux<\/p>\n<p>  setenforce 0<br \/>  vim \/etc\/sysconfig\/selinux<\/p>\n<p>  SELINUX=enforcing \u6539\u4e3a SELINUX=disabled<\/p>\n<p>  \u5927\u6982\u5c31\u8fd9\u4e9b\u4e86\u3002\u8fd9\u73a9\u610f\u672c\u6765\u5c31\u662f\u968f\u7f18\u548c\u7384\u5b66\uff0c\u81ea\u5df1\u6298\u817e\u5427\uff0c\u81f3\u5c11\u4ece\u53bb\u5e74\u56fd\u5e86\u540e\u6539\u6210\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u7528\u8fc7\u7684\u4ee3\u7406\u90fd\u6ca1\u5f97\u95ee\u9898\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4e00\u4f4d\u4e0d\u77e5\u540d\u7f51\u53cb<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u633a\u597d\u7684 \u8d5e\u4e00\u4e2a\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>dtkevin<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4e00\u4f4d\u4e0d\u77e5\u540d\u7f51\u53cb \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-17 14:15<br \/>  \u633a\u597d\u7684 \u8d5e\u4e00\u4e2a<\/p>\n<p> yc002t&nbsp; &nbsp;\u538b\u7bb1\u5e95\u7684\u4e1c\u897f\u4e86\uff0c\u5728\u6ca1\u5f97\u4e86\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u963f\u571f\u4ed4<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u633a\u597d\u7684 \u8d5e\u4e00\u4e2a<br \/>  \u7136\u800c\u592a\u9ebb\u70e6\u4e86\uff0c\u6211\u4e0d\u7528\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4f3c\u6bdb\u975e\u6bdb<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4e00\u8138\u61f5\u903c\u7684\u770b\u5b8c\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Effervescence<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u592a\u9ebb\u70e6\u4e86\uff0c\u4e0d\u8fc7\u7b26\u5408\u8fd9\u6bb5\u65f6\u95f4\uff0c\u95f2\u7684\u53d1\u614c\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>dtkevin<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4f3c\u6bdb\u975e\u6bdb \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-17 14:17<br \/>  \u4e00\u8138\u61f5\u903c\u7684\u770b\u5b8c<\/p>\n<p> yc011t&nbsp; &nbsp; \u5c31\u662f\u6316\u4e2a\u96a7\u9053\uff0c\u6d41\u91cf\u8d70\u96a7\u9053\u534f\u8bae\uff0c\u4e0d\u662f\u8d70\u54ea\u4e9b\u4ee3\u7406\u534f\u8bae\uff0c\u88ab\u9ad8\u5f3a\u7684\u5f88\u5927\u4e00\u90e8\u5206\u539f\u56e0\u662f\u534f\u8bae\u95ee\u9898\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>yem<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6536\u85cf\u6211\u6015\u4f60\u4e00\u4f1a\u53c8\u7f16\u8f91\u6389\uff0c\u6211\u5148\u622a\u4e2a\u5c4fyc018t\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4e09\u4e0d<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6709\u70b9\u7b80\u5355\uff0c\u8fd8\u662f\u4e0d\u5f04\u4e86\uff0c\u5176\u5b9e\u662f\u770b\u4e0d\u61c2\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>dtkevin<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tyem \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-17 14:19<br \/>  \u6536\u85cf\u6211\u6015\u4f60\u4e00\u4f1a\u53c8\u7f16\u8f91\u6389\uff0c\u6211\u5148\u622a\u4e2a\u5c4f<\/p>\n<p>  \u54c8\u54c8\u8fd9\u4e2a\u8fd8\u771f\u8bf4\u4e0d\u51c6\u3002\u3002\u3002\u3002\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>dtkevin \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u5f88&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/26020"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=26020"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/26020\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26020"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}