Home >Operation and Maintenance >Linux Operation and Maintenance >How to use docker to install minio under linux
1. Pull the minio image
pull minio/minio
2. Create two Directory
mkdir -p /usr/local/minio/data mkdir -p /usr/local/minio/config
3. Start the container and run it in the background.
docker run \ --name minio \ #docker 镜像名称 -p 9000:9000 \ #服务端口号 -p 9001:9001 \ #映射端口号 -d --restart=always \ #docker设置容器随系统开机启动 minio -e "MINIO_ACCESS_KEY=admin" \ #登录用户名 -e "MINIO_SECRET_KEY=admin123456" \ #登录密码 -v "/usr/local/minio/data":"/data" \ # 存储文件位置 -v "/usr/local/minio/config":"/root/.minio" \ # 配置文件位置 minio/minio server /data --console-address ":9001" \ #启动服务对外端口号 访问主机ip+9001 就能打开
The complete command can be copied directly
docker run --name minio -p 9000:9000 -p 9001:9001 -d --restart=always -e "MINIO_ACCESS_KEY=admin" -e "MINIO_SECRET_KEY=admin123456" -v "/usr/local/minio/data":"/data" -v "/usr/local/minio/config":"/root/.minio" minio/minio server /data --console-address ":9001"
4. Check the startup status
docker ps -a
C:\Users\youth>docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a6f0af2430c5 minio/minio "/usr/bin/docker-ent…" 30 minutes ago Up 30 minutes 0.0.0.0:9000-9001->9000-9001/tcp minio
The port number displayed in PORTS is explained. The startup is successful, log in and check according to the ip port number
5. Abnormal situation
When minio does not start normally:
Query minio first Mirror
docker ps -a
Then query the minio error log based on minio’s CONTAINER ID
docker logs ~~CONTAINER ID~~ (填自己minio的CONTAINER ID)
Process according to the log.
My own situation:
1. I checked a lot of documents and found that there were no double quotes when configuring the file path, which caused me to change a lot. The document still cannot be started. After adding double quotes, the problem is solved. I don’t know if this is an example, but it is a reference.
2. After modifying the running command, you still need to do a few related operations
1) If minio restarts infinitely, use the following command to stop it
docker stop ~~CONTAINER ID~~ (填自己minio的CONTAINER ID)
2) When re-running minio, first check whether the original image has been generated
docker ps -a
If it exists, delete it and then run the new command to start minio
docker rmi [image]
Or
docker rm ~~CONTAINER ID~~ (填自己minio的CONTAINER ID)
just write it here first, and add more when you encounter new problems later.
Log in to the minio web page and click About in the upper right corner
Log in to a Linux with Internet access and Docker installed
#拉取镜像 docker pull minio/miniorrree
Method one (command line):
#在当前目录生成镜像的tar包 docker save -o minio.tar minio/minio
Method two (transfer tool):
#scp方式上传 scp [filename] [user]@[ip] 远程传输文件 scp -r ./* root@8.134.50.9:/opt/app-service/my-pro #输入root账号密码
4. Load the installation package into the image
#使用FZ之类的xftp工具
5. Run minio Mirror
docker load -i minio.tar
Parameter interpretation:
-p
: Specify the host port and container exposed interface
–name
: Specify the container name
-d
: Run in the background
–restart
: Whether to restart
-e
: Environment configuration
-v
: The container file is mounted on the host machine
##minio/
minio: Container name
server: Start
/data: Specify the storage file directory
. -v: The container file is mounted on the host machine
/minio
:Container name
:Start
:Specify the storage file directory
The above is the detailed content of How to use docker to install minio under linux. For more information, please follow other related articles on the PHP Chinese website!