Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What should the server do if the file cannot be uploaded because of Exit when docker uses storage?

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you what to do when docker uses storage Exit to cause files not to be uploaded to the server. The content is simple and easy to understand. I hope you can learn. After learning, there will be gains. Let's take a look at it.

1. Problem description

The storage installed in the docker container has been in an exit state, resulting in files that cannot be stored.

2. Solution

View containers installed in docker

Docker ps-a

Try to start the container

Docker start storage (or docker start "container ID")

If the container is still exiting after trying to start the container, delete the container

Docker container rm storage (or docker container rm "container ID")

Go to the / var/fdfs folder and delete the storage file

Cd / var/fdfssodo rm-r storage

Reinstall the storage container

Sudo docker run-dti-- network=host-- name storage-e TRACKER_SERVER=10.0.2.15 (intranet ip): 22122-v / var/fdfs/storage:/var/fdfs delron/fastdfs storage

Check to see if the container started successfully

3. Test whether the container can be used normally.

Note: to test in the django module of python, you need to install the fdfs_client module

Pip3 install fdfs_client

Enter the shell environment of django

Python manage.py shell

Write in a shell environment

From fdfs_client.client import Fdfs_client# client.conf is the configuration file fdfs = Fdfs_client ('utils/fastdfs/client.conf') # upload the file fdfs.upload_by_filename (' media/2018.png') by file name

Get the return response

Test whether the path is successful

Http://127.0.0.1:8888/group1/M00/00/00/CgACD17bAsqACuoXAAfh_rrm7jw614.png

This is what happens when docker uses storage and Exit causes files not to be uploaded to the server. If you have learned knowledge or skills, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report