You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/01/24 10:23:53 UTC

[GitHub] [incubator-inlong] crancchen opened a new pull request #2323: add standalone deployment shell

crancchen opened a new pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323


   add standalone deployment  shell
   
   
   ### Title Name: [INLONG-XYZ][component] Title of the pull request
   
   where *XYZ* should be replaced by the actual issue number.
   
   Fixes #2301
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve.*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   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 followup 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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] crancchen removed a comment on pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
crancchen removed a comment on pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#issuecomment-1020907978


   add  standalone  deployment shell


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] kipshi commented on a change in pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
kipshi commented on a change in pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#discussion_r791409578



##########
File path: bin/inlong-daemon.sh
##########
@@ -0,0 +1,287 @@
+#!/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.
+#
+
+#start-up Tubemq
+startTubeMqFun(){
+    tubemqMaster_webPort=8080
+    TUBE_MASTER_PORT=8715
+    TUBE_MASTER_TOKEN=abc
+    tubemqDBNAME="tubemanager"      #tubemq manager database
+    basePath=$(cd `dirname $0`; cd ..; pwd)
+    source $basePath/conf/standalone.conf
+    TUBE_MASTER_IP=$tubemqMaster_hostName
+    cd $basePath/inlong-tubemq-server/bin
+    chmod 755 *.sh
+    echo "start-up tubemq master ..."
+    ./tubemq.sh master start 
+    sleep 10
+    # add broker
+    curl -d 'type=op_modify&method=admin_add_broker_configure&brokerId=1&brokerIp='"$tubemqBroker_hostName"'&createUser=docker&brokerPort=8123&deletePolicy=delete,168h&numPartitions=3&unflushThreshold=1000&acceptPublish=true&acceptSubscribe=true&unflushInterval=10000&confModAuthToken=abc' http://$tubemqMaster_hostName:$tubemqMaster_webPort/webapi.htm
+    # online
+    curl -d 'type=op_modify&method=admin_online_broker_configure&brokerId=1&modifyUser=docker&confModAuthToken=abc' http://$tubemqMaster_hostName:$tubemqMaster_webPort/webapi.htm
+    # broker start
+    echo "start-up tubemq broker ..."
+    ./tubemq.sh broker start
+    #manager start
+    echo "start-up tubemq manager ..."
+    cd $basePath/inlong-tubemq-manager/bin                          
+    #create tubemanager database
+    create_db_sql="create database IF NOT EXISTS ${tubemqDBNAME}"
+    mysql -h${spring_datasource_hostname}  -P${spring_datasource_port}  -u${spring_datasource_username} -p${spring_datasource_password} -e "${create_db_sql}"
+    ./start-manager.sh
+    sleep 10
+    #first init
+    flag=$(cat init-tube-cluster.sh | grep "flag=1") 
+    if [ ! -n "$flag"  ] ;then
+        echo  "init shell config"  
+        sed -i 's/TUBE_MANAGER_IP=.*/'''TUBE_MANAGER_IP=${TUBE_MANAGER_IP}'''/g' init-tube-cluster.sh 
+    	  sed -i 's/TUBE_MANAGER_PORT=.*/'''TUBE_MANAGER_PORT=${TUBE_MANAGER_PORT}'''/g' init-tube-cluster.sh 
+    	  sed -i 's/TUBE_MASTER_IP=.*/'''TUBE_MASTER_IP=${TUBE_MASTER_IP}'''/g' init-tube-cluster.sh 
+    	  sed -i 's/TUBE_MASTER_PORT=.*/'''TUBE_MASTER_PORT=${TUBE_MASTER_PORT}'''/g' init-tube-cluster.sh 
+    	  sed -i 's/TUBE_MASTER_WEB_PORT=.*/'''TUBE_MASTER_WEB_PORT=${tubemqMaster_webPort}'''/g' init-tube-cluster.sh 
+    	  sed -i 's/TUBE_MASTER_TOKEN=.*/'''TUBE_MASTER_TOKEN=${TUBE_MASTER_TOKEN}'''/g' init-tube-cluster.sh 
+          echo  "init tubemq cluster"
+    	  ./init-tube-cluster.sh 
+    	  echo -e "\nflag=1" >> init-tube-cluster.sh
+      else
+    	  echo "tubemq cluster initialized,skip"
+    fi   
+}  
+
+#start inlong
+startInlong(){
+    #default zk root path
+    cluster_zk_root=inlong_hive
+    #default sort_appName
+    sort_appName=inlong_app
+    
+    basePath=$(cd `dirname $0`; cd ..; pwd)
+    source $basePath/conf/standalone.conf
+    
+    inlongDBNAME="apache_inlong_manager"  # inlong manager Metabase name  
+    
+    echo "Judge the choice of message middleware tubemq or pulsar"
+    if [ $source_type == "pulsar" ];then
+    #Judge whether the pulsar cluster is started in the current system
+       pulsar_thread=$($JAVA_HOME/bin/jps |grep PulsarBrokerStarter)
+       if [ ! -n "$pulsar_thread" ]; then 
+          echo "The system does not start the pulsar. Please start the pulsar manually first" 
+    	  exit 1
+       else
+    	  echo "The current system starts the pulsar, which is used to complete message delivery and storage"
+       fi
+    else
+       startTubeMqFun
+	   echo  "Judge whether the  TubeMQ cluster is started in the current system"
+       tubemq_manager_thread=$($JAVA_HOME/bin/jps |grep TubeMQManager)
+       tubemq_broker_thread=$($JAVA_HOME/bin/jps |grep BrokerStartup)
+       tubemq_master_thread=$($JAVA_HOME/bin/jps |grep MasterStartup)
+       if [[ ! -n "$tubemq_manager_thread" && ! -n "$tubemq_broker_thread" && ! -n "$tubemq_master_thread" ]]; then 
+          echo "The system does not start tubemq or starts abnormally. Please start tubemq normally first" 
+    	  exit 1
+       else
+    	  echo "The current system starts tubemq, which is used to complete message delivery and storage"
+       fi
+    fi   
+    
+    echo "2.start-up inlong manager"	
+    cd $basePath/inlong-manager-web
+    #Whether the database table exists. If it does not exist, initialize the database and skip if it exists.
+    select_db_sql="SELECT COUNT(*) FROM information_schema.TABLES WHERE table_schema = '${inlongDBNAME}'"
+    inlong_manager_count=$(mysql -h${spring_datasource_hostname}  -P${spring_datasource_port}  -u${spring_datasource_username} -p${spring_datasource_password} -e "${select_db_sql}")
+    inlong_num=$(echo $inlong_manager_count | tr -cd "[0-9]")
+    if [ $inlong_num -eq 0 ] ;then
+       echo  "init apache_inlong_manager database"  
+       mysql -h${spring_datasource_hostname}  -P${spring_datasource_port}  -u${spring_datasource_username} -p${spring_datasource_password} < sql/apache_inlong_manager.sql
+     else
+       echo "apache_inlong_manager database initialized,skip"
+    fi   
+    cd $basePath/inlong-manager-web/bin
+    ./startup.sh
+    
+    echo "3.start-up inlong web"
+    if [[ "$manager_server_hostname" = "localhost" || "$manager_server_hostname" = "127.0.0.1" ]];then
+          manager_server_hostname=$local_ip
+    fi
+    echo $manager_server_hostname
+    docker stop website
+    docker rm website
+    docker pull inlong/website:latest
+    docker run -d --name website -e MANAGER_API_ADDRESS=$manager_server_hostname:$manager_server_port -p $inlong_web_port:$docker_inlong_web_port inlong/website
+    
+    
+    echo "4.start-up inlong dataproxy"
+    cd $basePath/inlong-dataproxy/bin
+    chmod 755 *.sh
+    ./prepare_env.sh
+    ./dataproxy-start.sh
+    select_db_sql="SELECT COUNT(*) FROM  ${inlongDBNAME}.data_proxy_cluster where address='localhost'"
+    cluster_count=$(mysql -h${spring_datasource_hostname}  -P${spring_datasource_port}  -u${spring_datasource_username} -p${spring_datasource_password} -e "${select_db_sql}")
+    cluster_num=$(echo $cluster_count | tr -cd "[0-9]")
+    #Insert the cluster information if it does not exist, and skip if it exists
+    if [ $cluster_num -eq 0 ] ;then
+       echo  "Insert cluster information into data_ proxy_ cluster table"  
+       insert_db_sql="insert into ${inlongDBNAME}.data_proxy_cluster (name, address, port, status, is_deleted, creator, create_time, modify_time)
+       values ('dataproxy', 'localhost',46801, 0, 0, 'admin', now(), now());"
+       mysql -h${spring_datasource_hostname}  -P${spring_datasource_port}  -u${spring_datasource_username} -p${spring_datasource_password} -e "${insert_db_sql}"
+    else
+       echo "cluster information already exists, skip"
+    fi   
+    
+    echo "5.start-up inlong agent"
+    cd $basePath/inlong-agent/bin
+    ./agent.sh start
+    
+    
+    echo "6.start-up inlong sort"
+    #Judge whether the system has started Fink cluster
+       flink_thread=$($JAVA_HOME/bin/jps |grep TaskManagerRunner)
+       if [ ! -n "$flink_thread" ]; then 
+          echo "The system does not start Flink. Please start Flink manually first" 
+    	  exit 1
+       else
+    	  echo "Currently, the system starts Flink, which is used to process sort tasks"
+       fi
+    #This file is mainly used to find the Flink bin directory
+    flagfile=`find / -name find-flink-home.sh`
+    flink_bin=$(dirname $flagfile)
+    cd $basePath
+    $flink_bin/flink run -c org.apache.inlong.sort.flink.Entrance inlong-sort/sort-core*.jar \
+    --cluster-id $sort_appName --zookeeper.quorum $zkServerAddr --zookeeper.path.root $cluster_zk_root \
+    --source.type $source_type --sink.type $sink_type &
+}
+
+#stop inlong
+stopInlong(){
+    echo "1.stop agent ... "
+    agent_thread=$($JAVA_HOME/bin/jps |grep AgentMain)
+    if [ ! -n "$agent_thread" ]; then 
+       echo "The system did not running agent" 
+    else
+       agent_pid=$(echo $agent_thread | tr -cd "[0-9]")
+       kill -9 $agent_pid
+     echo "agent stopped "
+    fi
+    
+    echo "2.stop inlong_manager ... "
+    inlong_manager_thread=$($JAVA_HOME/bin/jps |grep InLongWebApplication)
+    if [ ! -n "$inlong_manager_thread" ]; then 
+       echo "The system did not running inlong manager" 
+    else
+       inlong_manager_pid=$(echo $inlong_manager_thread | tr -cd "[0-9]")
+       kill -9 $inlong_manager_pid
+       echo "inlong_manager stopped "
+    fi
+    
+    echo "3.stop dataproxy ... "
+    dataproxy_thread=$($JAVA_HOME/bin/jps |grep Application)
+    if [ ! -n "$dataproxy_thread" ]; then 
+       echo "The system did not running  dataproxy" 
+    else
+       dataproxy_pid=$(echo $dataproxy_thread | tr -cd "[0-9]")
+       kill -9 $dataproxy_pid
+       echo "dataproxy stopped "
+    fi
+    
+    echo "4.stop tubemq_manager ... "
+    tubemq_manager_thread=$($JAVA_HOME/bin/jps |grep TubeMQManager)
+    if [ ! -n "$tubemq_manager_thread" ]; then 
+       echo "The system did not running tubemq_manager" 
+    else
+       tubemq_manager_pid=$(echo $tubemq_manager_thread | tr -cd "[0-9]")
+       kill -9 $tubemq_manager_pid
+       echo "tubemq_manager stopped "
+    fi
+    
+    echo "5.stop tubemq_broker ... "
+    tubemq_broker_thread=$($JAVA_HOME/bin/jps |grep BrokerStartup)
+    if [ ! -n "$tubemq_broker_thread" ]; then 
+       echo "The system did not running  tubemq_broker" 
+    else
+       tubemq_broker_pid=$(echo $tubemq_broker_thread | tr -cd "[0-9]")
+       kill -9 $tubemq_broker_pid
+       echo "tubemq_broker stopped "
+    fi
+    
+    echo "6.stop tubemq_master... "
+    tubemq_master_thread=$($JAVA_HOME/bin/jps |grep MasterStartup)
+    if [ ! -n "$tubemq_master_thread" ]; then 
+       echo "The system did not running tubemq_master" 
+    else
+       tubemq_master_pid=$(echo $tubemq_master_thread | tr -cd "[0-9]")
+       kill -9 $tubemq_master_pid
+       echo "tubemq_master stopped "
+    fi
+    
+    echo "7.stop CliFrontend... "
+    cli_frontend_thread=$($JAVA_HOME/bin/jps |grep CliFrontend)
+    if [ ! -n "$cli_frontend_thread" ]; then 
+       echo "The system did not running cli_frontend" 
+    else
+       cli_frontend_pid=$(echo $cli_frontend_thread | tr -cd "[0-9]")
+       kill -9 $cli_frontend_pid
+       echo "cli_frontend stopped "
+    fi
+	
+	echo "8.stop sort flink job"

Review comment:
       format code




-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] dockerzhang merged pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
dockerzhang merged pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323


   


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] codecov-commenter commented on pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#issuecomment-1020853810


   # [Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2323](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a9acf20) into [master](https://codecov.io/gh/apache/incubator-inlong/commit/256ebf94057467356c4204b1ff6b367af41f6435?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (256ebf9) will **increase** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-inlong/pull/2323/graphs/tree.svg?width=650&height=150&src=pr&token=1EUK92O9K2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2323      +/-   ##
   ============================================
   + Coverage     12.53%   12.54%   +0.01%     
   - Complexity     1215     1217       +2     
   ============================================
     Files           420      420              
     Lines         36240    36240              
     Branches       5670     5670              
   ============================================
   + Hits           4541     4545       +4     
   + Misses        30893    30886       -7     
   - Partials        806      809       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../producer/qltystats/DefaultBrokerRcvQltyStats.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pbmxvbmcvdHViZW1xL2NsaWVudC9wcm9kdWNlci9xbHR5c3RhdHMvRGVmYXVsdEJyb2tlclJjdlFsdHlTdGF0cy5qYXZh) | `45.31% <0.00%> (-0.40%)` | :arrow_down: |
   | [...ong/tubemq/manager/service/ClusterServiceImpl.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtbWFuYWdlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW5sb25nL3R1YmVtcS9tYW5hZ2VyL3NlcnZpY2UvQ2x1c3RlclNlcnZpY2VJbXBsLmphdmE=) | `52.94% <0.00%> (+2.94%)` | :arrow_up: |
   | [...inlong/tubemq/manager/service/TaskServiceImpl.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtbWFuYWdlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW5sb25nL3R1YmVtcS9tYW5hZ2VyL3NlcnZpY2UvVGFza1NlcnZpY2VJbXBsLmphdmE=) | `8.53% <0.00%> (+4.87%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [256ebf9...a9acf20](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] luchunliang commented on a change in pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
luchunliang commented on a change in pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#discussion_r790749137



##########
File path: initInlongConfig.sh
##########
@@ -0,0 +1,132 @@
+#!/bin/bash
+#初始化inlong 各组件的配置文件
+#当前项目的根路径
+
+#tubemqMaster默认端口
+tubemqMaster_port=8715
+#tubemq brokerId
+brokerId=0
+#inlong  manager 默认环境
+spring_profiles_active=dev
+#默认zk
+zkServerAddr=localhost:2181
+
+basePath=$(cd `dirname $0`; pwd)
+echo $basePath
+source $basePath/inlongConfig.properties
+
+echo  "1.替换agent配置参数"
+cd $basePath/inlong-agent/conf
+sed -i 's/agent.http.enable=.*/'''agent.http.enable=${agent_http_enable}'''/g' agent.properties
+sed -i 's/agent.local.ip=.*/'''agent.local.ip=${agent_local_ip}'''/g' agent.properties  
+sed -i 's/agent.manager.vip.http.host=.*/'''agent.manager.vip.http.host=${manager_server_hostname}'''/g' agent.properties 
+sed -i 's/agent.manager.vip.http.port=.*/'''agent.manager.vip.http.port=${manager_server_port}'''/g' agent.properties 
+
+echo "2.替换dataproxy配置参数"

Review comment:
       ditto

##########
File path: initInlongConfig.sh
##########
@@ -0,0 +1,132 @@
+#!/bin/bash
+#初始化inlong 各组件的配置文件

Review comment:
       Please change to English.

##########
File path: stopInlongCluster.sh
##########
@@ -0,0 +1,71 @@
+#!/bin/bash
+##一键stop启动脚本
+echo "1.stop agent ... "
+agent_thread=$($JAVA_HOME/bin/jps |grep AgentMain)
+if [ ! -n "$agent_thread" ]; then 
+   echo "系统没启动agent" 
+else
+   agent_pid=$(echo $agent_thread | tr -cd "[0-9]")
+   kill -9 $agent_pid
+ echo "agent stopped "
+fi
+
+echo "2.stop inlong_manager ... "
+inlong_manager_thread=$($JAVA_HOME/bin/jps |grep InLongWebApplication)
+if [ ! -n "$inlong_manager_thread" ]; then 
+   echo "系统没启动inlong manager" 
+else
+   inlong_manager_pid=$(echo $inlong_manager_thread | tr -cd "[0-9]")
+   kill -9 $inlong_manager_pid
+   echo "inlong_manager stopped "
+fi
+
+echo "3.stop dataproxy ... "
+dataproxy_thread=$($JAVA_HOME/bin/jps |grep Application)
+if [ ! -n "$dataproxy_thread" ]; then 
+   echo "系统没启动dataproxy" 
+else
+   dataproxy_pid=$(echo $dataproxy_thread | tr -cd "[0-9]")
+   kill -9 $dataproxy_pid
+ echo "dataproxy stopped "
+fi
+
+echo "4.stop tubemq_manager ... "
+tubemq_manager_thread=$($JAVA_HOME/bin/jps |grep TubeMQManager)
+if [ ! -n "$tubemq_manager_thread" ]; then 
+   echo "系统没启动tubemq_manager" 
+else
+   tubemq_manager_pid=$(echo $tubemq_manager_thread | tr -cd "[0-9]")
+   kill -9 $tubemq_manager_pid
+ echo "tubemq_manager stopped "
+fi
+
+echo "5.stop tubemq_broker ... "
+tubemq_broker_thread=$($JAVA_HOME/bin/jps |grep BrokerStartup)
+if [ ! -n "$tubemq_broker_thread" ]; then 
+   echo "系统没启动tubemq_broker" 
+else
+   tubemq_broker_pid=$(echo $tubemq_broker_thread | tr -cd "[0-9]")
+   kill -9 $tubemq_broker_pid
+ echo "tubemq_broker stopped "
+fi
+
+echo "6.stop tubemq_master... "
+tubemq_master_thread=$($JAVA_HOME/bin/jps |grep MasterStartup)
+if [ ! -n "$tubemq_master_thread" ]; then 
+   echo "系统没启动tubemq_master" 
+else
+   tubemq_master_pid=$(echo $tubemq_master_thread | tr -cd "[0-9]")
+   kill -9 $tubemq_master_pid
+ echo "tubemq_master stopped "
+fi
+
+echo "7.stop CliFrontend... "
+cli_frontend_thread=$($JAVA_HOME/bin/jps |grep CliFrontend)
+if [ ! -n "$cli_frontend_thread" ]; then 
+   echo "系统没启动cli_frontend" 

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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] crancchen removed a comment on pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
crancchen removed a comment on pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#issuecomment-1020907978


   add  standalone  deployment shell


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] crancchen commented on pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
crancchen commented on pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#issuecomment-1020907978


   add  standalone  deployment shell


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] codecov-commenter commented on pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#issuecomment-1020853810


   # [Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2323](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a9acf20) into [master](https://codecov.io/gh/apache/incubator-inlong/commit/256ebf94057467356c4204b1ff6b367af41f6435?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (256ebf9) will **increase** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-inlong/pull/2323/graphs/tree.svg?width=650&height=150&src=pr&token=1EUK92O9K2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2323      +/-   ##
   ============================================
   + Coverage     12.53%   12.54%   +0.01%     
   - Complexity     1215     1217       +2     
   ============================================
     Files           420      420              
     Lines         36240    36240              
     Branches       5670     5670              
   ============================================
   + Hits           4541     4545       +4     
   + Misses        30893    30886       -7     
   - Partials        806      809       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../producer/qltystats/DefaultBrokerRcvQltyStats.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pbmxvbmcvdHViZW1xL2NsaWVudC9wcm9kdWNlci9xbHR5c3RhdHMvRGVmYXVsdEJyb2tlclJjdlFsdHlTdGF0cy5qYXZh) | `45.31% <0.00%> (-0.40%)` | :arrow_down: |
   | [...ong/tubemq/manager/service/ClusterServiceImpl.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtbWFuYWdlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW5sb25nL3R1YmVtcS9tYW5hZ2VyL3NlcnZpY2UvQ2x1c3RlclNlcnZpY2VJbXBsLmphdmE=) | `52.94% <0.00%> (+2.94%)` | :arrow_up: |
   | [...inlong/tubemq/manager/service/TaskServiceImpl.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtbWFuYWdlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW5sb25nL3R1YmVtcS9tYW5hZ2VyL3NlcnZpY2UvVGFza1NlcnZpY2VJbXBsLmphdmE=) | `8.53% <0.00%> (+4.87%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [256ebf9...a9acf20](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] crancchen commented on pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
crancchen commented on pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#issuecomment-1020907978


   add  standalone  deployment shell


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] codecov-commenter edited a comment on pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#issuecomment-1020853810


   # [Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2323](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8f2f090) into [master](https://codecov.io/gh/apache/incubator-inlong/commit/256ebf94057467356c4204b1ff6b367af41f6435?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (256ebf9) will **increase** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-inlong/pull/2323/graphs/tree.svg?width=650&height=150&src=pr&token=1EUK92O9K2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2323      +/-   ##
   ============================================
   + Coverage     12.53%   12.54%   +0.01%     
   - Complexity     1215     1217       +2     
   ============================================
     Files           420      420              
     Lines         36240    36240              
     Branches       5670     5670              
   ============================================
   + Hits           4541     4545       +4     
   + Misses        30893    30886       -7     
   - Partials        806      809       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../producer/qltystats/DefaultBrokerRcvQltyStats.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pbmxvbmcvdHViZW1xL2NsaWVudC9wcm9kdWNlci9xbHR5c3RhdHMvRGVmYXVsdEJyb2tlclJjdlFsdHlTdGF0cy5qYXZh) | `45.31% <0.00%> (-0.40%)` | :arrow_down: |
   | [...ong/tubemq/manager/service/ClusterServiceImpl.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtbWFuYWdlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW5sb25nL3R1YmVtcS9tYW5hZ2VyL3NlcnZpY2UvQ2x1c3RlclNlcnZpY2VJbXBsLmphdmE=) | `52.94% <0.00%> (+2.94%)` | :arrow_up: |
   | [...inlong/tubemq/manager/service/TaskServiceImpl.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtbWFuYWdlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW5sb25nL3R1YmVtcS9tYW5hZ2VyL3NlcnZpY2UvVGFza1NlcnZpY2VJbXBsLmphdmE=) | `8.53% <0.00%> (+4.87%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [256ebf9...8f2f090](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] codecov-commenter edited a comment on pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#issuecomment-1020853810


   # [Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2323](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8f2f090) into [master](https://codecov.io/gh/apache/incubator-inlong/commit/256ebf94057467356c4204b1ff6b367af41f6435?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (256ebf9) will **increase** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-inlong/pull/2323/graphs/tree.svg?width=650&height=150&src=pr&token=1EUK92O9K2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2323      +/-   ##
   ============================================
   + Coverage     12.53%   12.54%   +0.01%     
   - Complexity     1215     1217       +2     
   ============================================
     Files           420      420              
     Lines         36240    36240              
     Branches       5670     5670              
   ============================================
   + Hits           4541     4545       +4     
   + Misses        30893    30886       -7     
   - Partials        806      809       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../producer/qltystats/DefaultBrokerRcvQltyStats.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pbmxvbmcvdHViZW1xL2NsaWVudC9wcm9kdWNlci9xbHR5c3RhdHMvRGVmYXVsdEJyb2tlclJjdlFsdHlTdGF0cy5qYXZh) | `45.31% <0.00%> (-0.40%)` | :arrow_down: |
   | [...ong/tubemq/manager/service/ClusterServiceImpl.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtbWFuYWdlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW5sb25nL3R1YmVtcS9tYW5hZ2VyL3NlcnZpY2UvQ2x1c3RlclNlcnZpY2VJbXBsLmphdmE=) | `52.94% <0.00%> (+2.94%)` | :arrow_up: |
   | [...inlong/tubemq/manager/service/TaskServiceImpl.java](https://codecov.io/gh/apache/incubator-inlong/pull/2323/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW5sb25nLXR1YmVtcS90dWJlbXEtbWFuYWdlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW5sb25nL3R1YmVtcS9tYW5hZ2VyL3NlcnZpY2UvVGFza1NlcnZpY2VJbXBsLmphdmE=) | `8.53% <0.00%> (+4.87%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [256ebf9...8f2f090](https://codecov.io/gh/apache/incubator-inlong/pull/2323?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] dockerzhang merged pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
dockerzhang merged pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323


   


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-inlong] kipshi commented on a change in pull request #2323: [INLONG-2301] add standalone deployment shell

Posted by GitBox <gi...@apache.org>.
kipshi commented on a change in pull request #2323:
URL: https://github.com/apache/incubator-inlong/pull/2323#discussion_r791409578



##########
File path: bin/inlong-daemon.sh
##########
@@ -0,0 +1,287 @@
+#!/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.
+#
+
+#start-up Tubemq
+startTubeMqFun(){
+    tubemqMaster_webPort=8080
+    TUBE_MASTER_PORT=8715
+    TUBE_MASTER_TOKEN=abc
+    tubemqDBNAME="tubemanager"      #tubemq manager database
+    basePath=$(cd `dirname $0`; cd ..; pwd)
+    source $basePath/conf/standalone.conf
+    TUBE_MASTER_IP=$tubemqMaster_hostName
+    cd $basePath/inlong-tubemq-server/bin
+    chmod 755 *.sh
+    echo "start-up tubemq master ..."
+    ./tubemq.sh master start 
+    sleep 10
+    # add broker
+    curl -d 'type=op_modify&method=admin_add_broker_configure&brokerId=1&brokerIp='"$tubemqBroker_hostName"'&createUser=docker&brokerPort=8123&deletePolicy=delete,168h&numPartitions=3&unflushThreshold=1000&acceptPublish=true&acceptSubscribe=true&unflushInterval=10000&confModAuthToken=abc' http://$tubemqMaster_hostName:$tubemqMaster_webPort/webapi.htm
+    # online
+    curl -d 'type=op_modify&method=admin_online_broker_configure&brokerId=1&modifyUser=docker&confModAuthToken=abc' http://$tubemqMaster_hostName:$tubemqMaster_webPort/webapi.htm
+    # broker start
+    echo "start-up tubemq broker ..."
+    ./tubemq.sh broker start
+    #manager start
+    echo "start-up tubemq manager ..."
+    cd $basePath/inlong-tubemq-manager/bin                          
+    #create tubemanager database
+    create_db_sql="create database IF NOT EXISTS ${tubemqDBNAME}"
+    mysql -h${spring_datasource_hostname}  -P${spring_datasource_port}  -u${spring_datasource_username} -p${spring_datasource_password} -e "${create_db_sql}"
+    ./start-manager.sh
+    sleep 10
+    #first init
+    flag=$(cat init-tube-cluster.sh | grep "flag=1") 
+    if [ ! -n "$flag"  ] ;then
+        echo  "init shell config"  
+        sed -i 's/TUBE_MANAGER_IP=.*/'''TUBE_MANAGER_IP=${TUBE_MANAGER_IP}'''/g' init-tube-cluster.sh 
+    	  sed -i 's/TUBE_MANAGER_PORT=.*/'''TUBE_MANAGER_PORT=${TUBE_MANAGER_PORT}'''/g' init-tube-cluster.sh 
+    	  sed -i 's/TUBE_MASTER_IP=.*/'''TUBE_MASTER_IP=${TUBE_MASTER_IP}'''/g' init-tube-cluster.sh 
+    	  sed -i 's/TUBE_MASTER_PORT=.*/'''TUBE_MASTER_PORT=${TUBE_MASTER_PORT}'''/g' init-tube-cluster.sh 
+    	  sed -i 's/TUBE_MASTER_WEB_PORT=.*/'''TUBE_MASTER_WEB_PORT=${tubemqMaster_webPort}'''/g' init-tube-cluster.sh 
+    	  sed -i 's/TUBE_MASTER_TOKEN=.*/'''TUBE_MASTER_TOKEN=${TUBE_MASTER_TOKEN}'''/g' init-tube-cluster.sh 
+          echo  "init tubemq cluster"
+    	  ./init-tube-cluster.sh 
+    	  echo -e "\nflag=1" >> init-tube-cluster.sh
+      else
+    	  echo "tubemq cluster initialized,skip"
+    fi   
+}  
+
+#start inlong
+startInlong(){
+    #default zk root path
+    cluster_zk_root=inlong_hive
+    #default sort_appName
+    sort_appName=inlong_app
+    
+    basePath=$(cd `dirname $0`; cd ..; pwd)
+    source $basePath/conf/standalone.conf
+    
+    inlongDBNAME="apache_inlong_manager"  # inlong manager Metabase name  
+    
+    echo "Judge the choice of message middleware tubemq or pulsar"
+    if [ $source_type == "pulsar" ];then
+    #Judge whether the pulsar cluster is started in the current system
+       pulsar_thread=$($JAVA_HOME/bin/jps |grep PulsarBrokerStarter)
+       if [ ! -n "$pulsar_thread" ]; then 
+          echo "The system does not start the pulsar. Please start the pulsar manually first" 
+    	  exit 1
+       else
+    	  echo "The current system starts the pulsar, which is used to complete message delivery and storage"
+       fi
+    else
+       startTubeMqFun
+	   echo  "Judge whether the  TubeMQ cluster is started in the current system"
+       tubemq_manager_thread=$($JAVA_HOME/bin/jps |grep TubeMQManager)
+       tubemq_broker_thread=$($JAVA_HOME/bin/jps |grep BrokerStartup)
+       tubemq_master_thread=$($JAVA_HOME/bin/jps |grep MasterStartup)
+       if [[ ! -n "$tubemq_manager_thread" && ! -n "$tubemq_broker_thread" && ! -n "$tubemq_master_thread" ]]; then 
+          echo "The system does not start tubemq or starts abnormally. Please start tubemq normally first" 
+    	  exit 1
+       else
+    	  echo "The current system starts tubemq, which is used to complete message delivery and storage"
+       fi
+    fi   
+    
+    echo "2.start-up inlong manager"	
+    cd $basePath/inlong-manager-web
+    #Whether the database table exists. If it does not exist, initialize the database and skip if it exists.
+    select_db_sql="SELECT COUNT(*) FROM information_schema.TABLES WHERE table_schema = '${inlongDBNAME}'"
+    inlong_manager_count=$(mysql -h${spring_datasource_hostname}  -P${spring_datasource_port}  -u${spring_datasource_username} -p${spring_datasource_password} -e "${select_db_sql}")
+    inlong_num=$(echo $inlong_manager_count | tr -cd "[0-9]")
+    if [ $inlong_num -eq 0 ] ;then
+       echo  "init apache_inlong_manager database"  
+       mysql -h${spring_datasource_hostname}  -P${spring_datasource_port}  -u${spring_datasource_username} -p${spring_datasource_password} < sql/apache_inlong_manager.sql
+     else
+       echo "apache_inlong_manager database initialized,skip"
+    fi   
+    cd $basePath/inlong-manager-web/bin
+    ./startup.sh
+    
+    echo "3.start-up inlong web"
+    if [[ "$manager_server_hostname" = "localhost" || "$manager_server_hostname" = "127.0.0.1" ]];then
+          manager_server_hostname=$local_ip
+    fi
+    echo $manager_server_hostname
+    docker stop website
+    docker rm website
+    docker pull inlong/website:latest
+    docker run -d --name website -e MANAGER_API_ADDRESS=$manager_server_hostname:$manager_server_port -p $inlong_web_port:$docker_inlong_web_port inlong/website
+    
+    
+    echo "4.start-up inlong dataproxy"
+    cd $basePath/inlong-dataproxy/bin
+    chmod 755 *.sh
+    ./prepare_env.sh
+    ./dataproxy-start.sh
+    select_db_sql="SELECT COUNT(*) FROM  ${inlongDBNAME}.data_proxy_cluster where address='localhost'"
+    cluster_count=$(mysql -h${spring_datasource_hostname}  -P${spring_datasource_port}  -u${spring_datasource_username} -p${spring_datasource_password} -e "${select_db_sql}")
+    cluster_num=$(echo $cluster_count | tr -cd "[0-9]")
+    #Insert the cluster information if it does not exist, and skip if it exists
+    if [ $cluster_num -eq 0 ] ;then
+       echo  "Insert cluster information into data_ proxy_ cluster table"  
+       insert_db_sql="insert into ${inlongDBNAME}.data_proxy_cluster (name, address, port, status, is_deleted, creator, create_time, modify_time)
+       values ('dataproxy', 'localhost',46801, 0, 0, 'admin', now(), now());"
+       mysql -h${spring_datasource_hostname}  -P${spring_datasource_port}  -u${spring_datasource_username} -p${spring_datasource_password} -e "${insert_db_sql}"
+    else
+       echo "cluster information already exists, skip"
+    fi   
+    
+    echo "5.start-up inlong agent"
+    cd $basePath/inlong-agent/bin
+    ./agent.sh start
+    
+    
+    echo "6.start-up inlong sort"
+    #Judge whether the system has started Fink cluster
+       flink_thread=$($JAVA_HOME/bin/jps |grep TaskManagerRunner)
+       if [ ! -n "$flink_thread" ]; then 
+          echo "The system does not start Flink. Please start Flink manually first" 
+    	  exit 1
+       else
+    	  echo "Currently, the system starts Flink, which is used to process sort tasks"
+       fi
+    #This file is mainly used to find the Flink bin directory
+    flagfile=`find / -name find-flink-home.sh`
+    flink_bin=$(dirname $flagfile)
+    cd $basePath
+    $flink_bin/flink run -c org.apache.inlong.sort.flink.Entrance inlong-sort/sort-core*.jar \
+    --cluster-id $sort_appName --zookeeper.quorum $zkServerAddr --zookeeper.path.root $cluster_zk_root \
+    --source.type $source_type --sink.type $sink_type &
+}
+
+#stop inlong
+stopInlong(){
+    echo "1.stop agent ... "
+    agent_thread=$($JAVA_HOME/bin/jps |grep AgentMain)
+    if [ ! -n "$agent_thread" ]; then 
+       echo "The system did not running agent" 
+    else
+       agent_pid=$(echo $agent_thread | tr -cd "[0-9]")
+       kill -9 $agent_pid
+     echo "agent stopped "
+    fi
+    
+    echo "2.stop inlong_manager ... "
+    inlong_manager_thread=$($JAVA_HOME/bin/jps |grep InLongWebApplication)
+    if [ ! -n "$inlong_manager_thread" ]; then 
+       echo "The system did not running inlong manager" 
+    else
+       inlong_manager_pid=$(echo $inlong_manager_thread | tr -cd "[0-9]")
+       kill -9 $inlong_manager_pid
+       echo "inlong_manager stopped "
+    fi
+    
+    echo "3.stop dataproxy ... "
+    dataproxy_thread=$($JAVA_HOME/bin/jps |grep Application)
+    if [ ! -n "$dataproxy_thread" ]; then 
+       echo "The system did not running  dataproxy" 
+    else
+       dataproxy_pid=$(echo $dataproxy_thread | tr -cd "[0-9]")
+       kill -9 $dataproxy_pid
+       echo "dataproxy stopped "
+    fi
+    
+    echo "4.stop tubemq_manager ... "
+    tubemq_manager_thread=$($JAVA_HOME/bin/jps |grep TubeMQManager)
+    if [ ! -n "$tubemq_manager_thread" ]; then 
+       echo "The system did not running tubemq_manager" 
+    else
+       tubemq_manager_pid=$(echo $tubemq_manager_thread | tr -cd "[0-9]")
+       kill -9 $tubemq_manager_pid
+       echo "tubemq_manager stopped "
+    fi
+    
+    echo "5.stop tubemq_broker ... "
+    tubemq_broker_thread=$($JAVA_HOME/bin/jps |grep BrokerStartup)
+    if [ ! -n "$tubemq_broker_thread" ]; then 
+       echo "The system did not running  tubemq_broker" 
+    else
+       tubemq_broker_pid=$(echo $tubemq_broker_thread | tr -cd "[0-9]")
+       kill -9 $tubemq_broker_pid
+       echo "tubemq_broker stopped "
+    fi
+    
+    echo "6.stop tubemq_master... "
+    tubemq_master_thread=$($JAVA_HOME/bin/jps |grep MasterStartup)
+    if [ ! -n "$tubemq_master_thread" ]; then 
+       echo "The system did not running tubemq_master" 
+    else
+       tubemq_master_pid=$(echo $tubemq_master_thread | tr -cd "[0-9]")
+       kill -9 $tubemq_master_pid
+       echo "tubemq_master stopped "
+    fi
+    
+    echo "7.stop CliFrontend... "
+    cli_frontend_thread=$($JAVA_HOME/bin/jps |grep CliFrontend)
+    if [ ! -n "$cli_frontend_thread" ]; then 
+       echo "The system did not running cli_frontend" 
+    else
+       cli_frontend_pid=$(echo $cli_frontend_thread | tr -cd "[0-9]")
+       kill -9 $cli_frontend_pid
+       echo "cli_frontend stopped "
+    fi
+	
+	echo "8.stop sort flink job"

Review comment:
       format code




-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org