提交 fb27bfa3 作者: 布红亮

添加nacos配置

上级 85d95f0d
...@@ -95,10 +95,21 @@ ...@@ -95,10 +95,21 @@
</dependency> </dependency>
<!-- 注册中心--> <!-- 注册中心-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>-->
<!-- <version>2.1.5.RELEASE</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>2.1.4.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>2.1.5.RELEASE</version> <version>2.1.4.RELEASE</version> <!-- 请注意,这里需要使用与Spring Boot 2.1兼容的版本 -->
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -3,13 +3,12 @@ package com.zzsn.thinktank; ...@@ -3,13 +3,12 @@ package com.zzsn.thinktank;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication @SpringBootApplication
//@EnableAsync //@EnableAsync
@MapperScan(value = {"com.zzsn.thinktank.mapper*"}) @MapperScan(value = {"com.zzsn.thinktank.mapper*"})
@EnableEurekaClient @EnableDiscoveryClient
public class ThinkTankApplication { public class ThinkTankApplication {
public static void main(String[] args) { public static void main(String[] args) {
......
server: server:
port: 9099 port: 9099
eureka: spring:
instance: cloud:
#注册到注册中心通过Feign调用时,hostname必须是服务器ip nacos:
hostname: 1.95.42.138 config:
instance-id: 1.95.42.138:9099 namespace: smartDev
prefer-ip-address: false discovery:
client: namespace: smartDev
register-with-eureka: true
fetch-registry: false
service-url:
defaultZone: http://sasac:Sasac09ckJHyujT!W@192.168.200.226:8017/eureka/
server: server:
port: 9098 port: 9098
eureka: spring:
instance: cloud:
#注册到注册中心通过Feign调用时,hostname必须是服务器ip nacos:
hostname: 1.95.42.138 config:
instance-id: 1.95.42.138:9098 namespace: smartProd
prefer-ip-address: false discovery:
client: namespace: smartProd
register-with-eureka: true \ No newline at end of file
fetch-registry: false
service-url:
defaultZone: http://sasac:BE4cYRvN2WG!YV5z@106.38.99.147:20717/eureka/
\ No newline at end of file
server: server:
port: 9099 port: 9099
eureka: spring:
instance: cloud:
#注册到注册中心通过Feign调用时,hostname必须是服务器ip nacos:
hostname: 1.95.42.138 config:
instance-id: 1.95.42.138:9099 namespace: smartTest
prefer-ip-address: false discovery:
client: namespace: smartTest
register-with-eureka: true \ No newline at end of file
fetch-registry: false
service-url:
#线上测试环境
defaultZone: http://sasac:Sasac09ckJHyujT!W@106.38.99.147:20591/eureka/
\ No newline at end of file
spring:
cloud:
nacos:
config:
server-addr: 1.95.57.223:8848
username: ZZSN(ZIgriRlkxZ2g3SxM9x6sVYcMQe2QVxXx0/l4BAivWsTeVPkAYERSKxlHxzUwHF5M)
password: ZZSN(zB38iUSsp2RptT9HMrjJ0qGdSJ5iwq3jToor7ozqfMOYTiC6RwOvAxdayF7x9qm/)
file-extension: yml
discovery:
server-addr: 1.95.57.223:8848
username: ZZSN(ZIgriRlkxZ2g3SxM9x6sVYcMQe2QVxXx0/l4BAivWsTeVPkAYERSKxlHxzUwHF5M)
password: ZZSN(zB38iUSsp2RptT9HMrjJ0qGdSJ5iwq3jToor7ozqfMOYTiC6RwOvAxdayF7x9qm/)
jasypt:
encryptor:
property:
prefix: ZZSN(
suffix: )
algorithm: PBEWITHHMACSHA512ANDAES_256
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论