{"id":269,"date":"2021-12-22T15:31:39","date_gmt":"2021-12-22T07:31:39","guid":{"rendered":"https:\/\/fugary.com\/?p=269"},"modified":"2021-12-24T21:12:19","modified_gmt":"2021-12-24T13:12:19","slug":"nacos%e6%9c%80%e6%96%b02-x%e9%9b%86%e7%be%a4%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/fugary.com\/?p=269","title":{"rendered":"Nacos\u6700\u65b02.x\u96c6\u7fa4\u5b89\u88c5\u4ee5\u53caNginx\u8d1f\u8f7d\u5747\u8861\u914d\u7f6e"},"content":{"rendered":"<p>Nacos2.0\u7248\u672c\u76f8\u6bd41.X\u65b0\u589e\u4e86gRPC\u7684\u901a\u4fe1\u65b9\u5f0f\uff0c\u56e0\u6b64\u9700\u8981\u589e\u52a02\u4e2a\u7aef\u53e3\u3002\u65b0\u589e\u7aef\u53e3\u662f\u5728\u914d\u7f6e\u7684\u4e3b\u7aef\u53e3(server.port)\u57fa\u7840\u4e0a\uff0c\u8fdb\u884c\u4e00\u5b9a\u504f\u79fb\u91cf\u81ea\u52a8\u751f\u6210\u3002<\/p>\n<h3>Nacos\u5b89\u88c5\u4f7f\u7528<\/h3>\n<p>Nacos\u662f\u963f\u91cc\u5f00\u6e90\u7684\u4e00\u6b3e\u5fae\u670d\u52a1\u6ce8\u518c\u4e2d\u5fc3\uff0c\u4e00\u4e2a\u66f4\u6613\u4e8e\u6784\u5efa\u4e91\u539f\u751f\u5e94\u7528\u7684\u52a8\u6001\u670d\u52a1\u53d1\u73b0\u3001\u914d\u7f6e\u7ba1\u7406\u548c\u670d\u52a1\u7ba1\u7406\u5e73\u53f0\u3002<\/p>\n<p>\u6587\u6863\u5730\u5740\uff1a<a href=\"https:\/\/nacos.io\/zh-cn\/docs\/what-is-nacos.html\">https:\/\/nacos.io\/zh-cn\/docs\/what-is-nacos.html<\/a><\/p>\n<p>\u5b98\u65b9\u4f9d\u8d56\uff1a<\/p>\n<ol>\n<li>64 bit OS\uff0c\u652f\u6301 Linux\/Unix\/Mac\/Windows\uff0c\u63a8\u8350\u9009\u7528 Linux\/Unix\/Mac\u3002<\/li>\n<li>64 bit JDK 1.8+\uff1b<a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk8-downloads-2133151.html\">\u4e0b\u8f7d<\/a> &amp; <a href=\"https:\/\/docs.oracle.com\/cd\/E19182-01\/820-7851\/inst_cli_jdk_javahome_t\/\">\u914d\u7f6e<\/a>\u3002<\/li>\n<\/ol>\n<h4>\u4e0b\u8f7d\u5b89\u88c5<\/h4>\n<p>\u53ef\u4ee5\u4ecegithub\u4e0b\u8f7d\u6700\u65b0\u7684release\u7248\u672c\uff1a<\/p>\n<p>\u4e0b\u8f7d\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/alibaba\/nacos\/releases\">https:\/\/github.com\/alibaba\/nacos\/releases<\/a><\/p>\n<p>github\u4e0a\u4e0b\u8f7d\u6bd4\u8f83\u6162\uff1a<a href=\"https:\/\/ghproxy.com\/https:\/\/github.com\/alibaba\/nacos\/releases\/download\/2.0.3\/nacos-server-2.0.3.tar.gz\">https:\/\/ghproxy.com\/https:\/\/github.com\/alibaba\/nacos\/releases\/download\/2.0.3\/nacos-server-2.0.3.tar.gz<\/a><\/p>\n<p>\u4e0b\u8f7d\u5b8c\u6210\u4e4b\u540e\u5f97\u5230nacos-server-2.0.3.zip\uff0c\u89e3\u538b\u4e4b\u540e\u5c31\u53ef\u4ee5\u8fd0\u884c\u4e86\u3002<\/p>\n<h4>\u5355\u673a\u542f\u52a8<\/h4>\n<p>Windows\u542f\u52a8\u547d\u4ee4(standalone\u4ee3\u8868\u7740\u5355\u673a\u6a21\u5f0f\u8fd0\u884c\uff0c\u975e\u96c6\u7fa4\u6a21\u5f0f\uff0c\u76f4\u63a5\u53cc\u51fb\u662f\u96c6\u7fa4\u6a21\u5f0f):<\/p>\n<pre><code class=\"language-shell\">startup.cmd -m standalone<\/code><\/pre>\n<p>\u542f\u52a8\u540e\u53ef\u4ee5\u67e5\u770b\u56fe\u5f62\u754c\u9762\u7684\u63a7\u5236\u53f0\uff1a<\/p>\n<p><a href=\"http:\/\/localhost:8848\/nacos\/#\/login\">http:\/\/localhost:8848\/nacos\/#\/login<\/a><\/p>\n<p>\u9ed8\u8ba4\u7528\u6237\u540d\u548c\u5bc6\u7801\uff1anacos\/nacos\uff0c\u5bc6\u7801\u5728\u767b\u5f55\u4e4b\u540e\u53ef\u4ee5\u4fee\u6539\uff0c\u5df2\u7ecf\u96c6\u6210\u4e86\u7528\u6237\u76f8\u5173\u7ba1\u7406\u3002<\/p>\n<p>\u6ce8\u610f\u8fd9\u91cc\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u4f7f\u7528\u5185\u5d4c\u7684derby\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u5728data\/derby-data\u770b\u5230\u6570\u636e\u6587\u4ef6\u3002<\/p>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211222141359.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211222141359.png\" alt=\"image-20211222141358932\" \/><\/div><\/p>\n<h4>\u914d\u7f6eMySQL\u6570\u636e\u5e93<\/h4>\n<p>nacos\u652f\u6301\u4f7f\u7528MySQL\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528MySQL\u6570\u636e\u5e93\u4ee3\u66ff\u5185\u5d4c\u7684derby\u6570\u636e\u5e93\u3002<\/p>\n<ol>\n<li>\u5b89\u88c5MySQL\u6570\u636e\u5e93<\/li>\n<li>\u65b0\u5efa\u4e00\u4e2aMySQL\u6570\u636e\u5e93\u8d26\u6237\uff1anacos\/12345678<\/li>\n<li>\u521d\u59cb\u5316mysql\u6570\u636e\u5e93nacos\uff0c\u6570\u636e\u5e93\u521d\u59cb\u5316\u6587\u4ef6\uff1anacos-mysql.sql<\/li>\n<li>\u914d\u7f6eapplication.properties<\/li>\n<\/ol>\n<p>\u914d\u7f6e\u6587\u4ef6application.properties\u4e2d\uff0c\u628aMySQL\u76f8\u5173\u914d\u7f6e\u6ce8\u91ca\u653e\u5f00\uff0c\u5e76\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-properties\">### use MySQL as datasource:\nspring.datasource.platform=mysql\n### Count of DB:\ndb.num=1\n### Connect URL of DB:\ndb.url.0=jdbc:mysql:\/\/127.0.0.1:3306\/nacos?characterEncoding=utf8&amp;connectTimeout=1000&amp;socketTimeout=3000&amp;autoReconnect=true&amp;useUnicode=true&amp;useSSL=false&amp;serverTimezone=UTC\ndb.user=nacos\ndb.password=12345678<\/code><\/pre>\n<p>\u518d\u6b21\u542f\u52a8\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u968f\u4fbf\u65b0\u5efa\u4e00\u4e2a\u914d\u7f6e\u9879\u505a\u6d4b\u8bd5\uff0c\u53ef\u4ee5\u5728config_info\u8868\u4e2d\u770b\u5230\u6570\u636e\u4e86\uff1a<\/p>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20201127112044.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20201127112044.png\" alt=\"image-20201127112044046\" \/><\/div><\/p>\n<h3>\u96c6\u7fa4\u542f\u52a8<\/h3>\n<p>nacos\u53ef\u4ee5\u4ee5\u96c6\u7fa4\u542f\u52a8\uff0c3\u4e2a\u62163\u4e2a\u4ee5\u4e0aNacos\u8282\u70b9\u624d\u80fd\u6784\u6210\u96c6\u7fa4\u3002<\/p>\n<h4>\u96c6\u7fa4\u914d\u7f6e<\/h4>\n<p>\u8fd9\u91cc\u4ee5\u5355\u673a\u4e0d\u540c\u7aef\u53e3\u542f\u52a8\u6d4b\u8bd5\uff0c\u590d\u5236nacos\u76ee\u5f553\u4efd\uff0c\u5206\u522b\u4fee\u6539\u5bf9\u5e94\u7684application.properties\u6587\u4ef6\u4e2d\u7684\u7aef\u53e3\u4e3a8851\u30018861\u30018871<\/p>\n<pre><code class=\"language-properties\">server.port=8851<\/code><\/pre>\n<p>\u590d\u5236cluster.conf.example\u4e3acluster.conf\uff0c\u5e76\u914d\u7f6eIP\u548c\u7aef\u53e3\u3002<\/p>\n<pre><code class=\"language-ini\">10.181.10.242:8851\n10.181.10.242:8861\n10.181.10.242:8871<\/code><\/pre>\n<h4>\u96c6\u7fa4\u542f\u52a8<\/h4>\n<p>\u914d\u7f6e\u5b8c\u6210\u4e4b\u540e\uff0c\u5206\u522b\u542f\u52a8\uff0c\u4e0d\u7528\u5e26\u53c2\u6570\u4e86\uff0c\u9ed8\u8ba4\u5c31\u4ee5\u96c6\u7fa4\u6a21\u5f0f\u542f\u52a8\uff0c\u53ef\u4ee5\u7f16\u5199\u4e00\u4e2abat\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-bash\">start call nacos8851\/bin\/startup.cmd\nstart call nacos8861\/bin\/startup.cmd\nstart call nacos8871\/bin\/startup.cmd<\/code><\/pre>\n<p>\u542f\u52a8\u5b8c\u6210\u4e4b\u540e\u53ef\u4ee5\u901a\u8fc7\u4efb\u4f55\u4e00\u4e2a\u7aef\u53e3\u7684\u8282\u70b9\u8bbf\u95ee\uff0c\u767b\u5f55\u540e\u53ef\u4ee5\u770b\u5230\u96c6\u7fa4\u8282\u70b9\u72b6\u6001\uff0c\u8868\u793a\u5df2\u7ecf\u914d\u7f6e\u597d\u4e86\uff1a<\/p>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211222141628.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211222141628.png\" alt=\"image-20211222141628500\" \/><\/div><\/p>\n<p>\u5b98\u65b9\u63a8\u8350\u96c6\u7fa4\u90e8\u7f72\u540e\u4f7f\u7528VIP\u6216\u8005\u57df\u540d\u8bbf\u95ee\uff0c\u4e0d\u8fc7\u4e5f\u53ef\u4ee5\u4f7f\u7528\u76f4\u8fde\u6a21\u5f0f\uff1a<\/p>\n<p>\u914d\u7f6e\u5b8c\u6210\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u5728\u76f8\u5173\u9879\u76ee\u4e2d\u4f7f\u7528\u4e86\u3002<\/p>\n<pre><code class=\"language-yml\">spring:\n  cloud:\n    nacos:\n      server-addr: 10.181.10.242:8851,10.181.10.242:8861,10.181.10.242:8871<\/code><\/pre>\n<h4>\u6ce8\u610fcluster\u7aef\u53e3<\/h4>\n<pre><code class=\"language-yml\"># \u7aef\u53e3\u89c4\u5219\nserver.port(\u9ed8\u8ba48848\uff09\nraft port: ${server.port} - 1000\ngrpc port: ${server.port} + 1000\ngrpc port for server: ${server.port} + 1001<\/code><\/pre>\n<p><strong>\u5355\u673a\u96c6\u7fa4\u542f\u52a8\u7684\u65f6\u5019\u4e0d\u80fd\u4f7f\u7528\u8fde\u7eed\u7684\u7aef\u53e3\u4e86\uff0c\u4f1a\u62a5\u9519:<\/strong><\/p>\n<pre><code class=\"language-java\">Caused by: java.net.BindException: Address already in use: bind\n    at java.base\/sun.nio.ch.Net.bind0(Native Method)\n    at java.base\/sun.nio.ch.Net.bind(Net.java:455)\n    at java.base\/sun.nio.ch.Net.bind(Net.java:447)\n    at java.base\/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)<\/code><\/pre>\n<h3>\u5b89\u5168\u6027\u914d\u7f6e<\/h3>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0bnacos\u6ca1\u6709\u914d\u7f6e\u5b89\u5168\u6027\uff0c\u6dfb\u52a0\u7528\u6237\u548c\u89d2\u8272\u4e4b\u540e\u4e5f\u6ca1\u7528\uff0c\u96c6\u7fa4\u4e0b\u9700\u8981\u6bcf\u4e2a\u8282\u70b9\u90fd\u8981\u6dfb\u52a0\u3002<\/p>\n<h4>\u542f\u7528\u5b89\u5168\u6027<\/h4>\n<p>\u9700\u8981\u5728nacos\u76ee\u5f55\u4e0b\u7684application.properties\u4e2d\u5148\u914d\u7f6e\u597d\u542f\u7528\u5b89\u5168\u6027<\/p>\n<pre><code class=\"language-properties\"># nacos.core.auth.enabled=false\nnacos.core.auth.enabled=true<\/code><\/pre>\n<p>\u7136\u540e\u542f\u52a8nacos\u670d\u52a1\u5668\uff0c\u73b0\u5728\u6dfb\u52a0\u7528\u6237\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<h4>\u914d\u7f6e\u6743\u9650<\/h4>\n<p>\u65b0\u5efa\u7528\u6237\uff1a<\/p>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211223152117.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211223152117.png\" alt=\"image-20211223152117640\" \/><\/div><\/p>\n<p>\u7ed1\u5b9a\u89d2\u8272\uff1a<\/p>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211223152025.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211223152025.png\" alt=\"image-20211223152025255\" \/><\/div><\/p>\n<p>\u7ed9\u89d2\u8272\u914d\u7f6e\u6743\u9650\uff0c\u914d\u7f6e\u8bfb\u5199\u6743\u9650\u624d\u53ef\u4ee5\uff0c\u6ce8\u518c\u4e2d\u5fc3\u662f\u8981\u6709\u5199\u5165\u64cd\u4f5c\uff0c\u914d\u7f6e\u4e2d\u5fc3\u4e5f\u9700\u8981\u4fee\u6539\u914d\u7f6e\u9879\uff1a<\/p>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211223152156.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211223152156.png\" alt=\"image-20211223152156801\" \/><\/div><\/p>\n<h4>\u5ba2\u6237\u7aef\u4f7f\u7528<\/h4>\n<p>springboot\u9879\u76ee\u4e2d\u9700\u8981\u914d\u7f6e\u7528\u6237\u540d\u548c\u5bc6\u7801\u624d\u80fd\u8bbf\u95ee\u4e86\uff0c\u5426\u5219\u4f1a\u6709403\u9519\u8bef<\/p>\n<pre><code class=\"language-yml\">spring:\n  cloud:\n    nacos:\n      server-addr: 10.181.10.242:8851,10.181.10.242:8861,10.181.10.242:8871\n      username: dev\n      password: 123456<\/code><\/pre>\n<h3>Nginx\u914d\u7f6e\u8d1f\u8f7d\u5747\u8861<\/h3>\n<p>Nacos2.0\u7248\u672c\u76f8\u6bd41.X\u65b0\u589e\u4e86gRPC\u7684\u901a\u4fe1\u65b9\u5f0f\uff0c\u56e0\u6b64\u9700\u8981\u589e\u52a02\u4e2a\u7aef\u53e3\u3002\u65b0\u589e\u7aef\u53e3\u662f\u5728\u914d\u7f6e\u7684\u4e3b\u7aef\u53e3(server.port)\u57fa\u7840\u4e0a\uff0c\u8fdb\u884c\u4e00\u5b9a\u504f\u79fb\u91cf\u81ea\u52a8\u751f\u6210\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u7aef\u53e3<\/th>\n<th>\u4e0e\u4e3b\u7aef\u53e3\u7684\u504f\u79fb\u91cf<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>9848<\/td>\n<td>1000<\/td>\n<td>\u5ba2\u6237\u7aefgRPC\u8bf7\u6c42\u670d\u52a1\u7aef\u7aef\u53e3\uff0c\u7528\u4e8e\u5ba2\u6237\u7aef\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8fde\u63a5\u548c\u8bf7\u6c42<\/td>\n<\/tr>\n<tr>\n<td>9849<\/td>\n<td>1001<\/td>\n<td>\u670d\u52a1\u7aefgRPC\u8bf7\u6c42\u670d\u52a1\u7aef\u7aef\u53e3\uff0c\u7528\u4e8e\u670d\u52a1\u95f4\u540c\u6b65\u7b49<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u4f7f\u7528VIP\/nginx\u8bf7\u6c42\u65f6\uff0c\u9700\u8981\u914d\u7f6e\u6210TCP\u8f6c\u53d1\uff0c\u4e0d\u80fd\u914d\u7f6ehttp2\u8f6c\u53d1\uff0c\u5426\u5219\u8fde\u63a5\u4f1a\u88abnginx\u65ad\u5f00\u3002<\/strong><\/p>\n<p>\u56fe\u7247\u6765\u6e90\u4e8enacos\u5b98\u7f51\uff1a<\/p>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211223174301.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20211223174301.png\" alt=\"\" \/><\/div><\/p>\n<p>\u5148\u68c0\u67e5nginx\u662f\u5426\u6709stream\u6a21\u5757\uff0c\u8f93\u51fa\u4e2d\u5305\u542b\uff1a<code>--with-stream<\/code><\/p>\n<pre><code class=\"language-sh\">nginx -V\nnginx version: nginx\/1.21.0\nbuilt by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)\nbuilt with OpenSSL 1.0.2k-fips  26 Jan 2017\nTLS SNI support enabled\nconfigure arguments: --prefix=\/etc\/nginx --sbin-path=\/usr\/sbin\/nginx --modules-path=\/usr\/lib64\/nginx\/modules --conf-path=\/etc\/nginx\/nginx.conf --error-log-path=\/var\/log\/nginx\/error.log --http-log-path=\/var\/log\/nginx\/access.log --pid-path=\/var\/run\/nginx.pid --lock-path=\/var\/run\/nginx.lock --http-client-body-temp-path=\/var\/cache\/nginx\/client_temp --http-proxy-temp-path=\/var\/cache\/nginx\/proxy_temp --http-fastcgi-temp-path=\/var\/cache\/nginx\/fastcgi_temp --http-uwsgi-temp-path=\/var\/cache\/nginx\/uwsgi_temp --http-scgi-temp-path=\/var\/cache\/nginx\/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt=&#039;-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC&#039; --with-ld-opt=&#039;-Wl,-z,relro -Wl,-z,now -pie&#039;<\/code><\/pre>\n<h4>\u914d\u7f6ehttp\u6a21\u5757<\/h4>\n<p>\u5728nginx\u7684http\u4e0b\u9762\u914d\u7f6ehttp\u534f\u8bae\u76f8\u5173\u7684\u5730\u5740\u548c\u7aef\u53e3\uff1a<\/p>\n<pre><code class=\"language-nginx\">http {\n    # nacos\u670d\u52a1\u5668http\u76f8\u5173\u5730\u5740\u548c\u7aef\u53e3\n    upstream nacos-server {\n        server 10.181.10.242:8851;\n        server 10.181.10.242:8861;\n        server 10.181.10.242:8871;\n    }\n    server {\n        listen 8848;\n        location \/ {\n            proxy_pass http:\/\/nacos-server\/;\n        }\n    }\n}<\/code><\/pre>\n<p>\u53e6\u5916\u9700\u8981\u914d\u7f6egrpc\uff0c\u9700\u8981nginx\u6709stream\u6a21\u5757\u652f\u6301<\/p>\n<h4>\u914d\u7f6egrpc<\/h4>\n<pre><code class=\"language-nginx\"># nacos\u670d\u52a1\u5668grpc\u76f8\u5173\u5730\u5740\u548c\u7aef\u53e3\uff0c\u9700\u8981nginx\u5df2\u7ecf\u6709stream\u6a21\u5757\nstream {\n    upstream nacos-server-grpc {\n        server 10.181.10.242:9851;\n        server 10.181.10.242:9861;\n        server 10.181.10.242:9871;\n    }\n    server {\n        listen 9848;\n        proxy_pass nacos-server-grpc;\n    }\n}<\/code><\/pre>\n<p>\u914d\u7f6e\u540e\u91cd\u542fnginx<\/p>\n<pre><code class=\"language-sh\">sudo nginx -s reload<\/code><\/pre>\n<h4>\u5e94\u7528\u914d\u7f6e<\/h4>\n<pre><code class=\"language-yml\">spring:\n  cloud:\n    nacos:\n      server-addr: 10.181.10.xxx:8848<\/code><\/pre>\n<p>\u7136\u540e\u5c31\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nacos2.0\u7248\u672c\u76f8\u6bd41.X\u65b0\u589e\u4e86gRPC\u7684\u901a\u4fe1\u65b9\u5f0f\uff0c\u56e0\u6b64\u9700\u8981\u589e\u52a02\u4e2a\u7aef\u53e3\u3002\u65b0\u589e\u7aef\u53e3\u662f\u5728\u914d\u7f6e\u7684\u4e3b\u7aef\u53e3(ser [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,4],"tags":[53,40,55,48,54,56],"_links":{"self":[{"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/posts\/269"}],"collection":[{"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fugary.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=269"}],"version-history":[{"count":5,"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/posts\/269\/revisions"}],"predecessor-version":[{"id":278,"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/posts\/269\/revisions\/278"}],"wp:attachment":[{"href":"https:\/\/fugary.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fugary.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fugary.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}