Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sshPort和sshUser改为可配置,修改ES配置,添加path.logs,解决heapSize参数未生效问题 #629

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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": ""
Expand All @@ -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",
Expand All @@ -289,4 +306,4 @@
"defaultValue": ""
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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": ""
Expand All @@ -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",
Expand All @@ -289,4 +306,4 @@
"defaultValue": ""
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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": ""
Expand All @@ -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",
Expand All @@ -289,4 +306,4 @@
"defaultValue": ""
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 2 additions & 0 deletions datasophon-common/src/main/resources/common.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ times=20
timeOutPeriodOne=1
timeOutPeriodTwo=2
HADOOP_HOME=/opt/datasophon/hadoop
sshUser=root
sshPort=22
id_rsa=/.ssh/id_rsa
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -435,7 +435,7 @@ public Result generateHostAgentCommand(String clusterHostIds, String commandType
List<ClusterHostDO> 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")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-Xms${heapSize}
-Xmx${heapSize}
-Xms${heapSize}g
-Xmx${heapSize}g