Ver código fonte

modify mongo host

supeng 2 meses atrás
pai
commit
7fbf139cdc

+ 4 - 0
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/config/CustomMongoProperties.java

@@ -15,6 +15,10 @@ public class CustomMongoProperties {
     private Integer clusterPort;
     private String secondaryHost;
     private Integer secondaryPort;
+    private String thirdHost;
+    private Integer thirdPort;
+    private String fourthHost;
+    private Integer fourthPort;
 
     private String uri;
     private String database;

+ 3 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/config/MongoTemplateConfig.java

@@ -35,7 +35,9 @@ public class MongoTemplateConfig {
         builder.applyToClusterSettings(settings -> {
             settings.hosts(Lists.newArrayList(
                     new ServerAddress(properties.getClusterHost(), properties.getClusterPort()),
-                    new ServerAddress(properties.getSecondaryHost(), properties.getSecondaryPort())));
+                    new ServerAddress(properties.getSecondaryHost(), properties.getSecondaryPort()),
+                    new ServerAddress(properties.getThirdHost(), properties.getThirdPort()),
+                    new ServerAddress(properties.getFourthHost(), properties.getFourthPort())));
         });
 
 

+ 4 - 0
recommend-server-service/src/main/resources/application-pre.yml

@@ -77,6 +77,10 @@ spring:
       clusterPort: 3717
       secondaryHost: s-bp137073555e7bc4.mongodb.rds.aliyuncs.com
       secondaryPort: 3717
+      thirdHost: s-bp1b01b2507c9fa4.mongodb.rds.aliyuncs.com
+      thirdPort: 3717
+      fourthHost: s-bp103402c272fa24.mongodb.rds.aliyuncs.com
+      fourthPort: 3717
       database: longvideo
       username: lv
       password: lv2018

+ 4 - 0
recommend-server-service/src/main/resources/application-prod.yml

@@ -77,6 +77,10 @@ spring:
       clusterPort: 3717
       secondaryHost: s-bp137073555e7bc4.mongodb.rds.aliyuncs.com
       secondaryPort: 3717
+      thirdHost: s-bp1b01b2507c9fa4.mongodb.rds.aliyuncs.com
+      thirdPort: 3717
+      fourthHost: s-bp103402c272fa24.mongodb.rds.aliyuncs.com
+      fourthPort: 3717
       database: longvideo
       username: lv
       password: lv2018