Comments (18)
虚拟网络, 跨机器了?
from tars.
虚拟网络, 跨机器了?
我这个是虚拟机网络吗?
我是两台局域网的实体机
from tars.
docker虚拟网络, 不同机器不通, 你可以先了解一下docker, 如果有多台机器, 不如就用--net=host
from tars.
network_mode: "host"
我的这个docker-compose配置是使用的host模式吧?
from tars.
并且我并没有使用docker开启虚拟网段
from tars.
你这个ip是机器实际的ip么?
from tars.
tars主节点局域网IP:10.10.141.57 mysql和framework都在这个机器的docker
node节点局域网IP:10.10.145.76
from tars.
from tars.
那不应该不通, 只能检查一下tarsnode日志看看
from tars.
这个是tarsnode的docker日志
docker logs dedd4ac314b8
--2023-11-22 10:28:08-- http://10.10.141.57:3000/get_tarsnode?ip=&runuser=root®istryAddress=
Connecting to 10.10.141.57:3000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3458 (3.4K) [text/plain]
Saving to: 'get_tarsnode.sh'
0K ... 100% 2.47G=0s
2023-11-22 10:28:08 (2.47 GB/s) - 'get_tarsnode.sh' saved [3458/3458]
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://10.10.141.57:3000, machine_ip:10.10.145.76, registryAddress:tcp -h 10.10.141.57 -p 17890"
OSNAME=`uname`
OS=1
if [[ "$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://10.10.141.57:3000/files/tarsnode.tgz
#休息1s, 避免下载的文件没有写成功
sleep 1
if [ ! -f "tarsnode.tgz" ]; then
echo "Tars node download error: http://10.10.141.57:3000/files/tarsnode.tgz"
exit
fi
if [ 'tcp -h 10.10.141.57 -p 17890' == '' ]; then
echo "registryAddress is empty."
exit
fi
if [ '10.10.145.76' == '' ]; 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:[10.10.145.76] succ"
echo "tars registry:" tcp -h 10.10.141.57 -p 17890
sed -i "s/localip.tars.com/10.10.145.76/g" ${TARS_PATH}/tarsnode/conf/tars.tarsnode.config.conf
sed -i "s/registryAddress/tcp -h 10.10.141.57 -p 17890/g" ${TARS_PATH}/tarsnode/conf/tars.tarsnode.config.conf
if [ $OS != 3 ]; then
sed -i "s/registryAddress/tcp -h 10.10.141.57 -p 17890/g" ${TARS_PATH}/tarsnode/util/execute.sh
sed -i "s/localip.tars.com/10.10.145.76/g" ${TARS_PATH}/tarsnode/util/execute.sh
else
sed -i "s/registryAddress/tcp -h 10.10.141.57 -p 17890/g" ${TARS_PATH}/tarsnode/util/execute.bat
sed -i "s/localip.tars.com/10.10.145.76/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/*;
${TARS_PATH}/tarsnode/util/stop.sh
uid=`whoami`
if [ "$uid" != "root" ] && [ "root" != "" ]; then
echo "su $runuser: now uid:$uid, runuser:$runuser"
su - $runuser -c "sh ${TARS_PATH}/tarsnode/util/start.sh"
else
sh ${TARS_PATH}/tarsnode/util/start.sh
fi
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://10.10.141.57:3000, machine_ip:10.10.145.76, registryAddress:tcp -h 10.10.141.57 -p 17890
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1323k 0 1323k 0 0 92.3M 0 --:--:-- --:--:-- --:--:-- 92.3M
cp: cannot overwrite non-directory '/usr/local/app/tars/tarsnode/data' with directory 'tarsnode/data'
local machine ip:[10.10.145.76] succ
tars registry: tcp -h 10.10.141.57 -p 17890
install tarsnode succ, start tarsnode
start /usr/local/app/tars/tarsnode/bin/tarsnode --nodeid=10.10.145.76 --config=/usr/local/app/tars/tarsnode/conf/tars.tarsnode.config.conf
Tars node installed success
tarsnode.conf: --------------------------------------------------------
<tars>
<application>
enableset=n
setdivision=NULL
<client>
async-invoke-timeout=5000
refresh-endpoint-interval=60000
report-interval=60000
stat=tars.tarsstat.StatObj
property=tars.tarsproperty.PropertyObj
modulename=tars.tarsnode
locator=tars.tarsregistry.QueryObj@tcp -h 10.10.141.57 -p 17890
sync-invoke-timeout=6000
asyncthread=3
</client>
<server>
logsize=10M
config=tars.tarsconfig.ConfigObj
notify=tars.tarsnotify.NotifyObj
deactivating-timeout=3000
app=tars
server=tarsnode
localip=10.10.145.76
local=tcp -h 127.0.0.1 -p 19387 -t 10000
basepath=/usr/local/app/tars/tarsnode/data
datapath=/usr/local/app/tars/tarsnode/data
logpath=/usr/local/app/tars/app_log
logLevel=DEBUG
<NodeAdapter>
endpoint=tcp -h 10.10.145.76 -p 19385 -t 60000
allow
maxconns=1024
threads=5
queuecap=10000
queuetimeout=4000
servant=tars.tarsnode.NodeObj
</NodeAdapter>
<ServerAdapter>
endpoint=tcp -h 10.10.145.76 -p 19386 -t 60000
allow
maxconns=1024
threads=5
queuecap=10000
queuetimeout=4000
servant=tars.tarsnode.ServerObj
</ServerAdapter>
</server>
</application>
<node>
registryObj=tars.tarsregistry.RegistryObj
<keepalive>
heartTimeout=45
monitorInterval=3
synStatInterval=60
</keepalive>
<hashmap>
file=serversCache.dat
minBlock=500
maxBlock=500
factor=1
size=10M
</hashmap>
</node>
</tars>
install tarsnode succ, check tarsnode alive
--2023-11-22 10:33:24-- http://10.10.141.57:3000/get_tarsnode?ip=&runuser=root®istryAddress=
Connecting to 10.10.141.57:3000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3458 (3.4K) [text/plain]
Saving to: 'get_tarsnode.sh'
0K ... 100% 2.18G=0s
2023-11-22 10:33:24 (2.18 GB/s) - 'get_tarsnode.sh' saved [3458/3458]
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://10.10.141.57:3000, machine_ip:10.10.145.76, registryAddress:tcp -h 10.10.141.57 -p 17890"
OSNAME=`uname`
OS=1
if [[ "$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://10.10.141.57:3000/files/tarsnode.tgz
#休息1s, 避免下载的文件没有写成功
sleep 1
if [ ! -f "tarsnode.tgz" ]; then
echo "Tars node download error: http://10.10.141.57:3000/files/tarsnode.tgz"
exit
fi
if [ 'tcp -h 10.10.141.57 -p 17890' == '' ]; then
echo "registryAddress is empty."
exit
fi
if [ '10.10.145.76' == '' ]; 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:[10.10.145.76] succ"
echo "tars registry:" tcp -h 10.10.141.57 -p 17890
sed -i "s/localip.tars.com/10.10.145.76/g" ${TARS_PATH}/tarsnode/conf/tars.tarsnode.config.conf
sed -i "s/registryAddress/tcp -h 10.10.141.57 -p 17890/g" ${TARS_PATH}/tarsnode/conf/tars.tarsnode.config.conf
if [ $OS != 3 ]; then
sed -i "s/registryAddress/tcp -h 10.10.141.57 -p 17890/g" ${TARS_PATH}/tarsnode/util/execute.sh
sed -i "s/localip.tars.com/10.10.145.76/g" ${TARS_PATH}/tarsnode/util/execute.sh
else
sed -i "s/registryAddress/tcp -h 10.10.141.57 -p 17890/g" ${TARS_PATH}/tarsnode/util/execute.bat
sed -i "s/localip.tars.com/10.10.145.76/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/*;
${TARS_PATH}/tarsnode/util/stop.sh
uid=`whoami`
if [ "$uid" != "root" ] && [ "root" != "" ]; then
echo "su $runuser: now uid:$uid, runuser:$runuser"
su - $runuser -c "sh ${TARS_PATH}/tarsnode/util/start.sh"
else
sh ${TARS_PATH}/tarsnode/util/start.sh
fi
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://10.10.141.57:3000, machine_ip:10.10.145.76, registryAddress:tcp -h 10.10.141.57 -p 17890
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1323k 0 1323k 0 0 92.3M 0 --:--:-- --:--:-- --:--:-- 92.3M
cp: cannot overwrite non-directory '/usr/local/app/tars/tarsnode/data' with directory 'tarsnode/data'
local machine ip:[10.10.145.76] succ
tars registry: tcp -h 10.10.141.57 -p 17890
install tarsnode succ, start tarsnode
start /usr/local/app/tars/tarsnode/bin/tarsnode --nodeid=10.10.145.76 --config=/usr/local/app/tars/tarsnode/conf/tars.tarsnode.config.conf
Tars node installed success
tarsnode.conf: --------------------------------------------------------
<tars>
<application>
enableset=n
setdivision=NULL
<client>
async-invoke-timeout=5000
refresh-endpoint-interval=60000
report-interval=60000
stat=tars.tarsstat.StatObj
property=tars.tarsproperty.PropertyObj
modulename=tars.tarsnode
locator=tars.tarsregistry.QueryObj@tcp -h 10.10.141.57 -p 17890
sync-invoke-timeout=6000
asyncthread=3
</client>
<server>
logsize=10M
config=tars.tarsconfig.ConfigObj
notify=tars.tarsnotify.NotifyObj
deactivating-timeout=3000
app=tars
server=tarsnode
localip=10.10.145.76
local=tcp -h 127.0.0.1 -p 19387 -t 10000
basepath=/usr/local/app/tars/tarsnode/data
datapath=/usr/local/app/tars/tarsnode/data
logpath=/usr/local/app/tars/app_log
logLevel=DEBUG
<NodeAdapter>
endpoint=tcp -h 10.10.145.76 -p 19385 -t 60000
allow
maxconns=1024
threads=5
queuecap=10000
queuetimeout=4000
servant=tars.tarsnode.NodeObj
</NodeAdapter>
<ServerAdapter>
endpoint=tcp -h 10.10.145.76 -p 19386 -t 60000
allow
maxconns=1024
threads=5
queuecap=10000
queuetimeout=4000
servant=tars.tarsnode.ServerObj
</ServerAdapter>
</server>
</application>
<node>
registryObj=tars.tarsregistry.RegistryObj
<keepalive>
heartTimeout=45
monitorInterval=3
synStatInterval=60
</keepalive>
<hashmap>
file=serversCache.dat
minBlock=500
maxBlock=500
factor=1
size=10M
</hashmap>
</node>
</tars>
install tarsnode succ, check tarsnode alive
[root@bogon node]#
from tars.
进入容器, 查看 /usr/local/app/tars/app_log/tars/tarsnode/....下面的日志, 看看是否有异常
from tars.
from tars.
from tars.
看一下最后一张图有Error
from tars.
看起来是似乎没问题啊, 是不是防火墙哪里有问题
from tars.
就是防火墙问题,那我不能关闭防火墙吧?有什么好的办法吗?
from tars.
tars-node的防火墙关闭就可以了
from tars.
防火墙开通内网啊, 内网要啥防火墙
from tars.
Related Issues (20)
- [BUG]错误: create config data error[DCacheOptImp::createDBAccessConf] error, main key miss!
- [FEATURE] websocket support ? HOT 2
- How to fix "httpheader.conf" problem in GatewayServer HOT 2
- [BUG]当节点经过网关连入主框架时,PUSH配置文件存在问题,无法推送节点配置的内容 HOT 1
- 对于Python和ruby这类语言应该怎么处理? HOT 1
- 编译AdminRegistry为抽象类出错 HOT 2
- 请问大概什么时候能用上Python的支持 HOT 1
- helloserver HOT 1
- 请教一下tars协议文件怎么样能定义一个二维数组呢?
- 【问题求助】发布服务后,服务当前状态一直是inactive HOT 2
- [FEATURE]python HOT 2
- 请问啥时候能支持python啊?急求 HOT 1
- tars部署好后,发布失败问题 HOT 1
- [BUG] handleNoTarsProtocol错误 HOT 1
- [FEATURE]mysql能不能用etcd替换 ,方便运维的高可用部署维护? HOT 1
- 上传tars 协议文件时 报 Error: Command failed HOT 1
- 怎么实现服务端回调客户端函数 HOT 3
- [FEATURE] tarscpp 有计划直接支持mysql8么 HOT 2
- tars和trpc是什么关系 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tars.