[PR] [INLONG-9833][Agent] Add module state to distinguish whether the module has been downloaded or installed [inlong]
justinwwhuang opened a new pull request, #9834: URL: https://github.com/apache/inlong/pull/9834 [INLONG-9833][Agent] Add module state to distinguish whether the module has been downloaded or installed - Fixes #9833 ### Motivation Add module state to distinguish whether the module has been downloaded or installed ### Modifications Add module state to distinguish whether the module has been downloaded or installed ### Verifying this change *(Please pick either of the following options)* - [ ] This change is a trivial rework/code cleanup without any test coverage. - [ ] This change is already covered by existing tests, such as: *(please describe tests)* - [ ] This change added tests and can be verified as follows: *(example:)* - *Added integration tests for end-to-end deployment with large payloads (10MB)* - *Extended integration test for recovery after broker failure* ### Documentation - Does this pull request introduce a new feature? (yes / no) - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented) - If a feature is not applicable for documentation, explain why? - If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(inlong) branch master updated: [INLONG-9827][Manager] Fix the problem of failed to check if the consumption group exists (#9828)
This is an automated email from the ASF dual-hosted git repository. dockerzhang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/inlong.git The following commit(s) were added to refs/heads/master by this push: new 43bcb9d859 [INLONG-9827][Manager] Fix the problem of failed to check if the consumption group exists (#9828) 43bcb9d859 is described below commit 43bcb9d8599dc89c265d4f49b3d816daa321cc8a Author: fuweng11 <76141879+fuwen...@users.noreply.github.com> AuthorDate: Sun Mar 17 20:46:00 2024 +0800 [INLONG-9827][Manager] Fix the problem of failed to check if the consumption group exists (#9828) --- .../resource/queue/tubemq/TubeMQOperator.java | 55 +++--- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/queue/tubemq/TubeMQOperator.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/queue/tubemq/TubeMQOperator.java index d4f852f893..e13b4cbe2c 100644 --- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/queue/tubemq/TubeMQOperator.java +++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/queue/tubemq/TubeMQOperator.java @@ -65,7 +65,6 @@ public class TubeMQOperator { * TubeMQ const for HTTP URL format */ private static final String TOPIC_NAME = "&topicName="; -private static final String CONSUME_GROUP = "&consumeGroup="; private static final String GROUP_NAME = "&groupName="; private static final String BROKER_ID = "&brokerId="; private static final String CREATE_USER = "&createUser="; @@ -89,18 +88,18 @@ public class TubeMQOperator { */ public void createTopic(@Nonnull TubeClusterInfo tubeCluster, String topicName, String operator) { String masterUrl = tubeCluster.getMasterWebUrl(); -LOGGER.info("begin to create tubemq topic {} in master {}", topicName, masterUrl); +LOGGER.info("begin to create TubeMQ topic {} in master {}", topicName, masterUrl); if (StringUtils.isEmpty(masterUrl) || StringUtils.isEmpty(topicName)) { -throw new BusinessException("tubemq master url or tubemq topic cannot be null"); +throw new BusinessException("TubeMQ master url or TubeMQ topic cannot be null"); } if (this.isTopicExist(masterUrl, topicName)) { -LOGGER.warn("tubemq topic {} already exists in {}, skip to create", topicName, masterUrl); +LOGGER.warn("TubeMQ topic {} already exists in {}, skip to create", topicName, masterUrl); return; } this.createTopicOpt(masterUrl, topicName, tubeCluster.getToken(), operator); -LOGGER.info("success to create tubemq topic {} in {}", topicName, masterUrl); +LOGGER.info("success to create TubeMQ topic {} in {}", topicName, masterUrl); } /** @@ -110,39 +109,39 @@ public class TubeMQOperator { String masterUrl = tubeCluster.getMasterWebUrl(); LOGGER.info("begin to create consumer group {} for topic {} in master {}", consumerGroup, topic, masterUrl); if (StringUtils.isEmpty(masterUrl) || StringUtils.isEmpty(consumerGroup) || StringUtils.isEmpty(topic)) { -throw new BusinessException("tubemq master url, consumer group, or tubemq topic cannot be null"); +throw new BusinessException("TubeMQ master url, consumer group, or TubeMQ topic cannot be null"); } if (!this.isTopicExist(masterUrl, topic)) { -LOGGER.warn("cannot create tubemq consumer group {}, as the topic {} not exists in master {}", +LOGGER.warn("cannot create TubeMQ consumer group {}, as the topic {} not exists in master {}", consumerGroup, topic, masterUrl); return; } if (this.isConsumerGroupExist(masterUrl, topic, consumerGroup)) { -LOGGER.warn("tubemq consumer group {} already exists for topic {} in master {}, skip to create", +LOGGER.warn("TubeMQ consumer group {} already exists for topic {} in master {}, skip to create", consumerGroup, topic, masterUrl); return; } this.createConsumerGroupOpt(masterUrl, topic, consumerGroup, tubeCluster.getToken(), operator); -LOGGER.info("success to create tubemq consumer group {} for topic {} in {}", consumerGroup, topic, masterUrl); +LOGGER.info("success to create TubeMQ consumer group {} for topic {} in {}", consumerGroup, topic, masterUrl); } /** * Check if the topic is exists in the TubeMQ. */ public boolean isTopicExist(String masterUrl, String topicName) { -LOGGER.info("begin to check if the tubemq topic {} exists", topicName); +LOGGER.info("begin to check if the TubeMQ topic {} exists
Re: [PR] [INLONG-9827][Manager] Fix the problem of failed to check if the consumption group exists [inlong]
dockerzhang merged PR #9828: URL: https://github.com/apache/inlong/pull/9828 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[PR] Add Redis connector on flink 1.15 [inlong]
XiaoYou201 opened a new pull request, #9836: URL: https://github.com/apache/inlong/pull/9836 ### Prepare a Pull Request - [INLONG-9835] [Feature][Sort] Add Redis connector on flink 1.15 - Fixes #9835 ### Motivation Add PostgreSQL source connector on flink 1.15 ### Modifications Add PostgreSQL source connector on flink 1.15 ### Documentation - Does this pull request introduce a new feature? (yes) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9829][Agent] Add guardian scripts [inlong]
dockerzhang commented on code in PR #9830: URL: https://github.com/apache/inlong/pull/9830#discussion_r1527688513 ## inlong-agent/agent-installer/bin/installer-env.sh: ## @@ -0,0 +1,60 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +#http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +#project directory Review Comment: ```suggestion # project base directory ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9831][Agent] Increase configuration acquisition capability [inlong]
dockerzhang commented on code in PR #9832: URL: https://github.com/apache/inlong/pull/9832#discussion_r1527690012 ## inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/fetcher/ManagerFetcher.java: ## @@ -141,12 +141,12 @@ public TaskResult fetchTaskConfig() { public TaskResult getStaticConfig() { LOGGER.info("getStaticConfig start"); String resultStr = httpManager.doSentPost(staticConfigUrl, getFetchRequest(null)); -LOGGER.info("test123 staticConfigUrl {}", staticConfigUrl); +LOGGER.info("staticConfigUrl {}", staticConfigUrl); Review Comment: Add a more readable description. ## inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/fetcher/ManagerFetcher.java: ## @@ -141,12 +141,12 @@ public TaskResult fetchTaskConfig() { public TaskResult getStaticConfig() { LOGGER.info("getStaticConfig start"); String resultStr = httpManager.doSentPost(staticConfigUrl, getFetchRequest(null)); -LOGGER.info("test123 staticConfigUrl {}", staticConfigUrl); +LOGGER.info("staticConfigUrl {}", staticConfigUrl); JsonObject resultData = getResultData(resultStr); JsonElement element = resultData.get(AGENT_MANAGER_RETURN_PARAM_DATA); LOGGER.info("getStaticConfig end"); if (element != null) { -LOGGER.info("test123 getStaticConfig not null {}", resultData); +LOGGER.info("getStaticConfig not null {}", resultData); Review Comment: ditto -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9835][Sort] Add Redis connector on flink 1.15 [inlong]
dockerzhang commented on PR #9836: URL: https://github.com/apache/inlong/pull/9836#issuecomment-2002755614 @XiaoYou201 please add more details about this PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9835][Sort] Add Redis connector on flink 1.15 [inlong]
EMsnap commented on PR #9836: URL: https://github.com/apache/inlong/pull/9836#issuecomment-2002759383 Please fix your uts and build -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9833][Agent] Add module state to distinguish whether the module has been downloaded or installed [inlong]
dockerzhang commented on PR #9834: URL: https://github.com/apache/inlong/pull/9834#issuecomment-2002760522 what does the module mean in the installer? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9831][Agent] Increase configuration acquisition capability [inlong]
EMsnap commented on code in PR #9832: URL: https://github.com/apache/inlong/pull/9832#discussion_r1527698155 ## inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java: ## @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.inlong.agent.installer; + +import org.apache.inlong.agent.common.AbstractDaemon; +import org.apache.inlong.agent.installer.conf.InstallerConfiguration; +import org.apache.inlong.agent.metrics.audit.AuditUtils; +import org.apache.inlong.agent.utils.AgentUtils; +import org.apache.inlong.agent.utils.ThreadUtils; +import org.apache.inlong.common.pojo.agent.installer.ConfigResult; +import org.apache.inlong.common.pojo.agent.installer.ModuleConfig; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; + +/** + * Installer Manager, the bridge for job manager, task manager, db e.t.c it manages agent level operations and + * communicates with outside system. + */ +public class ModuleManager extends AbstractDaemon { + +public static final int CONFIG_QUEUE_CAPACITY = 1; +public static final int CORE_THREAD_SLEEP_TIME = 1000; +private static final Logger LOGGER = LoggerFactory.getLogger(ModuleManager.class); +private final InstallerConfiguration conf; +private final BlockingQueue configQueue; + +private String curMd5; + +public ModuleManager() { +conf = InstallerConfiguration.getInstallerConf(); +configQueue = new LinkedBlockingQueue<>(CONFIG_QUEUE_CAPACITY); +} + +public void submitConfig(ConfigResult config) { +if (config == null) { +return; +} +configQueue.clear(); +for (int i = 0; i < config.getModuleList().size(); i++) { +LOGGER.info("submitModules index {} total {} {}", i, config.getModuleList().size(), +config.getModuleList().get(i)); +} +configQueue.add(config); +} + +/** + * thread for core thread. + * + * @return runnable profile. + */ +private Runnable coreThread() { +return () -> { +Thread.currentThread().setName("task-manager-core"); +while (isRunnable()) { +try { +AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME); +dealWithConfigQueue(configQueue); + AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "", +AgentUtils.getCurrentTime(), 1, 1); +} catch (Throwable ex) { +LOGGER.error("exception caught", ex); +ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex); +} +} +}; +} + +private void dealWithConfigQueue(BlockingQueue queue) { +ConfigResult config = queue.poll(); +if (config == null) { +return; +} +LOGGER.info("Deal with config {}", config); +if (curMd5.compareTo(config.getMd5()) == 0) { +LOGGER.info("md5 no change {}, skip update", curMd5); +return; +} +if (updateModules(config.getModuleList())) { +curMd5 = config.getMd5(); +} else { +LOGGER.error("Update modules failed!"); +} +} + +private boolean updateModules(List modules) { +return true; Review Comment: always return true, what does this method for if it always returns true -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9831][Agent] Increase configuration acquisition capability [inlong]
EMsnap commented on code in PR #9832: URL: https://github.com/apache/inlong/pull/9832#discussion_r1527698155 ## inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java: ## @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.inlong.agent.installer; + +import org.apache.inlong.agent.common.AbstractDaemon; +import org.apache.inlong.agent.installer.conf.InstallerConfiguration; +import org.apache.inlong.agent.metrics.audit.AuditUtils; +import org.apache.inlong.agent.utils.AgentUtils; +import org.apache.inlong.agent.utils.ThreadUtils; +import org.apache.inlong.common.pojo.agent.installer.ConfigResult; +import org.apache.inlong.common.pojo.agent.installer.ModuleConfig; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; + +/** + * Installer Manager, the bridge for job manager, task manager, db e.t.c it manages agent level operations and + * communicates with outside system. + */ +public class ModuleManager extends AbstractDaemon { + +public static final int CONFIG_QUEUE_CAPACITY = 1; +public static final int CORE_THREAD_SLEEP_TIME = 1000; +private static final Logger LOGGER = LoggerFactory.getLogger(ModuleManager.class); +private final InstallerConfiguration conf; +private final BlockingQueue configQueue; + +private String curMd5; + +public ModuleManager() { +conf = InstallerConfiguration.getInstallerConf(); +configQueue = new LinkedBlockingQueue<>(CONFIG_QUEUE_CAPACITY); +} + +public void submitConfig(ConfigResult config) { +if (config == null) { +return; +} +configQueue.clear(); +for (int i = 0; i < config.getModuleList().size(); i++) { +LOGGER.info("submitModules index {} total {} {}", i, config.getModuleList().size(), +config.getModuleList().get(i)); +} +configQueue.add(config); +} + +/** + * thread for core thread. + * + * @return runnable profile. + */ +private Runnable coreThread() { +return () -> { +Thread.currentThread().setName("task-manager-core"); +while (isRunnable()) { +try { +AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME); +dealWithConfigQueue(configQueue); + AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "", +AgentUtils.getCurrentTime(), 1, 1); +} catch (Throwable ex) { +LOGGER.error("exception caught", ex); +ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex); +} +} +}; +} + +private void dealWithConfigQueue(BlockingQueue queue) { +ConfigResult config = queue.poll(); +if (config == null) { +return; +} +LOGGER.info("Deal with config {}", config); +if (curMd5.compareTo(config.getMd5()) == 0) { +LOGGER.info("md5 no change {}, skip update", curMd5); +return; +} +if (updateModules(config.getModuleList())) { +curMd5 = config.getMd5(); +} else { +LOGGER.error("Update modules failed!"); +} +} + +private boolean updateModules(List modules) { +return true; Review Comment: what does this method for if it always returns true ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9820][Dashboard][Manager] Update Pulsar source field for Ingestion [inlong]
aloyszhang commented on code in PR #9821: URL: https://github.com/apache/inlong/pull/9821#discussion_r1527706217 ## inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/source/pulsar/PulsarSourceRequest.java: ## @@ -76,6 +76,9 @@ public class PulsarSourceRequest extends SourceRequest { + " Available options are earliest, latest, external-subscription, and specific-offsets.") private String scanStartupMode = "earliest"; +@ApiModelProperty("Reset consumption time") Review Comment: ```suggestion @ApiModelProperty("Reset subscription time") ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9820][Dashboard][Manager] Update Pulsar source field for Ingestion [inlong]
aloyszhang commented on code in PR #9821: URL: https://github.com/apache/inlong/pull/9821#discussion_r1527706531 ## inlong-dashboard/src/ui/locales/en.json: ## @@ -131,6 +131,11 @@ "meta.Sources.Iceberg.Warehouse": "Warehouse", "meta.Sources.Pulsar.PulsarTenant": "Pulsar tenant", "meta.Sources.Pulsar.Namespace": "Namespace", + "meta.Sources.Pulsar.Subscription": "Subscription", + "meta.Sources.Pulsar.SubscriptionHelp": "If not specified, the default is: inlong-agent-{inlongStreamId}", + "meta.Sources.Pulsar.SubscriptionPosition": "Subscription Position", + "meta.Sources.Pulsar.ResetTime": "Reset consumption time", Review Comment: ```suggestion "meta.Sources.Pulsar.ResetTime": "Reset subscription time", ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9831][Agent] Increase configuration acquisition capability [inlong]
justinwwhuang commented on code in PR #9832: URL: https://github.com/apache/inlong/pull/9832#discussion_r1527716864 ## inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java: ## @@ -0,0 +1,119 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.inlong.agent.installer; + +import org.apache.inlong.agent.common.AbstractDaemon; +import org.apache.inlong.agent.installer.conf.InstallerConfiguration; +import org.apache.inlong.agent.metrics.audit.AuditUtils; +import org.apache.inlong.agent.utils.AgentUtils; +import org.apache.inlong.agent.utils.ThreadUtils; +import org.apache.inlong.common.pojo.agent.installer.ConfigResult; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; + +/** + * Installer Manager, the bridge for job manager, task manager, db e.t.c it manages agent level operations and + * communicates with outside system. + */ +public class ModuleManager extends AbstractDaemon { + +public static final int CONFIG_QUEUE_CAPACITY = 1; +public static final int CORE_THREAD_SLEEP_TIME = 1000; +private static final Logger LOGGER = LoggerFactory.getLogger(ModuleManager.class); +private final InstallerConfiguration conf; +private final BlockingQueue configQueue; + +private String curMd5; Review Comment: will use it next issue -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9831][Agent] Increase configuration acquisition capability [inlong]
justinwwhuang commented on code in PR #9832: URL: https://github.com/apache/inlong/pull/9832#discussion_r1527717153 ## inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ManagerFetcher.java: ## @@ -0,0 +1,223 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.inlong.agent.installer; + +import org.apache.inlong.agent.common.AbstractDaemon; +import org.apache.inlong.agent.conf.ProfileFetcher; +import org.apache.inlong.agent.installer.conf.InstallerConfiguration; +import org.apache.inlong.agent.utils.AgentUtils; +import org.apache.inlong.agent.utils.HttpManager; +import org.apache.inlong.agent.utils.ThreadUtils; +import org.apache.inlong.common.db.CommandEntity; +import org.apache.inlong.common.enums.PullJobTypeEnum; +import org.apache.inlong.common.pojo.agent.TaskRequest; +import org.apache.inlong.common.pojo.agent.installer.ConfigResult; +import org.apache.inlong.common.pojo.agent.installer.ModuleConfig; +import org.apache.inlong.common.pojo.agent.installer.PackageConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_FETCHER_INTERVAL; +import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_MANAGER_REQUEST_TIMEOUT; +import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_MANAGER_RETURN_PARAM_DATA; +import static org.apache.inlong.agent.constant.FetcherConstants.AGENT_MANAGER_VIP_HTTP_PREFIX_PATH; +import static org.apache.inlong.agent.constant.FetcherConstants.DEFAULT_AGENT_FETCHER_INTERVAL; +import static org.apache.inlong.agent.constant.FetcherConstants.DEFAULT_AGENT_MANAGER_REQUEST_TIMEOUT; +import static org.apache.inlong.agent.constant.FetcherConstants.DEFAULT_AGENT_MANAGER_VIP_HTTP_PREFIX_PATH; +import static org.apache.inlong.agent.constant.FetcherConstants.DEFAULT_INSTALLER_MANAGER_CONFIG_HTTP_PATH; +import static org.apache.inlong.agent.constant.FetcherConstants.INSTALLER_MANAGER_CONFIG_HTTP_PATH; +import static org.apache.inlong.agent.installer.ManagerResultFormatter.getResultData; +import static org.apache.inlong.agent.utils.AgentUtils.fetchLocalIp; +import static org.apache.inlong.agent.utils.AgentUtils.fetchLocalUuid; + +/** + * Fetch command from Inlong-Manager + */ +public class ManagerFetcher extends AbstractDaemon implements ProfileFetcher { + +public static final String MANAGER_ADDR = "manager.addr"; +public static final String MANAGER_AUTH_SECRET_ID = "manager.auth.secretId"; +public static final String MANAGER_AUTH_SECRET_KEY = "manager.auth.secretKey"; +public static final String CLUSTER_NAME = "cluster.name"; +public static final String CLUSTER_TAG = "cluster.tag"; Review Comment: Will use it next issue -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9831][Agent] Increase configuration acquisition capability [inlong]
justinwwhuang commented on code in PR #9832: URL: https://github.com/apache/inlong/pull/9832#discussion_r1527718035 ## inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java: ## @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.inlong.agent.installer; + +import org.apache.inlong.agent.common.AbstractDaemon; +import org.apache.inlong.agent.installer.conf.InstallerConfiguration; +import org.apache.inlong.agent.metrics.audit.AuditUtils; +import org.apache.inlong.agent.utils.AgentUtils; +import org.apache.inlong.agent.utils.ThreadUtils; +import org.apache.inlong.common.pojo.agent.installer.ConfigResult; +import org.apache.inlong.common.pojo.agent.installer.ModuleConfig; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; + +/** + * Installer Manager, the bridge for job manager, task manager, db e.t.c it manages agent level operations and + * communicates with outside system. + */ +public class ModuleManager extends AbstractDaemon { + +public static final int CONFIG_QUEUE_CAPACITY = 1; +public static final int CORE_THREAD_SLEEP_TIME = 1000; +private static final Logger LOGGER = LoggerFactory.getLogger(ModuleManager.class); +private final InstallerConfiguration conf; +private final BlockingQueue configQueue; + +private String curMd5; + +public ModuleManager() { +conf = InstallerConfiguration.getInstallerConf(); +configQueue = new LinkedBlockingQueue<>(CONFIG_QUEUE_CAPACITY); +} + +public void submitConfig(ConfigResult config) { +if (config == null) { +return; +} +configQueue.clear(); +for (int i = 0; i < config.getModuleList().size(); i++) { +LOGGER.info("submitModules index {} total {} {}", i, config.getModuleList().size(), +config.getModuleList().get(i)); +} +configQueue.add(config); +} + +/** + * thread for core thread. + * + * @return runnable profile. + */ +private Runnable coreThread() { +return () -> { +Thread.currentThread().setName("task-manager-core"); +while (isRunnable()) { +try { +AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME); +dealWithConfigQueue(configQueue); + AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "", +AgentUtils.getCurrentTime(), 1, 1); +} catch (Throwable ex) { +LOGGER.error("exception caught", ex); +ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex); +} +} +}; +} + +private void dealWithConfigQueue(BlockingQueue queue) { +ConfigResult config = queue.poll(); +if (config == null) { +return; +} +LOGGER.info("Deal with config {}", config); +if (curMd5.compareTo(config.getMd5()) == 0) { +LOGGER.info("md5 no change {}, skip update", curMd5); +return; +} +if (updateModules(config.getModuleList())) { +curMd5 = config.getMd5(); +} else { +LOGGER.error("Update modules failed!"); +} +} + +private boolean updateModules(List modules) { +return true; Review Comment: Will use it next issue -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9820][Dashboard][Manager] Update Pulsar source field for Ingestion [inlong]
dockerzhang commented on code in PR #9821: URL: https://github.com/apache/inlong/pull/9821#discussion_r1527731147 ## inlong-dashboard/src/ui/locales/cn.json: ## @@ -131,6 +131,11 @@ "meta.Sources.Iceberg.Warehouse": "仓库路径", "meta.Sources.Pulsar.PulsarTenant": "Pulsar 租户", "meta.Sources.Pulsar.Namespace": "命名空间", + "meta.Sources.Pulsar.Subscription": "Pulsar 订阅", + "meta.Sources.Pulsar.SubscriptionHelp": "若不指定则默认为:inlong-agent-{inlongStreamId}", + "meta.Sources.Pulsar.SubscriptionPosition": "订阅位点", + "meta.Sources.Pulsar.ResetTime": "重置消费时间", + "meta.Sources.Pulsar.ResetTimeHelp": "从当前时间开始消费,若不指定则从 pulsar 已提交的位点消费", Review Comment: ```suggestion "meta.Sources.Pulsar.ResetTimeHelp": "从指定时间开始消费", ``` ## inlong-dashboard/src/ui/locales/en.json: ## @@ -131,6 +131,11 @@ "meta.Sources.Iceberg.Warehouse": "Warehouse", "meta.Sources.Pulsar.PulsarTenant": "Pulsar tenant", "meta.Sources.Pulsar.Namespace": "Namespace", + "meta.Sources.Pulsar.Subscription": "Subscription", + "meta.Sources.Pulsar.SubscriptionHelp": "If not specified, the default is: inlong-agent-{inlongStreamId}", + "meta.Sources.Pulsar.SubscriptionPosition": "Subscription Position", + "meta.Sources.Pulsar.ResetTime": "Reset subscription time", + "meta.Sources.Pulsar.ResetTimeHelp": "Reset the subscription associated with this consumer to a specific message publish time.", Review Comment: ```suggestion "meta.Sources.Pulsar.ResetTimeHelp": "Reset the subscription time.", ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9820][Dashboard][Manager] Update Pulsar source field for Ingestion [inlong]
dockerzhang commented on code in PR #9821: URL: https://github.com/apache/inlong/pull/9821#discussion_r1527732908 ## inlong-dashboard/src/ui/locales/en.json: ## @@ -131,6 +131,11 @@ "meta.Sources.Iceberg.Warehouse": "Warehouse", "meta.Sources.Pulsar.PulsarTenant": "Pulsar tenant", "meta.Sources.Pulsar.Namespace": "Namespace", + "meta.Sources.Pulsar.Subscription": "Subscription", + "meta.Sources.Pulsar.SubscriptionHelp": "If not specified, the default is: inlong-agent-{inlongStreamId}", + "meta.Sources.Pulsar.SubscriptionPosition": "Subscription Position", + "meta.Sources.Pulsar.ResetTime": "Reset subscription time", + "meta.Sources.Pulsar.ResetTimeHelp": "Reset the subscription time.", Review Comment: ```suggestion "meta.Sources.Pulsar.ResetTimeHelp": "Reset the subscription time", ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9833][Agent] Add module state to distinguish whether the module has been downloaded or installed [inlong]
justinwwhuang commented on PR #9834: URL: https://github.com/apache/inlong/pull/9834#issuecomment-2002820390 > what does the module mean in the installer? Identify whether the current module is in a new, downloaded, or installed state -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9820][Dashboard][Manager] Update Pulsar source field for Ingestion [inlong]
leezng commented on code in PR #9821: URL: https://github.com/apache/inlong/pull/9821#discussion_r1527743054 ## inlong-dashboard/src/plugins/sources/common/SourceDefaultInfo.ts: ## @@ -146,10 +147,16 @@ export class SourceDefaultInfo implements DataWithBackend, RenderRow, RenderList readonly modifier: string; parse(data) { +if (data.resetTime !== undefined) { + data.resetTime = dayjs(data.resetTime).format('-MM-DD HH:mm:ss'); Review Comment: Is resetTime a parameter that all Source plugins have? If not, do not add it to default. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9820][Dashboard][Manager] Update Pulsar source field for Ingestion [inlong]
leezng commented on code in PR #9821: URL: https://github.com/apache/inlong/pull/9821#discussion_r1527743054 ## inlong-dashboard/src/plugins/sources/common/SourceDefaultInfo.ts: ## @@ -146,10 +147,16 @@ export class SourceDefaultInfo implements DataWithBackend, RenderRow, RenderList readonly modifier: string; parse(data) { +if (data.resetTime !== undefined) { + data.resetTime = dayjs(data.resetTime).format('-MM-DD HH:mm:ss'); Review Comment: Is resetTime a parameter that all Source plugins have? If not, do not add it to SourceDefault. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [INLONG-9833][Agent] Add module state to distinguish whether the module has been downloaded or installed [inlong]
dockerzhang merged PR #9834: URL: https://github.com/apache/inlong/pull/9834 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(inlong) branch master updated: [INLONG-9833][Agent] Add module state to distinguish whether the module has been downloaded or installed (#9834)
This is an automated email from the ASF dual-hosted git repository. dockerzhang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/inlong.git The following commit(s) were added to refs/heads/master by this push: new fd95e72ba5 [INLONG-9833][Agent] Add module state to distinguish whether the module has been downloaded or installed (#9834) fd95e72ba5 is described below commit fd95e72ba5b805a803f32aace9d865196893d5f1 Author: justinwwhuang AuthorDate: Mon Mar 18 12:39:08 2024 +0800 [INLONG-9833][Agent] Add module state to distinguish whether the module has been downloaded or installed (#9834) --- .../common/pojo/agent/installer/ModuleConfig.java | 6 +++ .../pojo/agent/installer/ModuleStateEnum.java | 51 ++ 2 files changed, 57 insertions(+) diff --git a/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/installer/ModuleConfig.java b/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/installer/ModuleConfig.java index 2388cb3825..7e44498bbe 100644 --- a/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/installer/ModuleConfig.java +++ b/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/installer/ModuleConfig.java @@ -58,5 +58,11 @@ public class ModuleConfig { * The command to uninstall the module */ private String uninstallCommand; + private PackageConfig packageConfig; + +/** + * The state of the module + */ +private ModuleStateEnum state; } \ No newline at end of file diff --git a/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/installer/ModuleStateEnum.java b/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/installer/ModuleStateEnum.java new file mode 100644 index 00..7f33ea7b53 --- /dev/null +++ b/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/installer/ModuleStateEnum.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.inlong.common.pojo.agent.installer; + +/** + * Enum of module state. + */ +public enum ModuleStateEnum { + +NEW(0), +DOWNLOADED(1), +INSTALLED(2); + +private final int state; + +ModuleStateEnum(int state) { +this.state = state; +} + +public static ModuleStateEnum getTaskState(int state) { +switch (state) { +case 0: +return NEW; +case 1: +return DOWNLOADED; +case 2: +return INSTALLED; +default: +throw new RuntimeException("Unsupported module state " + state); +} +} + +public int getType() { +return state; +} +}
Re: [PR] [INLONG-9831][Agent] Increase configuration acquisition capability [inlong]
dockerzhang merged PR #9832: URL: https://github.com/apache/inlong/pull/9832 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(inlong) branch master updated (fd95e72ba5 -> 23bbce2de1)
This is an automated email from the ASF dual-hosted git repository. dockerzhang pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/inlong.git from fd95e72ba5 [INLONG-9833][Agent] Add module state to distinguish whether the module has been downloaded or installed (#9834) add 23bbce2de1 [INLONG-9831][Agent] Increase configuration acquisition capability (#9832) No new revisions were added by this update. Summary of changes: .../inlong/agent/constant/FetcherConstants.java| 3 + .../org/apache/inlong/agent/utils/HttpManager.java | 26 ++- .../apache/inlong/agent/core/HeartbeatManager.java | 4 +- .../org/apache/inlong/agent/installer/Manager.java | 33 ++- .../inlong/agent/installer/ManagerFetcher.java | 223 + .../agent/installer}/ManagerResultFormatter.java | 28 +-- .../inlong/agent/installer/ModuleManager.java | 129 .../agent/plugin/fetcher/ManagerFetcher.java | 24 +-- .../common/pojo/agent/installer/ModuleConfig.java | 4 + 9 files changed, 405 insertions(+), 69 deletions(-) create mode 100644 inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ManagerFetcher.java copy inlong-agent/{agent-plugins/src/main/java/org/apache/inlong/agent/plugin/fetcher => agent-installer/src/main/java/org/apache/inlong/agent/installer}/ManagerResultFormatter.java (67%) create mode 100755 inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java
Re: [PR] [INLONG-9829][Agent] Add guardian scripts [inlong]
dockerzhang merged PR #9830: URL: https://github.com/apache/inlong/pull/9830 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(inlong) branch master updated: [INLONG-9829][Agent] Add guardian scripts (#9830)
This is an automated email from the ASF dual-hosted git repository. dockerzhang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/inlong.git The following commit(s) were added to refs/heads/master by this push: new 8e5dd5003e [INLONG-9829][Agent] Add guardian scripts (#9830) 8e5dd5003e is described below commit 8e5dd5003ee7c6ba70ada7265cc2fdd192866396 Author: justinwwhuang AuthorDate: Mon Mar 18 14:05:22 2024 +0800 [INLONG-9829][Agent] Add guardian scripts (#9830) Co-authored-by: Charles Zhang --- inlong-agent/agent-installer/assembly.xml | 7 +- inlong-agent/agent-installer/bin/installer-env.sh | 60 +++ inlong-agent/agent-installer/bin/installer.sh | 125 ++ inlong-agent/agent-installer/pom.xml | 4 +- 4 files changed, 189 insertions(+), 7 deletions(-) diff --git a/inlong-agent/agent-installer/assembly.xml b/inlong-agent/agent-installer/assembly.xml index ad8b0cef4f..f95a452d09 100644 --- a/inlong-agent/agent-installer/assembly.xml +++ b/inlong-agent/agent-installer/assembly.xml @@ -30,13 +30,10 @@ -../bin +bin *.* - -*rock* - 0755 bin unix @@ -55,7 +52,7 @@ -false +true true lib diff --git a/inlong-agent/agent-installer/bin/installer-env.sh b/inlong-agent/agent-installer/bin/installer-env.sh new file mode 100755 index 00..bf7b0c6ccf --- /dev/null +++ b/inlong-agent/agent-installer/bin/installer-env.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +#http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# project base directory +BASE_DIR=$(cd "$(dirname "$0")"/../;pwd) + +export LOG_DIR="$BASE_DIR/logs" +mkdir -p $LOG_DIR +AS_USER=`whoami` +chown -R $AS_USER $LOG_DIR + +# find java home +if [ -z "$JAVA_HOME" ]; then + export JAVA=$(which java) + export JPS=$(which jps) +else + export JAVA="$JAVA_HOME/bin/java" + export JPS="$JAVA_HOME/bin/jps" +fi + +if [ -z "$AGENT_JVM_HEAP_OPTS" ]; then + HEAP_OPTS="-Xmx512m -Xss256m" +else + HEAP_OPTS="$AGENT_JVM_HEAP_OPTS" +fi +GC_OPTS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:InitiatingHeapOccupancyPercent=60 -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8" +LOG_OPTS="-Xloggc:$BASE_DIR/logs/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=20M" +if [ -n "$NEED_TRACK_NATIVE_MEMORY" ] && [ "$NEED_TRACK_NATIVE_MEMORY" = "true" ]; then +GC_OPTS="$GC_OPTS -XX:NativeMemoryTracking" +fi +INSTALLER_JVM_ARGS="$HEAP_OPTS $GC_OPTS $LOG_OPTS" + +# Add installer Rmi args when necessary +INSTALLER_RMI_ARGS="-Dcom.sun.management.jmxremote \ +-Dcom.sun.management.jmxremote.port=18080 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" +CONFIG_DIR=${BASE_DIR}"/conf/" +JAR_LIBS=${BASE_DIR}"/lib/*" +CLASSPATH=${CONFIG_DIR}:${JAR_LIBS} + +JMX_ENABLED=$(grep -c "agent.domainListeners=org.apache.inlong.agent.metrics.AgentJmxMetricListener" $BASE_DIR/conf/installer.properties) +if [[ $JMX_ENABLED == 1 ]]; then + export INSTALLER_ARGS="$INSTALLER_JVM_ARGS $INSTALLER_RMI_ARGS -cp $CLASSPATH -Dagent.home=$BASE_DIR" +else + export INSTALLER_ARGS="$INSTALLER_JVM_ARGS -cp $CLASSPATH -Dagent.home=$BASE_DIR" +fi diff --git a/inlong-agent/agent-installer/bin/installer.sh b/inlong-agent/agent-installer/bin/installer.sh new file mode 100755 index 00..f382e29da8 --- /dev/null +++ b/inlong-agent/agent-installer/bin/installer.sh @@ -0,0 +1,125 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +#http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law o