问题:
在使用seata的时候,由于复制了虚拟机进行使用,所以其容器内ENV的SEATA_IP是之前宿主虚拟机的IP,这样seata-server在nacos上的注册ip是不对的
为了处理这个问题,需要重新启动seata的docker容器,但linux的history已没有之前的运行命令
解决:
使用runlike命令查看容器的启动命令
[root@localhost ~]# runlike -p seata-server
docker run --name=seata-server \
--volume /data/seata/config/resources:/seata-server/resources \
--env=SEATA_IP=192.168.100.100 \
--workdir=/seata-server \
-p 7091:7091 \
-p 8091:8091 \
--restart=always \
--runtime=runc \
--detach=true \
seataio/seata-server:1.5.2
runlike安装
1. 安装pipx包
centos
yum -y install epel-release
yum install -y python36
pip3 install runlike
ubuntu
apt install pipx
# 该命令将在虚拟环境隔离安装的包注册到全局可用,调用该命令后需要重新打开一个新终端进行使用
pipx ensurepath
2. 安装runlike
pipx install runlike
3. 查看容器启动命令
runlike -p seata-server
评论区