当前位置:网站首页>Set up nacos2 X cluster steps and problems encountered
Set up nacos2 X cluster steps and problems encountered
2022-07-03 00:35:00 【_ one hundred and forty-six thousand one hundred and sixteen】
build nacos2.X Cluster steps and problems encountered
First, stand-alone version +mysql Persistence is no problem , Here you can refer to the official website
Because it is built on a server , So you need to copy 3 Share nacos
1、 Modify after copying conf/application.properties Port information , The default is server.port=8848
Pay attention to point one : because nacos2.x Two new grpc The port of , So when you modify it 3 Ports cannot be continuous , Do not then cause port conflicts
So the default here is 8848 Words , Will take up 8848、9848、9849 Three ports . So here are three suggestions nacos It is revised as follows
8648、8748、8848
2、 Configure cluster node information
Configuration file in conf In the catalog cluster.conf.example file , Need to rename to cluster.conf. Then add the following information
own ip:8648
own ip:8748
own ip:8848
Three nacos All modified , stay bin Under boot , Direct execution startup.sh. It's supposed to be over here , Visit the console to see the information of each node , But here comes the second question
Pay attention to point two : Because I configured it on Alibaba cloud nacos, Alibaba cloud has public and Intranet addresses . After I configure it as a public network , Every nacos Of cluster.conf In file , An intranet address will appear by default , Lead to nacos The log keeps reporting errors , Later, when I saw someone else's configuration, I realized that it was originally to be configured as an intranet address , If it is a different server, then there is no such problem
Successfully started after modification , The node information displayed in the console is also correct , All are 3 individual
3、 Next configure nginx forward
Pay attention to three : In the first point, I mentioned the two new ports , So in configuration nginx Pay special attention when , Otherwise, the console will be able to access , But the actual registration is less than nacos On
The detailed configuration is as follows
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# Change one
upstream nacos{
server 101.42.239.36:8648;
server 101.42.239.36:8748;
server 101.42.239.36:8848;
}
# Change two
server {
listen 8080;
server_name localhost;
location / {
proxy_pass http://nacos;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
# Change three
stream {
upstream nacos2{
server 101.42.239.36:9648;
server 101.42.239.36:9748;
server 101.42.239.36:9848;
}
upstream nacos3{
server 101.42.239.36:9649;
server 101.42.239.36:9749;
server 101.42.239.36:9849;
}
# because nacos It is offset according to the port grpc Port of . So you need to be in 8080 Offset based on 1000、1001
server {
listen 9080 so_keepalive=on;
tcp_nodelay on;
proxy_pass nacos2;
}
server {
listen 9081 so_keepalive=on;
tcp_nodelay on;
proxy_pass nacos3;
}
}
Note 4 : Because of my nginx The default installation is when compiling and installing , Therefore, an error will be reported when using the above configuration file , The error message is below . So you need to recompile nginx, add to stream modular
# Error message
unknown directive “stream” in /usr/local/nginx
linux Compilation and installation nginx course
# recompile nginx, add stream
./configure --with-stream
make
make install
Finally start nginx, Client restart service , see nacos Console , Service registration successful , And it's done .
边栏推荐
- Gan model architecture in mm
- Monitor container runtime tool Falco
- LeedCode1480. Dynamic sum of one-dimensional array
- Where can I check the foreign literature of economics?
- Introduction of UART, RS232, RS485, I2C and SPI
- 可下载《2022年中国数字化办公市场研究报告》详解1768亿元市场
- NC24840 [USACO 2009 Mar S]Look Up
- Why is the website slow to open?
- 哪些软件可以整篇翻译英文论文?
- Attributeerror: 'tuple' object has no attribute 'layer' problem solving
猜你喜欢

TypeError: Cannot read properties of undefined (reading ***)

Which software can translate an English paper in its entirety?
![[shutter] Introduction to the official example of shutter Gallery (project introduction | engineering construction)](/img/f7/a8eb8e40b9ea25021751d7150936ac.jpg)
[shutter] Introduction to the official example of shutter Gallery (project introduction | engineering construction)

mm中的GAN模型架构

多进程编程(一):基本概念

Automated defect analysis in electronic microscopic images

kubernetes资源对象介绍及常用命令(五)-(NFS&PV&PVC)

Where can I find the English literature of the thesis (except HowNet)?

Automated defect analysis in electron microscopic images-论文阅读笔记

哪些软件可以整篇翻译英文论文?
随机推荐
collections. What is the purpose of chainmap- What is the purpose of collections. ChainMap?
AcWing_ 188. Warrior cattle_ bfs
Go自定义排序
Automated defect analysis in electronic microscopic images
LeedCode1480. Dynamic sum of one-dimensional array
University of Toronto:Anthony Coache | 深度强化学习的条件可诱导动态风险度量
One of the reasons why setinterval timer does not take effect in ie: the callback is the arrow function
免费自媒体必备工具分享
多进程编程(五):信号量
Briefly talk about other uses of operation and maintenance monitoring
antv x6节点拖拽到画布上后的回调事件(踩大坑记录)
Markdown tutorial
[Chongqing Guangdong education] audio visual language reference materials of Xinyang Normal University
Automated defect analysis in electron microscopic images-论文阅读笔记
MySQL 23 classic interview hanging interviewer
logback配置文件
Redis21 classic interview questions, extreme pull interviewer
MySQL 23道经典面试吊打面试官
Rust字符串切片、结构体和枚举类
Multiprocess programming (I): basic concepts