com.github.tobato.fastdfs.exception.FdfsServerException: Error code: 2, error message: Cannot find node or file
Summary of commands at the end of the article This article is for reference only, file path and file deletion need to follow the configuration of your own virtual machine to write
First check whether the configuration file in our project is the ifConfig ens33
same as the ip address of the virtual machine Check the ip of the virtual machine: As shown in the figure:
If the configuration is the same and this problem still occurs, we can enter the virtual machine and use the command: command more docker-compose.yml
to check whether the ip of our service is the same as the virtual machine The ip is the same, most of the problems that cannot find the cause of the error are caused by the difference between the two ip, mine is modified as shown in the figure:
since we have found the problem, we will advance to the service directory, my directory It is cd /root/docker-file/fastdfs/
to use the command vi docker-compose.yml
to enter the edit mode to modify the ip address. After the modification, use the command Esc
to press , then enter an English colon, and then enter wq
and then use the command docker stop storage tracher
to stop the mirroring.
Use the command to delete the tracker service. docker rm storage tracker
Enter the cd /data/fastdfs/
directory ll
command to view all files
and then delete all files rm -rf *
. Enter cd /root/docker-file/fastdfs/
the directory and
docker-compose up -d
start all services
docker ps -a
to check whether the service is started up. The startup is successful.
The following picture shows the startup is successful:
It should be fine to test the code again.
Command summary:
ifConfig ens33 查看虚拟机ip
cd /root/docker-file/fastdfs/ 进入目录
more docker-compose.yml 查看配置文件
vi docker-compose.yml 修改配置文件
wq 保存并退出
docker stop storage tracher 停止tracher服务
docker rm storage tracher 删除服务
cd /data/fastdfs/ 进入date目录下fastdfs文件中
ll 查看所有文件
rm -rf * 删除所有文件
cd /root/docker-file/fastdfs/ 进入root目录下的fastdfs文件中
docker-compose up -d 创建容器并启动所有服务
docker ps -a 查看所有服务