当前位置:网站首页>Solve the problem that the local nacos is not configured but the localhost8848 connection exception always occurs
Solve the problem that the local nacos is not configured but the localhost8848 connection exception always occurs
2022-07-30 05:57:00 【Free stuff】
Introduction
The thing is like this, the registration center nacos is configured for a project, and the nacos service of the local machine is configured at the beginning. After changing the nacos address to a virtual machine later, although the project is successfully started, it reports a nacos exception, as follows:
There are two configuration files:
Configured separately:
You can see that there is no configuration about localhost:8848 at all, but the exception of localhost:8848 is still reported. Open the nacos visualization interface of the virtual machine and find that the service has been registered in the nacos of the virtual machine
The version in question is:
com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery 2.2.6.RELEASE com.alibaba.cloud spring-cloud-starter-alibaba-nacos-config 2.2.6.RELEASE
Resolve
This is caused when nacos reads its own automatic configuration with a higher priority than the configuration in the application file, and the automatic configuration of nacos itself is the nacos service on port 127.0.0.1:8848, so the above exception occurs, so it is necessary toRaise the priority of the configuration file
Create a bootstrap.properties or bootstrap.yml file to configure the nacos address.This configuration is system-level and has the highest priority. If you first read the nacos address from this file, no error will be reported
spring.cloud.nacos.server-addr=192.168.190.128:8848
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- php数组实现根据某个键值将相同键值合并生成新二维数组的方法
- 成绩排序(华中科技大学考研机试题)(DAY 87)
- 图形镜像对称(示意图)
- [Image processing] Image skeleton extraction based on central axis transformation with matlab code
- asyncawait和promise的区别
- 从字节码角度带你彻底理解异常中catch,return和finally,再也不用死记硬背了
- 使用DataEase开源工具制作一个高质量的数据大屏
- 75. 颜色分类
- RadonDB MySQL on K8s 2.1.2 发布!
- JVM之GC 调优基础知识(一)
猜你喜欢
随机推荐
JVM之GC 调优基础知识(一)
一文带你吃透js处理树状结构数据的增删改查
mysql基础(4)
2022年SQL大厂高频实战面试题(详细解析)
MySQL基础(DDL、DML、DQL)
【Redis高手修炼之路】Jedis——Jedis的基本使用
SOA(面向服务架构)是什么?
SQL连接表(内连接、左连接、右连接、交叉连接、全外连接)
G巴士计数(Google Kickstart2014 Round D Problem B)(DAY 89)
4、nerf(pytorch)
MySQL(4)
1475. 商品折扣后的最终价格
cookie和session区别
从驱动表和被驱动表来快速理解MySQL中的内连接和外连接
It's time to have to learn English, give yourself multiple paths
分布式事务之 Atomikos 原理和使用(一)
无代码开发平台重新申请入门教程
力扣20-有效的括号——栈实现
Mysql8.+学习笔记
108. 将有序数组转换为二叉搜索树