0
点赞
收藏
分享

微信扫一扫

Day10-SpringCloud alibaba 搭建Nacos集群

2c09c340e57a4963ba60fdc0d809db8b

img

三台服务器上的搭建

  • 修改cluster.conf application.properties
  • 启动命令: sh startup.sh 启动三台
  • 效果:image-20220105014258861

配置Nginx转发 (即消费端服务端—->随机注册到某一台nacos)


    upstream mycluster{
        server ip:8848 ;
        server ip:8848;
        server ip:8848;
       } 

server
    {
        listen 81;
        server_name localhost;
        location / { 
            root   html;
            index  index.html index.htm;
           proxy_pass http://mycluster; # 对应上面地址
        } 

    }

访问:Nginx端口 记得加上/nacos

image-20220105014706830

成功

测试 消费端和服务端分别提供Nginx注册到不同的注册中心上:

image-20220105205511085

image-20220105015855829

image-20220105020019968

image-20220105020135576

节点下线

image-20220105204651045

image-20220105204625433

image-20220105204748994

image-20220105204814980

举报

相关推荐

0 条评论