nginx集群nacos1.2.1配置mysql8

1、安装mysql8省略

2、安装nginx过程省略

3、下载nacos https://github.com/alibaba/nacos/releases

4、nacos解压目录

5、启动nacos服务(单机)

Linux/Unix/Mac
启动命令(standalone代表着单机模式运行,非集群模式):
sh startup.sh -m standalone
如果您使用的是ubuntu系统,或者运行脚本报错提示[[符号找不到,可尝试如下运行: bash startup.sh
-m standalone Windows 启动命令: cmd startup.cmd 或者双击startup.cmd运行文件

 

 6、浏览器输入http://ip:8848/nacos/index.html

 7、nacos集群

  a、在mysql 中运行 nacos-mysql.sql脚本

      b、修改application.properties文件

cd conf
vi applicaiton.properties

 

 

   c、修改cluster.conf文件,设置集群ip和端口

 

   

  d、修改startup.sh文件,2g空间改小 

 

  e、在nacos目录下创建 plugins/mysql文件夹

    将mysql8.jar拷贝至该目录

  

8、ngix配置

server {
        listen       8847;
        server_name  192.168.0.128;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location /nacos {
            proxy_pass http://nacos;
        }


}

upstream nacos {
   server 192.168.0.128:8848 weight=1;
   server 192.168.0.129:8848 weight=1;
   server 192.168.0.130:8848 weight=1;
}  

9、浏览器访问http://ip:8847/nacos/index.html

10、常见问题

  a、.....is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'Connection closed by foreign host

     修改my.ini ,重启mysql服务

# 允许最大连接数

max_connections=200

# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统

max_connect_errors=1000    

  b、...

 

posted on 2020-05-26 10:22  那只猴子  阅读(765)  评论(0编辑  收藏  举报

导航