The problem and solution of using docker storage and causing Exit to cause files to fail to upload to the server

The problem and solution of using docker storage and causing Exit to cause files to fail to upload to the server

1. Problem description

The storage installed in the docker container has been in the exit state, resulting in the inability to store files.

2. Solution

View the containers installed in Docker

docker ps -a

Try starting the container

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

If the container is still in the exited state after trying to start it, delete the container

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

Enter the /var/fdfs folder and delete the storage file

cd /var/fdfs
sodo 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 whether the container is started successfully

3. Test whether the container can be used normally

Note: To test in Python's Django module, you need to install the fdfs_client module

pip3 install fdfs_client

Enter the Django shell environment

python manage.py shell

Write in the 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 by file name fdfs.upload_by_filename('media/2018.png')

Get the response back

Test whether the path is successful

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

Summarize

This is the end of this article about the problem and solution of docker using storage and exit causing files to be unable to upload to the server. For more related content about docker using storage and exit causing files to be unable to upload to the server, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • docker pure-ftp How to build an ftp server
  • Centos7 uses docker to build gitlab server
  • How to build a DNS server with Docker in 1 minute

<<:  SQL injection vulnerability process example and solution

>>:  MySQL MyISAM default storage engine implementation principle

Recommend

How to implement Docker to dynamically pass parameters to Springboot projects

background Recently, some friends who are new to ...

Let's talk in detail about the difference between unknown and any in TypeScript

Table of contents Preface 1. unknown vs any 2. Th...

Even a novice can understand the difference between typeof and instanceof in js

Table of contents 1. typeof 2. instanceof 3. Diff...

vsftpd virtual user based on MySql authentication

Table of contents 1. MySQL installation 1.2 Creat...

Automatically log out inactive users after login timeout in Linux

Method 1: Modify the .bashrc or .bash_profile fil...

How to copy MySQL table

Table of contents 1.mysqldump Execution process: ...

Eight common SQL usage examples in MySQL

Preface MySQL continued to maintain its strong gr...

MySql quick insert tens of millions of large data examples

In the field of data analysis, database is our go...

Implementation of VUE infinite level tree data structure display

Table of contents Component recursive call Using ...

Solution to the problem of not finding Tomcat configuration in Intelli Idea

I joined a new company these two days. The compan...

How to use the EXPLAIN command in SQL

In daily work, we sometimes run slow queries to r...

Some common properties of CSS

CSS background: background:#00ffee; //Set the back...

Solution to MySQL root password error number 1045

Stop MySQL Service Windows can right-click My Com...