Home > Operation and Maintenance > Linux Operation and Maintenance > How to use docker to install minio under linux

How to use docker to install minio under linux

WBOY
Release: 2023-05-17 22:37:04
forward
1984 people have browsed it

    docker install minio

    1. Pull the minio image

    pull minio/minio
    Copy after login

    2. Create two Directory

    mkdir -p /usr/local/minio/data
    mkdir -p /usr/local/minio/config
    Copy after login

    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 就能打开
    Copy after login

    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"
    Copy after login

    4. Check the startup status

    docker ps -a
    Copy after login
    Copy after login
    Copy after login
    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
    Copy after login

    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
    Copy after login
    Copy after login
    Copy after login

    Then query the minio error log based on minio’s CONTAINER ID

    docker logs ~~CONTAINER ID~~ (填自己minio的CONTAINER ID)
    Copy after login

    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.

    How to use docker to install minio under linux

    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)
    Copy after login

    2) When re-running minio, first check whether the original image has been generated

    docker ps -a
    Copy after login
    Copy after login
    Copy after login

    If it exists, delete it and then run the new command to start minio

    docker rmi [image]
    Copy after login

    Or

    docker rm ~~CONTAINER ID~~ (填自己minio的CONTAINER ID)
    Copy after login

    just write it here first, and add more when you encounter new problems later.

    docker offline (upgrade) installation of MINIO

    1. View the version

    Log in to the minio web page and click About in the upper right corner

    How to use docker to install minio under linux

    How to use docker to install minio under linux

    2. Local installation

    Log in to a Linux with Internet access and Docker installed

    #拉取镜像
    docker pull minio/minio
    Copy after login
    rrree

    3. Upload the package to the server

    Method one (command line):

    #在当前目录生成镜像的tar包
    docker save  -o minio.tar minio/minio
    Copy after login

    Method two (transfer tool):

    #scp方式上传
    scp [filename] [user]@[ip] 远程传输文件
    scp -r ./* root@8.134.50.9:/opt/app-service/my-pro
    #输入root账号密码
    Copy after login

    4. Load the installation package into the image

    #使用FZ之类的xftp工具
    Copy after login

    5. Run minio Mirror

    docker load -i minio.tar
    Copy after login

    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

      /minio :Container name

    • server

      :Start

    • /data

      :Specify the storage file directory

    • Tip: If you encounter problems with the browser being unable to log in, do not use the latest version. It should be that the latest version of the command or configuration has not been applied to Docker

    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!

    Related labels:
    source:yisu.com
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template