Minio is an object storage server that can be used in projects to store files instead of local or FTP storage.

This article focuses on building a file storage server using MinIO. When I was working on file storage recently, I wanted to learn about this minio, but I found it started, but I could not access it in the browser. It’s on record.

WARNING: Console endpoint is listening on a dynamic port (34451), please use –console-address “:PORT” to choose a static port.

Cover location: Shaoyang, Hunan

Author: xi

Docker install Minio Client, but also to solve how to set up permanent access and permanent download links!!

2. Set SpringBoot to Minio 👩💻

Docker searches for Minio images

docker search minio
Copy the code

Docker pulls the Minio image

docker pull minio/minio
Copy the code

Note: We did not specify a version. By default, the image pulled is the latest version.

Docker starts the Minio image

MInio has been updated recently.

Update previous commands:

Our previous start command looked like this:

docker run  -d -p 9000:9000  --name myminio -e "MINIO_ROOT_USER=minioadmin" -e "MINIO_ROOT_PASSWORD=minioadmin" -v /home/minio/data:/data minio/minio server /data
Copy the code

Explanation:

  1. Docker run: Docker start container command

  2. -d: background startup

  3. -p: indicates port mapping

  4. –name Gives the container a name

  5. -e: sets environment variables

  6. -v: mounts files

  7. Minio /minio server /data: start command of minio

    (minio/minio is the image name, /data: data store location)

Starting with the original command, the browser is not accessible.

Let’s go to http://ip:9000 through a browser

We won’t be able to access it. That’s when I checked the log again.

WARNING: Console endpoint is listening on a dynamic port (34451), please use --console-address ":PORT" to choose a static port.
WARNING: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables
Copy the code

Throws out a warning:

Warning: Console endpoint is listening on dynamic port (34451), select static port using –Console address” : port”.

He said let me add it to the command, select the static port. I can’t. I just have to listen to it.

Docker stop < container ID ># Pause containerDocker rm < container ID >Delete the stopped container
Copy the code

As it asked, I started to reboot again.

docker run -d \
  -p 9000:9000 \
  --name minio1 \
  -v /home/minio/data:/data \
  -e "MINIO_ROOT_USER=admin" \
  -e "MINIO_ROOT_PASSWORD=admin" \
  minio/minio server /data --console-address ": 9000"
Copy the code

Then the start command is changed to 👆.

After starting, I use Docker Logs < container ID > to look at the logs

Findings:

ERROR Unable to start the server: --console-address cannot be same as --address
Copy the code

Throw error: cannot start server: – Console address cannot be the same as — address

Then I had to check the website.

Is below 👇 after the update

After the update command:

# Recently updated command
docker run -d \
  -p 9000:9000 \
  -p 9001:9001 \
  --name minio1 \
  -v /home/minio/data:/data \
  -e "MINIO_ROOT_USER=AKIAIOSFODNN7EXAMPLE" \
  -e "MINIO_ROOT_PASSWORD=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
  minio/minio server /data --console-address ": 9001"
Copy the code

The update added a port mapping.

I didn’t find the reason for this on the Minio website until I looked at the version changes on Github. This requires us to specify the port mapping for the console, which is different from minio Server.

Github.com/minio/minio…Note: Minio’s console has also been updated. = =

Note: Since minio Console and Minio Server require different ports, be sure to configure security groups on Aliyun or Tencent Cloud. One $9,000 is not enough. At that time in the official website to see the reason, seems to be for better management to do this update, and so on to find the reason of the link I put up (dog head 🐶 to save life),

self-talk

Always be curious and always learn.

SpringBoot integration will be released tomorrow, so don’t worry, so we can build our own file server. 🛌