Closed edward-golang closed 3 years ago
补充:transnode的机器一直打印 MonitorNode ok 。。。的log;但框架后台的 节点管理 中没有显示192.168.163.129的节点信息。
补充:把两台机器的防火墙关了后,在tasweb管理后台就可以看到新增的tarsnode了。。。;请问在多机器的环境中,framework要开放哪些端口才能确保tarsnode能正常接入?
可以看看framework/deploy/Dockfile文件, 里面都有端口说明
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。
Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
框架的管理后台是:192.168.163.128:3000 我用另一台虚拟机(ip:192.168.163.129)部署tarsnode,下面是部署命令: docker run \ --name=tars-node \ --net=host \ -e INET=ens33 \ -e WEB_HOST="192.168.163.128:3000" \ -v /root/work/docker/tars/node/data:/data/app \ -v /etc/localtime:/etc/localtime \ tarscloud/tars-node:full
下面是报错:
[root@localhost data]# docker run --name=tars-node --net=host -e INET=ens33 -e WEB_HOST="192.168.163.128:3000" -v /root/work/docker/tars/node/data:/data/app -v /etc/localtime:/etc/localtime tarscloud/tars-node:full --2020-11-08 00:12:36-- http://192.168.163.128:3000/get_tarsnode?ip=&runuser=root Connecting to 192.168.163.128:3000... connected. HTTP request sent, awaiting response... 200 OK Length: 3503 (3.4K) [text/plain] Saving to: 'get_tarsnode.sh'
2020-11-08 00:12:36 (221 MB/s) - 'get_tarsnode.sh' saved [3503/3503]
get_tarsnode.sh: --------------------------------------------------------
!/bin/bash
/**
* Tencent is pleased to support the open source community by making Tars available.
*
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* 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.
*/
echo "runuser: root, webHost:http://192.168.163.128:3000, machine_ip:192.168.163.129, registryAddress:tcp -h 192.168.163.128 -p 17890"
OSNAME=
uname
OS=1if [[ "$OSNAME" == "Darwin" ]]; then OS=2 elif [[ "$OSNAME" == "Windows_NT" ]]; then OS=3 else OS=1 fi
if [ $OS != 3 ]; then TARS_PATH=/usr/local/app/tars else TARS_PATH=c:/tars-install/tars fi
if [ $OS != 3 ]; then if [ ! -d "/usr/local/app" ]; then echo "create tars base path: " mkdir -p /data/app ln -s /data/app /usr/local/app fi fi
mkdir -p ${TARS_PATH}
rm -rf tarsnode.tgz
curl -O http://192.168.163.128:3000/files/tarsnode.tgz
休息1s, 避免下载的文件没有写成功
sleep 1
if [ ! -f "tarsnode.tgz" ]; then echo "Tars node download error: http://192.168.163.128:3000/files/tarsnode.tgz" exit fi
if [ 'tcp -h 192.168.163.128 -p 17890' == '' ]; then echo "registryAddress is empty." exit fi
if [ '192.168.163.129' == '' ]; then echo "machine_ip is empty." exit fi
tar zxf tarsnode.tgz
if [ $OS != 3 ]; then if [ -f ${TARS_PATH}/tarsnode/util/stop.sh ]; then ${TARS_PATH}/tarsnode/util/stop.sh fi else if [ -f ${TARS_PATH}/tarsnode/util/stop.bat ]; then ${TARS_PATH}/tarsnode/util/stop.bat fi fi
cp -rf tarsnode ${TARS_PATH}/
cd ${TARS_PATH}
echo "local machine ip:[192.168.163.129] succ"
echo "tars registry:" tcp -h 192.168.163.128 -p 17890
sed -i "s/localip.tars.com/192.168.163.129/g" ${TARS_PATH}/tarsnode/conf/tars.tarsnode.config.conf
sed -i "s/registryAddress/tcp -h 192.168.163.128 -p 17890/g" ${TARS_PATH}/tarsnode/conf/tars.tarsnode.config.conf
if [ $OS != 3 ]; then sed -i "s/registryAddress/tcp -h 192.168.163.128 -p 17890/g" ${TARS_PATH}/tarsnode/util/execute.sh sed -i "s/localip.tars.com/192.168.163.129/g" ${TARS_PATH}/tarsnode/util/execute.sh else sed -i "s/registryAddress/tcp -h 192.168.163.128 -p 17890/g" ${TARS_PATH}/tarsnode/util/execute.bat sed -i "s/localip.tars.com/192.168.163.129/g" ${TARS_PATH}/tarsnode/util/execute.bat fi echo "install tarsnode succ, start tarsnode"
if [ $OS != 3 ]; then id -u root &>/dev/null if [ $? != 0 ]; then useradd root fi chown -R root:root /usr/local/app/*;
else ${TARS_PATH}/tarsnode/util/start.bat fi
INFO=
ps -e | grep tarsnode
if [[ "${INFO}" != "" ]]; then echo 'Tars node installed success' else echo 'Tars node installed failed' fi runuser: root, webHost:http://192.168.163.128:3000, machine_ip:192.168.163.129, registryAddress:tcp -h 192.168.163.128 -p 17890 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1201k 0 1201k 0 0 13.3M 0 --:--:-- --:--:-- --:--:-- 13.4M cp: cannot overwrite non-directory '/usr/local/app/tars/tarsnode/data' with directory 'tarsnode/data' local machine ip:[192.168.163.129] succ tars registry: tcp -h 192.168.163.128 -p 17890 install tarsnode succ, start tarsnode start /usr/local/app/tars/tarsnode/bin/tarsnode --nodeid=192.168.163.129 --config=/usr/local/app/tars/tarsnode/conf/tars.tarsnode.config.conf Tars node installed success tarsnode.conf: --------------------------------------------------------
install tarsnode succ, check tarsnode alive MonitorNode ok, latestKeepAliveTime:1604823159, kaTimeout:300 MonitorNode ok, latestKeepAliveTime:1604823159, kaTimeout:300 MonitorNode ok, latestKeepAliveTime:1604823166, kaTimeout:300 MonitorNode ok, latestKeepAliveTime:1604823166, kaTimeout:300 MonitorNode ok, latestKeepAliveTime:1604823173, kaTimeout:300 MonitorNode ok, latestKeepAliveTime:1604823173, kaTimeout:300 MonitorNode ok, latestKeepAliveTime:1604823173, kaTimeout:300 MonitorNode ok, latestKeepAliveTime:1604823180, kaTimeout:300 MonitorNode ok, latestKeepAliveTime:1604823180, kaTimeout:300 MonitorNode ok, latestKeepAliveTime:1604823187, kaTimeout:300 MonitorNode ok, latestKeepAliveTime:1604823187, kaTimeout:300
请问,这是什么原因?要怎么排查问题?谢谢!