Problems encountered
There is a Docker container that has been running. Because the server is downsized, the container cannot be started. The following error is reported
The reason is that the CPU usage was specified when the container was started. Now the CPU usage is reduced to 1C4G, which results in an error when the container is started.
The solution is as simple as restarting a container with the same image. However, because the container is MongoDB, volume needs to be configured, but there is no command to start, and I do not know where to run.
The solution
Start information can be analyzed by checking the container information through Docker inspect. As follows:
Based on the analyzed information, start the container:
docker run -d -p 27017:27017 --mount teyp=bind,source=/data/mongo/mongod.conf.27017,target=/etc/mongod.conf --mount type=bind,source=/data/mongo/27017,target=/mongo --mount type=bind,source=/etc/localtime,target=/etc/localtime --name mongo_2021 ojhtyy/mongo -f /etc/mongod.conf
Copy the code
/etc/mongod. Conf/mongo.conf/mongo.conf /etc/ mongo.conf/mongo.conf /etc/ mongo.conf /etc/ mongo.conf /etc/ mongo.conf /etc/ mongo.conf /etc/ mongo.conf /etc/ mongo.conf /etc/ mongo.conf
docker inspect
Reference: docs.docker.com/engine/refe…