diff --git a/datasophon-api/src/main/resources/meta/DDP-1.2.0/ELASTICSEARCH/service_ddl.json b/datasophon-api/src/main/resources/meta/DDP-1.2.0/ELASTICSEARCH/service_ddl.json index a6b8e7e3..4688907c 100644 --- a/datasophon-api/src/main/resources/meta/DDP-1.2.0/ELASTICSEARCH/service_ddl.json +++ b/datasophon-api/src/main/resources/meta/DDP-1.2.0/ELASTICSEARCH/service_ddl.json @@ -116,13 +116,14 @@ "http.cors.enabled", "http.cors.allow-origin", "path.data", + "path.logs", "custom.elasticsearch.yml" ] }, { "filename": "jvm.options", "configFormat": "custom", - "outputDirectory": "", + "outputDirectory": "config/jvm.options.d", "templateName": "jvm.options.ftl", "includeParams": [ "heapSize" @@ -260,7 +261,19 @@ "separator": ",", "required": true, "type": "multiple", - "value": ["/data/es"], + "value": ["/data/es/data"], + "configurableInWizard": true, + "hidden": false, + "defaultValue": "" + }, + { + "name": "path.logs", + "label": "日志存储目录", + "description": "", + "configType": "path", + "required": true, + "type": "input", + "value": "/data/es/logs", "configurableInWizard": true, "hidden": false, "defaultValue": "" @@ -269,12 +282,16 @@ "name": "heapSize", "label": "ES堆内存大小", "description": "", - "required": false, + "configType": "map", + "required": true, + "minValue": 0, + "maxValue": 256, "type": "input", "value": "", + "unit": "GB", "configurableInWizard": true, - "hidden": true, - "defaultValue": "2g" + "hidden": false, + "defaultValue": "2" }, { "name": "custom.elasticsearch.yml", @@ -289,4 +306,4 @@ "defaultValue": "" } ] -} \ No newline at end of file +} diff --git a/datasophon-api/src/main/resources/meta/DDP-1.2.1/ELASTICSEARCH/service_ddl.json b/datasophon-api/src/main/resources/meta/DDP-1.2.1/ELASTICSEARCH/service_ddl.json index a6b8e7e3..4688907c 100644 --- a/datasophon-api/src/main/resources/meta/DDP-1.2.1/ELASTICSEARCH/service_ddl.json +++ b/datasophon-api/src/main/resources/meta/DDP-1.2.1/ELASTICSEARCH/service_ddl.json @@ -116,13 +116,14 @@ "http.cors.enabled", "http.cors.allow-origin", "path.data", + "path.logs", "custom.elasticsearch.yml" ] }, { "filename": "jvm.options", "configFormat": "custom", - "outputDirectory": "", + "outputDirectory": "config/jvm.options.d", "templateName": "jvm.options.ftl", "includeParams": [ "heapSize" @@ -260,7 +261,19 @@ "separator": ",", "required": true, "type": "multiple", - "value": ["/data/es"], + "value": ["/data/es/data"], + "configurableInWizard": true, + "hidden": false, + "defaultValue": "" + }, + { + "name": "path.logs", + "label": "日志存储目录", + "description": "", + "configType": "path", + "required": true, + "type": "input", + "value": "/data/es/logs", "configurableInWizard": true, "hidden": false, "defaultValue": "" @@ -269,12 +282,16 @@ "name": "heapSize", "label": "ES堆内存大小", "description": "", - "required": false, + "configType": "map", + "required": true, + "minValue": 0, + "maxValue": 256, "type": "input", "value": "", + "unit": "GB", "configurableInWizard": true, - "hidden": true, - "defaultValue": "2g" + "hidden": false, + "defaultValue": "2" }, { "name": "custom.elasticsearch.yml", @@ -289,4 +306,4 @@ "defaultValue": "" } ] -} \ No newline at end of file +} diff --git a/datasophon-api/src/main/resources/meta/DDP-1.2.2/ELASTICSEARCH/service_ddl.json b/datasophon-api/src/main/resources/meta/DDP-1.2.2/ELASTICSEARCH/service_ddl.json index a6b8e7e3..4688907c 100644 --- a/datasophon-api/src/main/resources/meta/DDP-1.2.2/ELASTICSEARCH/service_ddl.json +++ b/datasophon-api/src/main/resources/meta/DDP-1.2.2/ELASTICSEARCH/service_ddl.json @@ -116,13 +116,14 @@ "http.cors.enabled", "http.cors.allow-origin", "path.data", + "path.logs", "custom.elasticsearch.yml" ] }, { "filename": "jvm.options", "configFormat": "custom", - "outputDirectory": "", + "outputDirectory": "config/jvm.options.d", "templateName": "jvm.options.ftl", "includeParams": [ "heapSize" @@ -260,7 +261,19 @@ "separator": ",", "required": true, "type": "multiple", - "value": ["/data/es"], + "value": ["/data/es/data"], + "configurableInWizard": true, + "hidden": false, + "defaultValue": "" + }, + { + "name": "path.logs", + "label": "日志存储目录", + "description": "", + "configType": "path", + "required": true, + "type": "input", + "value": "/data/es/logs", "configurableInWizard": true, "hidden": false, "defaultValue": "" @@ -269,12 +282,16 @@ "name": "heapSize", "label": "ES堆内存大小", "description": "", - "required": false, + "configType": "map", + "required": true, + "minValue": 0, + "maxValue": 256, "type": "input", "value": "", + "unit": "GB", "configurableInWizard": true, - "hidden": true, - "defaultValue": "2g" + "hidden": false, + "defaultValue": "2" }, { "name": "custom.elasticsearch.yml", @@ -289,4 +306,4 @@ "defaultValue": "" } ] -} \ No newline at end of file +} diff --git a/datasophon-common/src/main/java/com/datasophon/common/Constants.java b/datasophon-common/src/main/java/com/datasophon/common/Constants.java index 49ce731f..29e73043 100644 --- a/datasophon-common/src/main/java/com/datasophon/common/Constants.java +++ b/datasophon-common/src/main/java/com/datasophon/common/Constants.java @@ -36,6 +36,8 @@ public final class Constants { public static final String HOST_MAP = "_host_map"; public static final String COMMAND_HOST_ID = "command_host_id"; public static final String HOST_MD5 = "_host_md5"; + public static final String SSH_USER = PropertyUtils.getString("sshUser", Constants.ROOT); + public static final int SSH_PORT = PropertyUtils.getInt("sshPort", 22); public static final String ID_RSA = PropertyUtils.getString("id_rsa", "/.ssh/id_rsa"); public static final String HOSTNAME = "hostname"; diff --git a/datasophon-common/src/main/resources/common.properties b/datasophon-common/src/main/resources/common.properties index 485bc178..8a8b23ee 100644 --- a/datasophon-common/src/main/resources/common.properties +++ b/datasophon-common/src/main/resources/common.properties @@ -26,4 +26,6 @@ times=20 timeOutPeriodOne=1 timeOutPeriodTwo=2 HADOOP_HOME=/opt/datasophon/hadoop +sshUser=root +sshPort=22 id_rsa=/.ssh/id_rsa diff --git a/datasophon-service/src/main/java/com/datasophon/api/service/impl/InstallServiceImpl.java b/datasophon-service/src/main/java/com/datasophon/api/service/impl/InstallServiceImpl.java index 64cbc7ca..529c8c2c 100644 --- a/datasophon-service/src/main/java/com/datasophon/api/service/impl/InstallServiceImpl.java +++ b/datasophon-service/src/main/java/com/datasophon/api/service/impl/InstallServiceImpl.java @@ -357,8 +357,8 @@ public Result reStartDispatcherHostAgent(Integer clusterId, String hostnames) { hostInfo = map.get(hostname); } else if (Objects.nonNull(clusterHost)) { hostInfo.setHostname(hostname); - hostInfo.setSshUser("root"); - hostInfo.setSshPort(22); + hostInfo.setSshUser(Constants.SSH_USER); + hostInfo.setSshPort(Constants.SSH_PORT); } ActorRef hostActor = ActorUtils.getLocalActor( @@ -435,7 +435,7 @@ public Result generateHostAgentCommand(String clusterHostIds, String commandType List clusterHostList = hostService.getHostListByIds(clusterHostIdList); for (ClusterHostDO clusterHostDO : clusterHostList) { ClientSession session = - MinaUtils.openConnection(clusterHostDO.getHostname(), 22, Constants.ROOT); + MinaUtils.openConnection(clusterHostDO.getHostname(), Constants.SSH_PORT, Constants.SSH_USER); String result = MinaUtils.execCmdWithResult(session, "service datasophon-worker " + commandType); logger.info("hostAgent command:{}", "service datasophon-worker " + commandType); if (result != null && !result.equals("failed")) { diff --git a/datasophon-worker/src/main/resources/templates/jvm.options.ftl b/datasophon-worker/src/main/resources/templates/jvm.options.ftl index aa7c6737..3028c4dd 100644 --- a/datasophon-worker/src/main/resources/templates/jvm.options.ftl +++ b/datasophon-worker/src/main/resources/templates/jvm.options.ftl @@ -1,2 +1,2 @@ --Xms${heapSize} --Xmx${heapSize} \ No newline at end of file +-Xms${heapSize}g +-Xmx${heapSize}g