Selaa lähdekoodia

message, file, content, search 使用 nacos 配置中心获取配置

reghao 3 viikkoa sitten
vanhempi
commit
dbad6236ab

+ 6 - 1
content/content-service/pom.xml

@@ -126,6 +126,11 @@
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+
         <!--<dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-zookeeper-config</artifactId>
@@ -237,7 +242,7 @@
                 <filtering>true</filtering>
                 <includes>
                     <include>application.yml</include>
-                    <include>application-${profile.active}.yml</include>
+                    <!--<include>application-${profile.active}.yml</include>-->
                     <include>sharding-${profile.active}.yml</include>
                     <include>mapper/**</include>
                     <include>*.xml</include>

+ 73 - 0
content/content-service/src/main/resources/application-dev-full.yml

@@ -0,0 +1,73 @@
+dubbo:
+  application:
+    name: content-service
+    qos-enable: true
+    qos-port: 16105
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.content.app.vod.rpc,cn.reghao.tnb.content.app.mall.rpc
+  protocol:
+    name: dubbo
+    port: 6105
+  registry:
+    group: dubbo
+    address: zookeeper://127.0.0.1:2181
+server:
+  port: 6005
+  tomcat:
+    max-http-form-post-size: 4MB
+spring:
+  datasource:
+    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
+    url: jdbc:shardingsphere:classpath:sharding-${spring.profiles.active}.yml
+  cloud:
+    discovery:
+      enabled: true
+    nacos:
+      discovery:
+        server-addr: 127.0.0.1:8848
+        username: nacos
+        password: Test_123456
+    inetutils:
+      ignored-interfaces:
+        - docker0
+        - veth.*
+      preferred-networks:
+        - 192.168
+    loadbalancer:
+      cache:
+        enabled: true
+  data:
+    redis:
+      database: 0
+      host: 127.0.0.1
+      port: 6379
+      password: Test_123456
+  rabbitmq:
+    host: 127.0.0.1
+    port: 5672
+    virtual-host: /
+    username: test
+    password: Test_123456
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**.xml
+  type-aliases-package: cn.reghao.tnb.content.app.model.po
+feign:
+  circuitbreaker:
+    enabled: true
+  httpclient:
+    hc5:
+      enabled: true
+      connection-request-timeout-unit: seconds
+      connection-request-timeout: 1
+management:
+  endpoints:
+    web:
+      base-path: /api/content/actuator
+      exposure:
+        include: "*"
+  metrics:
+    tags:
+      application: ${spring.application.name}

+ 73 - 0
content/content-service/src/main/resources/application-test-full.yml

@@ -0,0 +1,73 @@
+dubbo:
+  application:
+    name: content-service
+    qos-enable: true
+    qos-port: 16105
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.content.app.vod.rpc,cn.reghao.tnb.content.app.mall.rpc
+  protocol:
+    name: dubbo
+    port: 6105
+  registry:
+    group: dubbo
+    address: zookeeper://192.168.0.209:2181
+server:
+  port: 6005
+  tomcat:
+    max-http-form-post-size: 4MB
+spring:
+  datasource:
+    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
+    url: jdbc:shardingsphere:classpath:sharding-${spring.profiles.active}.yml
+  cloud:
+    discovery:
+      enabled: true
+    nacos:
+      discovery:
+        server-addr: 192.168.0.209:8848
+        username: nacos
+        password: Test_123456
+    inetutils:
+      ignored-interfaces:
+        - docker0
+        - veth.*
+      preferred-networks:
+        - 192.168
+    loadbalancer:
+      cache:
+        enabled: true
+  data:
+    redis:
+      database: 0
+      host: 192.168.0.209
+      port: 6379
+      password: Test_123456
+  rabbitmq:
+    host: 192.168.0.209
+    port: 5672
+    virtual-host: /
+    username: test
+    password: Test_123456
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**.xml
+  type-aliases-package: cn.reghao.tnb.content.app.model.po
+feign:
+  circuitbreaker:
+    enabled: true
+  httpclient:
+    hc5:
+      enabled: true
+      connection-request-timeout-unit: seconds
+      connection-request-timeout: 1
+management:
+  endpoints:
+    web:
+      base-path: /api/content/actuator
+      exposure:
+        include: "*"
+  metrics:
+    tags:
+      application: ${spring.application.name}

+ 13 - 52
content/content-service/src/main/resources/application.yml

@@ -1,58 +1,19 @@
-dubbo:
-  application:
-    name: content-service
-    qos-enable: true
-    qos-port: 16105
-    qos-accept-foreign-ip: false
-  scan:
-    base-packages: cn.reghao.tnb.content.app.vod.rpc,cn.reghao.tnb.content.app.mall.rpc
-  protocol:
-    name: dubbo
-    port: 6105
-server:
-  port: 6005
-  tomcat:
-    max-http-form-post-size: 4MB
 spring:
-  threads:
-    virtual:
-      enabled: true
   application:
     name: content-service
   profiles:
     active: @profile.active@
-  datasource:
-    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
-    url: jdbc:shardingsphere:classpath:sharding-${spring.profiles.active}.yml
-  cloud:
-    inetutils:
-      ignored-interfaces:
-        - docker0
-        - veth.*
-      preferred-networks:
-        - 192.168
-    loadbalancer:
-      cache:
-        enabled: true
-mybatis:
-  configuration:
-    map-underscore-to-camel-case: true
-  mapper-locations: classpath*:mapper/**.xml
-  type-aliases-package: cn.reghao.tnb.content.app.model.po
-feign:
-  circuitbreaker:
-    enabled: true
-  httpclient:
-    hc5:
+  threads:
+    virtual:
       enabled: true
-      connection-request-timeout-unit: seconds
-      connection-request-timeout: 1
-management:
-  endpoints:
-    web:
-      base-path: /api/content/actuator
-      exposure:
-        include: "*"
-  metrics:
-    tags:
-      application: ${spring.application.name}
+  cloud:
+    nacos:
+      config:
+        server-addr: 127.0.0.1
+        group: DEFAULT_GROUP
+        file-extension: yaml
+        username: nacos
+        password: Test_123456
+  config:
+    import:
+      - nacos:${spring.application.name}-${spring.profiles.active}

+ 58 - 0
content/content-service/src/main/resources/application0.yml

@@ -0,0 +1,58 @@
+dubbo:
+  application:
+    name: content-service
+    qos-enable: true
+    qos-port: 16105
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.content.app.vod.rpc,cn.reghao.tnb.content.app.mall.rpc
+  protocol:
+    name: dubbo
+    port: 6105
+server:
+  port: 6005
+  tomcat:
+    max-http-form-post-size: 4MB
+spring:
+  threads:
+    virtual:
+      enabled: true
+  application:
+    name: content-service
+  profiles:
+    active: @profile.active@
+  datasource:
+    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
+    url: jdbc:shardingsphere:classpath:sharding-${spring.profiles.active}.yml
+  cloud:
+    inetutils:
+      ignored-interfaces:
+        - docker0
+        - veth.*
+      preferred-networks:
+        - 192.168
+    loadbalancer:
+      cache:
+        enabled: true
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**.xml
+  type-aliases-package: cn.reghao.tnb.content.app.model.po
+feign:
+  circuitbreaker:
+    enabled: true
+  httpclient:
+    hc5:
+      enabled: true
+      connection-request-timeout-unit: seconds
+      connection-request-timeout: 1
+management:
+  endpoints:
+    web:
+      base-path: /api/content/actuator
+      exposure:
+        include: "*"
+  metrics:
+    tags:
+      application: ${spring.application.name}

+ 5 - 1
file/file-service/pom.xml

@@ -116,6 +116,10 @@
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>com.itextpdf</groupId>
@@ -203,7 +207,7 @@
                 <filtering>true</filtering>
                 <includes>
                     <include>application.yml</include>
-                    <include>application-${profile.active}.yml</include>
+                    <!--<include>application-${profile.active}.yml</include>-->
                     <include>mapper/**</include>
                     <include>*.xml</include>
                     <!-- 前端静态资源 -->

+ 62 - 0
file/file-service/src/main/resources/application-dev-full.yml

@@ -0,0 +1,62 @@
+dubbo:
+  application:
+    name: file-service
+    qos-enable: true
+    qos-port: 16103
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.file.app.rpc,cn.reghao.tnb.file.app.zjob.rpc,cn.reghao.tnb.file.app.zorder.rpc,cn.reghao.tnb.file.app.zoss.rpc
+  protocol:
+    name: dubbo
+    port: 6103
+  registry:
+    group: dubbo
+    address: zookeeper://127.0.0.1:2181
+server:
+  port: 6003
+  tomcat:
+    max-http-form-post-size: 4MB
+spring:
+  servlet:
+    multipart:
+      max-request-size: 1GB
+      max-file-size: 1GB
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 10
+      auto-commit: true
+      idle-timeout: 30000
+      pool-name: EvaluationHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+    url: jdbc:mysql://127.0.0.1/tnb_content_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+    username: test
+    password: Test_123456
+  cloud:
+    discovery:
+      enabled: true
+    nacos:
+      discovery:
+        server-addr: 127.0.0.1:8848
+        username: nacos
+        password: Test_123456
+  data:
+    redis:
+      database: 0
+      host: 127.0.0.1
+      port: 6379
+      password: Test_123456
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**.xml
+  type-aliases-package: cn.reghao.tnb.file.app.model.po
+app:
+  baseDir: /opt/data/tnbfile

+ 62 - 0
file/file-service/src/main/resources/application-test-full.yml

@@ -0,0 +1,62 @@
+dubbo:
+  application:
+    name: file-service
+    qos-enable: true
+    qos-port: 16103
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.file.app.rpc,cn.reghao.tnb.file.app.zjob.rpc,cn.reghao.tnb.file.app.zorder.rpc,cn.reghao.tnb.file.app.zoss.rpc
+  protocol:
+    name: dubbo
+    port: 6103
+  registry:
+    group: dubbo
+    address: zookeeper://192.168.0.209:2181
+server:
+  port: 6003
+  tomcat:
+    max-http-form-post-size: 4MB
+spring:
+  servlet:
+    multipart:
+      max-request-size: 1GB
+      max-file-size: 1GB
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 10
+      auto-commit: true
+      idle-timeout: 30000
+      pool-name: EvaluationHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+    url: jdbc:mysql://192.168.0.209/tnb_content_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+    username: test
+    password: Test_123456
+  cloud:
+    discovery:
+      enabled: true
+    nacos:
+      discovery:
+        server-addr: 192.168.0.209:8848
+        username: nacos
+        password: Test_123456
+  data:
+    redis:
+      database: 0
+      host: 192.168.0.209
+      port: 6379
+      password: Test_123456
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**.xml
+  type-aliases-package: cn.reghao.tnb.file.app.model.po
+app:
+  baseDir: /opt/data/tnbfile

+ 14 - 44
file/file-service/src/main/resources/application.yml

@@ -1,49 +1,19 @@
-dubbo:
-  application:
-    name: file-service
-    qos-enable: true
-    qos-port: 16103
-    qos-accept-foreign-ip: false
-  scan:
-    base-packages: cn.reghao.tnb.file.app.rpc,cn.reghao.tnb.file.app.zjob.rpc,cn.reghao.tnb.file.app.zorder.rpc,cn.reghao.tnb.file.app.zoss.rpc
-  protocol:
-    name: dubbo
-    port: 6103
-server:
-  port: 6003
-  tomcat:
-    max-http-form-post-size: 4MB
 spring:
-  threads:
-    virtual:
-      enabled: true
-  servlet:
-    multipart:
-      max-request-size: 1GB
-      max-file-size: 1GB
   application:
     name: file-service
   profiles:
     active: @profile.active@
-  mvc:
-    pathmatch:
-      matching-strategy: ant_path_matcher
-  datasource:
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    type: com.zaxxer.hikari.HikariDataSource
-    hikari:
-      minimum-idle: 5
-      maximum-pool-size: 10
-      auto-commit: true
-      idle-timeout: 30000
-      pool-name: EvaluationHikariCP
-      max-lifetime: 1800000
-      connection-timeout: 30000
-      connection-test-query: SELECT 1
-mybatis:
-  configuration:
-    map-underscore-to-camel-case: true
-  mapper-locations: classpath*:mapper/**.xml
-  type-aliases-package: cn.reghao.tnb.file.app.model.po
-app:
-  baseDir: /opt/data/tnbfile
+  threads:
+    virtual:
+      enabled: true
+  cloud:
+    nacos:
+      config:
+        server-addr: 127.0.0.1
+        group: DEFAULT_GROUP
+        file-extension: yaml
+        username: nacos
+        password: Test_123456
+  config:
+    import:
+      - nacos:${spring.application.name}-${spring.profiles.active}

+ 49 - 0
file/file-service/src/main/resources/application0.yml

@@ -0,0 +1,49 @@
+dubbo:
+  application:
+    name: file-service
+    qos-enable: true
+    qos-port: 16103
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.file.app.rpc,cn.reghao.tnb.file.app.zjob.rpc,cn.reghao.tnb.file.app.zorder.rpc,cn.reghao.tnb.file.app.zoss.rpc
+  protocol:
+    name: dubbo
+    port: 6103
+server:
+  port: 6003
+  tomcat:
+    max-http-form-post-size: 4MB
+spring:
+  threads:
+    virtual:
+      enabled: true
+  servlet:
+    multipart:
+      max-request-size: 1GB
+      max-file-size: 1GB
+  application:
+    name: file-service
+  profiles:
+    active: @profile.active@
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 10
+      auto-commit: true
+      idle-timeout: 30000
+      pool-name: EvaluationHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**.xml
+  type-aliases-package: cn.reghao.tnb.file.app.model.po
+app:
+  baseDir: /opt/data/tnbfile

+ 6 - 1
message/message-service/pom.xml

@@ -85,6 +85,11 @@
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+
         <!--<dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
@@ -160,7 +165,7 @@
                 <filtering>true</filtering>
                 <includes>
                     <include>application.yml</include>
-                    <include>application-${profile.active}.yml</include>
+                    <!--<include>application-${profile.active}.yml</include>-->
                     <include>mapper/**</include>
                     <include>*.xml</include>
                 </includes>

+ 74 - 0
message/message-service/src/main/resources/application-dev-full.yml

@@ -0,0 +1,74 @@
+dubbo:
+  application:
+    name: message-service
+    qos-enable: true
+    qos-port: 16102
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.message.app.rpc
+  protocol:
+    name: dubbo
+    port: 6102
+  registry:
+    group: dubbo
+    address: zookeeper://127.0.0.1:2181
+server:
+  port: 6002
+spring:
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 10
+      auto-commit: true
+      idle-timeout: 30000
+      pool-name: EvaluationHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+    url: jdbc:mysql://127.0.0.1/tnb_account_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+    username: test
+    password: Test_123456
+  cloud:
+    discovery:
+      enabled: true
+    nacos:
+      discovery:
+        server-addr: 127.0.0.1:8848
+        username: nacos
+        password: Test_123456
+  data:
+    redis:
+      database: 0
+      host: 127.0.0.1
+      port: 6379
+      password: Test_123456
+  rabbitmq:
+    host: 127.0.0.1
+    port: 5672
+    virtual-host: /
+    username: test
+    password: Test_123456
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**.xml
+  type-aliases-package: cn.reghao.tnb.message.app.model.po
+hystrix:
+  dashboard:
+    proxy-stream-allow-list: "127.0.0.1"
+turbine:
+  # 指定需要收集信息的服务名(注册到 EurekaServer 中的名字)
+  appConfig: user-service
+  aggregator:
+    cluster-config: default
+  # 指定集群名称
+  # 当服务实例非常多时可以使用多个 Turbine 来构建不同的聚合集群,本参数则用于区分这些不同的集群
+  # 同时本参数可以在 HystrixDashboard 中用来定位不同的聚合集群,只需在 Hystrix Stream 的 URL 中通过 cluster 参数来指定即可
+  cluster-name-expression: new String("default")
+  # 让同一主机上的服务通过主机名和端口号的组合来进行区分,默认以 host 来区分不同的服务
+  combine-host-port: true

+ 74 - 0
message/message-service/src/main/resources/application-test-full.yml

@@ -0,0 +1,74 @@
+dubbo:
+  application:
+    name: message-service
+    qos-enable: true
+    qos-port: 16102
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.message.app.rpc
+  protocol:
+    name: dubbo
+    port: 6102
+  registry:
+    group: dubbo
+    address: zookeeper://192.168.0.209:2181
+server:
+  port: 6002
+spring:
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 10
+      auto-commit: true
+      idle-timeout: 30000
+      pool-name: EvaluationHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+    url: jdbc:mysql://192.168.0.209/tnb_account_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+    username: test
+    password: Test_123456
+  cloud:
+    discovery:
+      enabled: true
+    nacos:
+      discovery:
+        server-addr: 192.168.0.209:8848
+        username: nacos
+        password: Test_123456
+  data:
+    redis:
+      database: 0
+      host: 192.168.0.209
+      port: 6379
+      password: Test_123456
+  rabbitmq:
+    host: 192.168.0.209
+    port: 5672
+    virtual-host: /
+    username: test
+    password: Test_123456
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**.xml
+  type-aliases-package: cn.reghao.tnb.message.app.model.po
+hystrix:
+  dashboard:
+    proxy-stream-allow-list: "192.168.0.209"
+turbine:
+  # 指定需要收集信息的服务名(注册到 EurekaServer 中的名字)
+  appConfig: user-service
+  aggregator:
+    cluster-config: default
+  # 指定集群名称
+  # 当服务实例非常多时可以使用多个 Turbine 来构建不同的聚合集群,本参数则用于区分这些不同的集群
+  # 同时本参数可以在 HystrixDashboard 中用来定位不同的聚合集群,只需在 Hystrix Stream 的 URL 中通过 cluster 参数来指定即可
+  cluster-name-expression: new String("default")
+  # 让同一主机上的服务通过主机名和端口号的组合来进行区分,默认以 host 来区分不同的服务
+  combine-host-port: true

+ 14 - 38
message/message-service/src/main/resources/application.yml

@@ -1,43 +1,19 @@
-dubbo:
-  application:
-    name: message-service
-    qos-enable: true
-    qos-port: 16102
-    qos-accept-foreign-ip: false
-  scan:
-    base-packages: cn.reghao.tnb.message.app.rpc
-  protocol:
-    name: dubbo
-    port: 6102
-server:
-  port: 6002
 spring:
-  threads:
-    virtual:
-      enabled: true
   application:
     name: message-service
   profiles:
     active: @profile.active@
-  mvc:
-    pathmatch:
-      matching-strategy: ant_path_matcher
-mybatis:
-  configuration:
-    map-underscore-to-camel-case: true
-  mapper-locations: classpath*:mapper/**.xml
-  type-aliases-package: cn.reghao.tnb.message.app.model.po
-hystrix:
-  dashboard:
-    proxy-stream-allow-list: "127.0.0.1"
-turbine:
-  # 指定需要收集信息的服务名(注册到 EurekaServer 中的名字)
-  appConfig: user-service
-  aggregator:
-    cluster-config: default
-  # 指定集群名称
-  # 当服务实例非常多时可以使用多个 Turbine 来构建不同的聚合集群,本参数则用于区分这些不同的集群
-  # 同时本参数可以在 HystrixDashboard 中用来定位不同的聚合集群,只需在 Hystrix Stream 的 URL 中通过 cluster 参数来指定即可
-  cluster-name-expression: new String("default")
-  # 让同一主机上的服务通过主机名和端口号的组合来进行区分,默认以 host 来区分不同的服务
-  combine-host-port: true
+  threads:
+    virtual:
+      enabled: true
+  cloud:
+    nacos:
+      config:
+        server-addr: 127.0.0.1
+        group: DEFAULT_GROUP
+        file-extension: yaml
+        username: nacos
+        password: Test_123456
+  config:
+    import:
+      - nacos:${spring.application.name}-${spring.profiles.active}

+ 43 - 0
message/message-service/src/main/resources/application0.yml

@@ -0,0 +1,43 @@
+dubbo:
+  application:
+    name: message-service
+    qos-enable: true
+    qos-port: 16102
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.message.app.rpc
+  protocol:
+    name: dubbo
+    port: 6102
+server:
+  port: 6002
+spring:
+  threads:
+    virtual:
+      enabled: true
+  application:
+    name: message-service
+  profiles:
+    active: @profile.active@
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+mybatis:
+  configuration:
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:mapper/**.xml
+  type-aliases-package: cn.reghao.tnb.message.app.model.po
+hystrix:
+  dashboard:
+    proxy-stream-allow-list: "127.0.0.1"
+turbine:
+  # 指定需要收集信息的服务名(注册到 EurekaServer 中的名字)
+  appConfig: user-service
+  aggregator:
+    cluster-config: default
+  # 指定集群名称
+  # 当服务实例非常多时可以使用多个 Turbine 来构建不同的聚合集群,本参数则用于区分这些不同的集群
+  # 同时本参数可以在 HystrixDashboard 中用来定位不同的聚合集群,只需在 Hystrix Stream 的 URL 中通过 cluster 参数来指定即可
+  cluster-name-expression: new String("default")
+  # 让同一主机上的服务通过主机名和端口号的组合来进行区分,默认以 host 来区分不同的服务
+  combine-host-port: true

+ 3 - 3
search/search-service/pom.xml

@@ -142,10 +142,10 @@
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
         </dependency>
-        <!--<dependency>
+        <dependency>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>-->
+        </dependency>
 
         <dependency>
             <groupId>org.springdoc</groupId>
@@ -186,7 +186,7 @@
                 <filtering>true</filtering>
                 <includes>
                     <include>application.yml</include>
-                    <include>application-${profile.active}.yml</include>
+                    <!--<include>application-${profile.active}.yml</include>-->
                     <include>mapper/**</include>
                     <include>*.xml</include>
                 </includes>

+ 74 - 0
search/search-service/src/main/resources/application-dev-full.yml

@@ -0,0 +1,74 @@
+dubbo:
+  application:
+    name: ${spring.application.name}
+    qos-enable: true
+    qos-port: 16107
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.search.app.rpc
+  registry:
+    group: dubbo
+    address: zookeeper://127.0.0.1:2181
+server:
+  port: 6006
+spring:
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 10
+      auto-commit: true
+      idle-timeout: 30000
+      pool-name: EvaluationHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+    url: jdbc:mysql://127.0.0.1/tnb_content_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+    username: test
+    password: Test_123456
+  jpa:
+    show-sql: false
+    open-in-view: true
+    hibernate:
+      ddl-auto: update
+    properties:
+      hibernate.format_sql: true
+      hibernate.naming.physical-strategy: org.hibernate.scripts.model.naming.PhysicalNamingStrategyStandardImpl
+      hibernate.cache.use_second_level_cache: false
+      hibernate.search.backend.directory.type: local-filesystem
+      hibernate.search.backend.directory.root: ${app.base-dir}/${app.hibernate-lucene-dirname}
+      hibernate.search.backend.analysis.configurer: class:cn.reghao.tnb.search.app.config.MyLuceneAnalysisConfigurer
+  cloud:
+    discovery:
+      enabled: true
+    nacos:
+      discovery:
+        server-addr: 127.0.0.1:8848
+        username: nacos
+        password: Test_123456
+  data:
+    mongodb:
+      host: 127.0.0.1
+      database: "tnb_content_rdb"
+      authentication-database: admin
+      username: test
+      password: Test_123456
+    redis:
+      database: 0
+      host: 127.0.0.1
+      port: 6379
+      password: Test_123456
+  rabbitmq:
+    host: 127.0.0.1
+    port: 5672
+    virtual-host: /
+    username: test
+    password: Test_123456
+app:
+  base-dir: /opt/data/search_data
+  native-lucene-dirname: native_lucene
+  hibernate-lucene-dirname: hibernate_lucene

+ 86 - 0
search/search-service/src/main/resources/application-test-full.yml

@@ -0,0 +1,86 @@
+dubbo:
+  application:
+    name: search-service
+    qos-enable: true
+    qos-port: 16107
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.search.app.rpc
+  protocol:
+    name: dubbo
+    #    host: 192.168.0.210
+    port: 6107
+  registry:
+    group: dubbo
+    address: zookeeper://192.168.0.209:2181
+server:
+  port: 6006
+spring:
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 10
+      auto-commit: true
+      idle-timeout: 30000
+      pool-name: EvaluationHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+    url: jdbc:mysql://192.168.0.209/tnb_content_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+    username: test
+    password: Test_123456
+  jpa:
+    show-sql: false
+    open-in-view: true
+    hibernate:
+      ddl-auto: update
+    properties:
+      hibernate.format_sql: true
+      hibernate.naming.physical-strategy: org.hibernate.scripts.model.naming.PhysicalNamingStrategyStandardImpl
+      hibernate.cache.use_second_level_cache: false
+      hibernate.search.backend.directory.type: local-filesystem
+      hibernate.search.backend.directory.root: ${app.base-dir}/${app.hibernate-lucene-dirname}
+      hibernate.search.backend.analysis.configurer: class:cn.reghao.tnb.search.app.config.MyLuceneAnalysisConfigurer
+  cloud:
+    discovery:
+      enabled: true
+    nacos:
+      discovery:
+        server-addr: 192.168.0.209:8848
+        username: nacos
+        password: Test_123456
+  data:
+    mongodb:
+      host: 192.168.0.209
+      database: "tnb_content_tdb"
+      authentication-database: admin
+      username: test
+      password: Test_123456
+    redis:
+      database: 0
+      host: 192.168.0.209
+      port: 6379
+      password: Test_123456
+  rabbitmq:
+    host: 192.168.0.209
+    port: 5672
+    virtual-host: /
+    username: test
+    password: Test_123456
+app:
+  es-host: 192.168.0.81
+  es-port: 9200
+  es-username: elastic
+  es-password: VLTtN03SSJ4lsyyg56kf
+  kafka-uri: 192.168.0.81:9092
+  kafka-topic: NginxLog
+  base-dir: /opt/data/search_data
+  native-lucene-dirname: native_lucene
+  hibernate-lucene-dirname: hibernate_lucene
+  geoip-filename: qqwry.dat
+  geojson-filename: china1.json

+ 11 - 11
search/search-service/src/main/resources/application.yml

@@ -6,14 +6,14 @@ spring:
   threads:
     virtual:
       enabled: true
-#  cloud:
-#    nacos:
-#      config:
-#        server-addr: 127.0.0.1
-#        group: DEFAULT_GROUP
-#        file-extension: yaml
-#        username: nacos
-#        password: Test_123456
-#  config:
-#    import:
-#      - nacos:${spring.application.name}-${spring.profiles.active}
+  cloud:
+    nacos:
+      config:
+        server-addr: 127.0.0.1
+        group: DEFAULT_GROUP
+        file-extension: yaml
+        username: nacos
+        password: Test_123456
+  config:
+    import:
+      - nacos:${spring.application.name}-${spring.profiles.active}

+ 19 - 0
search/search-service/src/main/resources/application0.yml

@@ -0,0 +1,19 @@
+spring:
+  application:
+    name: search-service
+  profiles:
+    active: @profile.active@
+  threads:
+    virtual:
+      enabled: true
+#  cloud:
+#    nacos:
+#      config:
+#        server-addr: 127.0.0.1
+#        group: DEFAULT_GROUP
+#        file-extension: yaml
+#        username: nacos
+#        password: Test_123456
+#  config:
+#    import:
+#      - nacos:${spring.application.name}-${spring.profiles.active}