diff --git a/pom.xml b/pom.xml
index 4b2a661b9..a116bf55e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
com.actiontech
dble
- 2.18.02.0
+ 2.18.02.1-dev
jar
dble-server
The project of dble-server
diff --git a/src/main/java/com/actiontech/dble/config/ConfigInitializer.java b/src/main/java/com/actiontech/dble/config/ConfigInitializer.java
index 749b0d3a9..7f4be35d0 100644
--- a/src/main/java/com/actiontech/dble/config/ConfigInitializer.java
+++ b/src/main/java/com/actiontech/dble/config/ConfigInitializer.java
@@ -15,6 +15,7 @@ import com.actiontech.dble.config.loader.xml.XMLSchemaLoader;
import com.actiontech.dble.config.loader.xml.XMLServerLoader;
import com.actiontech.dble.config.model.*;
import com.actiontech.dble.config.util.ConfigException;
+import com.actiontech.dble.log.alarm.AlarmCode;
import com.actiontech.dble.route.sequence.handler.DistributedSequenceHandler;
import com.actiontech.dble.route.sequence.handler.IncrSequenceMySQLHandler;
import com.actiontech.dble.route.sequence.handler.IncrSequenceTimeHandler;
@@ -171,9 +172,7 @@ public class ConfigInitializer {
for (SchemaConfig sc : schemas.values()) {
// check dataNode / dataHost
Set dataNodeNames = sc.getAllDataNodes();
- for (String dataNodeName : dataNodeNames) {
- allUseDataNode.add(dataNodeName);
- }
+ allUseDataNode.addAll(dataNodeNames);
}
// add global sequence node when it is some dedicated servers */
@@ -235,24 +234,33 @@ public class ConfigInitializer {
boolean isConnected = ds.testConnection(database);
map.put(key, isConnected);
} catch (IOException e) {
- LOGGER.info("test conn " + key + " error:", e);
+ LOGGER.warn(AlarmCode.CORE_GENERAL_WARN + "test conn " + key + " error:", e);
}
}
}
}
boolean isConnectivity = true;
+ List errKeys = new ArrayList<>();
for (Map.Entry entry : map.entrySet()) {
String key = entry.getKey();
Boolean value = entry.getValue();
if (!value && isConnectivity) {
- LOGGER.info("SelfCheck### test " + key + " database connection failed ");
+ LOGGER.warn(AlarmCode.CORE_GENERAL_WARN + "SelfCheck### test " + key + " database connection failed ");
+ errKeys.add(key);
isConnectivity = false;
} else {
LOGGER.info("SelfCheck### test " + key + " database connection success ");
}
}
if (!isConnectivity) {
- throw new ConfigException("SelfCheck### there are some datasource connection failed, pls check!");
+ StringBuilder sb = new StringBuilder("SelfCheck### there are some datasource connection failed, pls check these datasource:");
+ for (String key : errKeys) {
+ sb.append("[");
+ sb.append(key);
+ sb.append("].");
+ }
+
+ throw new ConfigException(sb.toString());
}
}
}
diff --git a/src/main/java/com/actiontech/dble/manager/response/ReloadConfig.java b/src/main/java/com/actiontech/dble/manager/response/ReloadConfig.java
index 795aafacf..1ce106b5b 100644
--- a/src/main/java/com/actiontech/dble/manager/response/ReloadConfig.java
+++ b/src/main/java/com/actiontech/dble/manager/response/ReloadConfig.java
@@ -7,23 +7,20 @@ package com.actiontech.dble.manager.response;
import com.actiontech.dble.DbleServer;
import com.actiontech.dble.backend.BackendConnection;
-import com.actiontech.dble.cluster.ClusterParamCfg;
-import com.actiontech.dble.config.loader.ucoreprocess.*;
-import com.actiontech.dble.config.loader.ucoreprocess.loader.UConfigStatusResponse;
-import com.actiontech.dble.config.loader.zkprocess.zookeeper.process.ConfStatus;
-import com.actiontech.dble.net.FrontendConnection;
-import com.actiontech.dble.server.ServerConnection;
-import com.actiontech.dble.route.RouteResultsetNode;
import com.actiontech.dble.backend.datasource.PhysicalDBNode;
import com.actiontech.dble.backend.datasource.PhysicalDBPool;
import com.actiontech.dble.backend.datasource.PhysicalDatasource;
import com.actiontech.dble.backend.mysql.nio.MySQLConnection;
+import com.actiontech.dble.cluster.ClusterParamCfg;
import com.actiontech.dble.config.ConfigInitializer;
import com.actiontech.dble.config.ErrorCode;
import com.actiontech.dble.config.ServerConfig;
+import com.actiontech.dble.config.loader.ucoreprocess.*;
+import com.actiontech.dble.config.loader.ucoreprocess.loader.UConfigStatusResponse;
import com.actiontech.dble.config.loader.zkprocess.comm.ZkConfig;
import com.actiontech.dble.config.loader.zkprocess.xmltozk.XmltoZkMain;
import com.actiontech.dble.config.loader.zkprocess.zktoxml.listen.ConfigStatusListener;
+import com.actiontech.dble.config.loader.zkprocess.zookeeper.process.ConfStatus;
import com.actiontech.dble.config.model.ERTable;
import com.actiontech.dble.config.model.FirewallConfig;
import com.actiontech.dble.config.model.SchemaConfig;
@@ -31,13 +28,16 @@ import com.actiontech.dble.config.model.UserConfig;
import com.actiontech.dble.config.util.DnPropertyUtil;
import com.actiontech.dble.log.AlarmAppender;
import com.actiontech.dble.manager.ManagerConnection;
+import com.actiontech.dble.net.FrontendConnection;
import com.actiontech.dble.net.NIOProcessor;
import com.actiontech.dble.net.mysql.OkPacket;
+import com.actiontech.dble.route.RouteResultsetNode;
+import com.actiontech.dble.route.parser.ManagerParseConfig;
+import com.actiontech.dble.server.ServerConnection;
import com.actiontech.dble.server.variables.SystemVariables;
import com.actiontech.dble.server.variables.VarsExtractorHandler;
import com.actiontech.dble.util.KVPathUtil;
import com.actiontech.dble.util.ZKUtils;
-import com.actiontech.dble.route.parser.ManagerParseConfig;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.locks.InterProcessMutex;
import org.apache.curator.utils.ZKPaths;
@@ -307,7 +307,7 @@ public final class ReloadConfig {
/* 2.1 do nothing */
boolean isReloadStatusOK = true;
-
+ String reasonMsg = null;
/* 2.2 init the new dataSource */
for (PhysicalDBPool dbPool : newDataHosts.values()) {
String hostName = dbPool.getHostName();
@@ -329,6 +329,7 @@ public final class ReloadConfig {
dbPool.init(Integer.parseInt(dnIndex));
if (!dbPool.isInitSuccess()) {
isReloadStatusOK = false;
+ reasonMsg = "Init DbPool [" + dbPool.getHostName() + "] failed";
break;
}
}
@@ -347,7 +348,7 @@ public final class ReloadConfig {
dbPool.clearDataSources("reload config");
dbPool.stopHeartbeat();
}
- throw new Exception("Init DbPool failed");
+ throw new Exception(reasonMsg);
}
}
diff --git a/src/main/java/com/actiontech/dble/server/variables/MysqlVarsListener.java b/src/main/java/com/actiontech/dble/server/variables/MysqlVarsListener.java
index 9bc46ba4e..83d589f3a 100644
--- a/src/main/java/com/actiontech/dble/server/variables/MysqlVarsListener.java
+++ b/src/main/java/com/actiontech/dble/server/variables/MysqlVarsListener.java
@@ -26,6 +26,7 @@ public class MysqlVarsListener implements SQLQueryResultListener