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 decc565e4 [INLONG-6266][Manager][DataProxy] Change the heartbeat 
configuration (#6267)
decc565e4 is described below

commit decc565e407a27b8477251b710a00eaae730f6a2
Author: ganfengtan <[email protected]>
AuthorDate: Mon Oct 24 12:50:42 2022 +0800

    [INLONG-6266][Manager][DataProxy] Change the heartbeat configuration (#6267)
---
 bin/init-config.sh                                                  | 1 +
 docker/docker-compose/docker-compose.yml                            | 1 +
 inlong-dataproxy/conf/dataproxy-pulsar.conf                         | 6 ++++--
 inlong-dataproxy/conf/dataproxy-tube.conf                           | 6 ++++--
 inlong-dataproxy/dataproxy-docker/dataproxy-docker.sh               | 3 ++-
 .../inlong/manager/service/core/heartbeat/HeartbeatManager.java     | 2 ++
 6 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/bin/init-config.sh b/bin/init-config.sh
index 5b399ebf5..b7c9d31a2 100644
--- a/bin/init-config.sh
+++ b/bin/init-config.sh
@@ -55,6 +55,7 @@ init_inlong_dataproxy() {
   cd $INLONG_HOME/inlong-dataproxy/conf
   sed -i 
's/manager.hosts=.*/'''manager.hosts=${manager_server_hostname}:${manager_server_port}'''/g'
 common.properties
   sed -i 
's/audit.proxys=.*/'''audit.proxys=${audit_proxys_ip}:${audit_proxys_port}'''/g'
 common.properties
+  sed -i 's/localhost.*/'''${local_ip}'''/g' dataproxy-${mq_type}.conf
 }
 
 init_inlong_manager() {
diff --git a/docker/docker-compose/docker-compose.yml 
b/docker/docker-compose/docker-compose.yml
index 6124afcbb..4401d6cba 100644
--- a/docker/docker-compose/docker-compose.yml
+++ b/docker/docker-compose/docker-compose.yml
@@ -76,6 +76,7 @@ services:
       - manager
     ports:
       - "46801:46801"
+      - "46802:46802"
     environment:
       - MANAGER_OPENAPI_IP=manager
       - MANAGER_OPENAPI_PORT=8083
diff --git a/inlong-dataproxy/conf/dataproxy-pulsar.conf 
b/inlong-dataproxy/conf/dataproxy-pulsar.conf
index 054b3068d..7cd457392 100644
--- a/inlong-dataproxy/conf/dataproxy-pulsar.conf
+++ b/inlong-dataproxy/conf/dataproxy-pulsar.conf
@@ -39,7 +39,8 @@ agent1.sinks = pulsar-sink-msg1 pulsar-sink-msg2 
pulsar-sink-msg3 pulsar-sink-ms
 agent1.sources.tcp-source.channels = ch-msg1 ch-msg2 ch-msg3 ch-msg5 ch-msg6
 agent1.sources.tcp-source.type = 
org.apache.inlong.dataproxy.source.SimpleTcpSource
 agent1.sources.tcp-source.msg-factory-name = 
org.apache.inlong.dataproxy.source.ServerMessageFactory
-agent1.sources.tcp-source.host = 0.0.0.0
+# replace it with the ip you specified
+agent1.sources.tcp-source.host = localhost
 agent1.sources.tcp-source.port = 46801
 agent1.sources.tcp-source.max-msg-length = 524288
 # agent1.sources.tcp-source.topic = 
persistent://public/default/dataproxy-default-topic
@@ -62,7 +63,8 @@ agent1.sources.tcp-source.set = 10
 agent1.sources.http-source.channels = ch-msg1 ch-msg2 ch-msg5 ch-msg6
 agent1.sources.http-source.type = 
org.apache.inlong.dataproxy.http.SimpleHttpSource
 agent1.sources.http-source.message-handler-name = 
org.apache.inlong.dataproxy.http.SimpleMessageHandler
-agent1.sources.http-source.host = 0.0.0.0
+# replace it with the ip you specified
+agent1.sources.http-source.host = localhost
 agent1.sources.http-source.port = 46802
 agent1.sources.http-source.max-msg-length = 524288
 #agent1.sources.http-source.topic = 
persistent://public/default/dataproxy-default-topic
diff --git a/inlong-dataproxy/conf/dataproxy-tube.conf 
b/inlong-dataproxy/conf/dataproxy-tube.conf
index 7c281c06f..f9b5e83d3 100644
--- a/inlong-dataproxy/conf/dataproxy-tube.conf
+++ b/inlong-dataproxy/conf/dataproxy-tube.conf
@@ -26,7 +26,8 @@ agent1.sources.tcp-source.channels = ch-msg1 ch-msg2 ch-msg3 
ch-msg5 ch-msg6 ch-
 agent1.sources.tcp-source.type = 
org.apache.inlong.dataproxy.source.SimpleTcpSource
 agent1.sources.tcp-source.msg-factory-name = 
org.apache.inlong.dataproxy.source.ServerMessageFactory
 agent1.sources.tcp-source.message-handler-name = 
org.apache.inlong.dataproxy.source.ServerMessageHandler
-agent1.sources.tcp-source.host = 0.0.0.0
+# replace it with the ip you specified
+agent1.sources.tcp-source.host = localhost
 agent1.sources.tcp-source.port = 46801
 agent1.sources.tcp-source.highWaterMark=2621440
 agent1.sources.tcp-source.enableExceptionReturn=true
@@ -55,7 +56,8 @@ agent1.sources.tcp-source.metric_topic_prefix=manager_tmertic
 agent1.sources.http-source.channels = ch-msg1 ch-msg2 ch-msg3 ch-msg5 ch-msg6 
ch-msg7 ch-msg8 ch-msg9 ch-msg10 ch-back
 agent1.sources.http-source.type = 
org.apache.inlong.dataproxy.http.SimpleHttpSource
 agent1.sources.http-source.message-handler-name = 
org.apache.inlong.dataproxy.http.SimpleMessageHandler
-agent1.sources.http-source.host = 0.0.0.0
+# replace it with the ip you specified
+agent1.sources.http-source.host = localhost
 agent1.sources.http-source.port = 46802
 agent1.sources.http-source.max-msg-length = 524288
 #agent1.sources.http-source.topic = 
persistent://public/default/dataproxy-default-topic
diff --git a/inlong-dataproxy/dataproxy-docker/dataproxy-docker.sh 
b/inlong-dataproxy/dataproxy-docker/dataproxy-docker.sh
index 8ccb3bfc0..ae6bae408 100644
--- a/inlong-dataproxy/dataproxy-docker/dataproxy-docker.sh
+++ b/inlong-dataproxy/dataproxy-docker/dataproxy-docker.sh
@@ -21,11 +21,12 @@ local_ip=$(ifconfig | grep inet | grep -v inet6 | grep -v 
"127.0.0.1" | awk '{pr
 # config
 cd "${file_path}/"
 common_conf_file=./conf/common.properties
+mq_conf_file=./conf/dataproxy-${MQ_TYPE}.conf
 
 sed -i 
"s/manager.hosts=.*$/manager.hosts=${MANAGER_OPENAPI_IP}:${MANAGER_OPENAPI_PORT}/g"
 "${common_conf_file}"
 sed -i "s/audit.enable=.*$/audit.enable=${AUDIT_ENABLE}/g" 
"${common_conf_file}"
 sed -i "s/audit.proxys=.*$/audit.proxys=${AUDIT_PROXY_URL}/g" 
"${common_conf_file}"
-sed -i "s/proxy.report.ip=.*$/proxy.report.ip=${local_ip}/g" 
"${common_conf_file}"
+sed -i "s/localhost.*$/${local_ip}/g" "${mq_conf_file}"
 sed -i "s/proxy.cluster.tag=.*$/proxy.cluster.tag=${CLUSTER_TAG}/g" 
"${common_conf_file}"
 sed -i "s/proxy.cluster.name=.*$/proxy.cluster.name=${CLUSTER_NAME}/g" 
"${common_conf_file}"
 sed -i 
"s/proxy.cluster.inCharges=.*$/proxy.cluster.inCharges=${CLUSTER_IN_CHARGES}/g" 
"${common_conf_file}"
diff --git 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/heartbeat/HeartbeatManager.java
 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/heartbeat/HeartbeatManager.java
index f11970c86..db2f08ba5 100644
--- 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/heartbeat/HeartbeatManager.java
+++ 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/heartbeat/HeartbeatManager.java
@@ -103,6 +103,7 @@ public class HeartbeatManager implements 
AbstractHeartbeatManager {
 
         // protocolType may be null, and the protocolTypes' length may be less 
than ports' length
         String[] ports = heartbeat.getPort().split(InlongConstants.COMMA);
+        String[] ips = heartbeat.getIp().split(InlongConstants.COMMA);
         String protocolType = heartbeat.getProtocolType();
         String[] protocolTypes = null;
         if (StringUtils.isNotBlank(protocolType) && ports.length > 1) {
@@ -118,6 +119,7 @@ public class HeartbeatManager implements 
AbstractHeartbeatManager {
             HeartbeatMsg heartbeatMsg = 
JsonUtils.parseObject(JsonUtils.toJsonByte(heartbeat), HeartbeatMsg.class);
             assert heartbeatMsg != null;
             heartbeatMsg.setPort(ports[i].trim());
+            heartbeatMsg.setIp(ips[i].trim());
             if (protocolTypes != null) {
                 heartbeatMsg.setProtocolType(protocolTypes[i]);
             } else {

Reply via email to