配置
-
admin 的 pom.xml 已经默认添加了 nacos-client 依赖
<dependency> <groupId>com.alibaba.nacos</groupId> <artifactId>nacos-client</artifactId> <version>${nacos-client.version}</version> </dependency>
-
admin 的 application.yml 注释掉其他同步策略配置,启用nacos,设置命名空间为soul,去掉acm相关的东西。
soul: database: dialect: mysql init_script: "META-INF/schema.sql" init_enable: true sync: # websocket: # enabled: true # zookeeper: # url: localhost:2181 # sessionTimeout: 5000 # connectionTimeout: 2000 # http: # enabled: true nacos: url: localhost:8848 namespace: soul # acm: # enabled: false # endpoint: acm.aliyun.com # namespace: # accessKey: # secretKey:
-
bootstrap 的 pom.xml添加依赖
<!-- soul data sync start use nacos--> <dependency> <groupId>org.dromara</groupId> <artifactId>soul-spring-boot-starter-sync-data-nacos</artifactId> <version>${project.version}</version> </dependency>
-
bootstrap 的 application-local.yml 注释掉其他同步策略配置,启用nacos,设置命名空间为soul,去掉acm相关的东西。
soul: file: enabled: true corss: enabled: true dubbo : parameter: multi sync: # websocket : # urls: ws://localhost:9095/websocket # zookeeper: # url: localhost:2181 # sessionTimeout: 5000 # connectionTimeout: 2000 # http: # url : http://localhost:9095 nacos: url: localhost:8848 namespace: soul # acm: # enabled: false # endpoint: acm.aliyun.com # namespace: # accessKey: # secretKey:
Nacos配置
进入Nacos管理界面,用户名和密码:nacos nacos
在左边菜单栏中进行命名空间,选择新建命名空间,全部填写soul,建立soul的命名空间
这个时候再重启Admin和HTTP示例,在配置管理–配置列表中,在上方有一个命名空间的名称,public和soul。点击切换到soul,不出意外的话,也是啥也没有
运行服务
- 启动Nacos服务:win10启动和安装nacos服务
- 启动soul-admin, 访问nacos界面:127.0.0.1:8848 ,如果是正常的,就能看到下面五个数据配置
- 启动 boot-strap时报错:
错误原因暂时不知,明天再继续探查,今天乏力了-。-