Prechádzať zdrojové kódy

**************************************************
添加注册中心,调试数据同步

zhangweixin 4 rokov pred
rodič
commit
1c8f56c2b7

+ 0 - 6
datacenter/src/main/resources/application-prod.yml

@@ -28,14 +28,8 @@ server:
 
 spring:
   datasource:
-#    url:                                jdbc:postgresql://data-center:5432/datacenter
-#    username:                           postgres
-#    password:                           123qwe!@#
     url:                                jdbc:postgresql://192.168.0.72:5432/datacenter
-#    url:                                jdbc:postgresql://172.17.11.228:5432/datacenterlabsl
-#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
     username:                           postgres
-#    password:                           persagy_2020qwe!@#
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 
   rabbitmq:

+ 1 - 1
datasyn/src/main/kotlin/com/persagy/server/datacenter/syn/task/SchedulerTask.kt

@@ -53,7 +53,7 @@ class SchedulerTask {
     //cron表达式:每隔5秒执行一次
 //    @Scheduled(cron = "0 */3 * * * ?")
 //    @Scheduled(cron="0/30 * *  * * ? ")   //每5秒执行一次
-//    @Scheduled(cron = "0 */1 * * * ?")
+    @Scheduled(cron = "0 */1 * * * ?")
     fun scheduled() {
         logger.info("同步数据中心任务开始至中台")
         messageProcessing.syncDataCenter()

+ 21 - 8
datasyn/src/main/resources/application-prod.yml

@@ -3,26 +3,39 @@ server:
 
 spring:
   datasource:
-#    url:                                jdbc:postgresql://data-center:5432/datacenterlabsl
-    url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
+    url:                                jdbc:postgresql://192.168.0.72:5432/datacenter
     username:                           postgres
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 
 
+# spring-cloud相关配置
+eureka:
+  client:                                   #客户端注册进eureka服务列表内
+    service-url:
 
+      defaultZone:                                http://frame:123456@192.168.100.33/:9931eureka/
+      enable-self-preservation: false # 设为false,关闭自我保护
+      eviction-interval-timer-in-ms: 5000 # 清理间隔(单位毫秒,默认是60*1000)启用主动失效,
+  instance:
+    #不加的话我看过eureka注册界面,是以docker容器的container id注册过去的,譬如container id为abcde,
+    #那么当访问该微服务时,eureka以http://abcde/xxx,去访问的,当然是访问不到该服务.
+    #配置下面的选项后,就会以内网ip加端口去访问就能访问到了。
+    prefer-ip-address: true
+    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
 
-    #配置rabbitMq 服务器
   rabbitmq:
-    host: 39.102.43.179
+    host: 192.168.100.32
     port: 9936
-    username: admin
-    password: brzj123456
+    username: pbsage
+    password: pbsage123
     #虚拟host 可以不设置,使用server默认host
     virtual-host: /test
 
 saga:
   dataPlatform:                        http://39.102.40.239:9970
-
+  data_org:                            http://172.16.46.33:8831
+  data_rwd:                            http://172.16.46.33:8832
+  data_dic:                            http://172.16.46.33:8830
 mqtopid:
   exchange:                           exchange-dmp
   routingKey:
@@ -30,7 +43,7 @@ mqtopid:
 
 custom: # 自定义类型
   #true 代表eureka  false  代表 http
-  eurekaorhttp:                       false
+  eurekaorhttp:                       true
 
 # 服务名
 servicename: #注册中心使用,服务名