minio / mc

Unix like utilities for object store
https://min.io/download
GNU Affero General Public License v3.0
2.86k stars 548 forks source link

Minio mirror strange behavior with ALIAS #4724

Closed yakhatape closed 1 year ago

yakhatape commented 1 year ago

I'm using minio for syncing logs from servers to specific bucket and bucket path by their environnement.

Expected behavior

No local directory created on filesystem using the ALIAS and Bucket PATH informations

Actual behavior

Minio client used as a systemd service :


[Unit]
Description=Minio client - Logs Synchronization

[Service]
Type=simple
ExecStart=/usr/local/bin/mc mirror --watch --overwrite /log/ MINIOS3/BucketsLogs/Production/%H
Nice=10
User=root
PIDFile=/var/run/minioS3.pid

[Install]
WantedBy=multi-user.target

So the final command executed by the binary looks like : /usr/local/bin/mc mirror --watch --overwrite /log/ MINIOS3/BucketsLogs/Production/PROmyServerName I've create my Alias (name : MINIOS3) without any problem etc.. but the client minio is duplicating data from the /log/ directory to a local directory (created by the client) with ALIAS+PATH information in the root folder "/" :

du -hs /MINIOS3/BucketsLogs/Production/PROmyServerName/*
3.8G    /MINIOS3/BucketsLogs/Production/PROmyServerName/fo_app

Which create a saturation of my "/" partition : /dev/mapper/vg_os-root 3.9G 3.8G 0 100% /

PS : /log/ directory data are correctly sent to the bucket in same time ... How can I remove this behavior on local filesytem ?

Steps to reproduce the behavior

mc --version

mc version RELEASE.2023-04-12T02-21-51Z (commit-id=1843717c57fb87612469b7610344a7d49d97a497)
Runtime: go1.20.3 linux/amd64
Copyright (c) 2015-2023 MinIO, Inc.
License GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>

System information

Operating System and version (uname -a): Linux PROmyServerName 3.10.0-1062.18.1.el7.x86_64 #1 SMP Tue Mar 17 23:49:17 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

yakhatape commented 1 year ago

After investigation on my side, I identify the following point :

1) We are using ansible to deploy the minio client

2) We identify inside the ansible code that minio service was started at the end of the deploiement but the ALIAS isn't managed on this step. So the minio Client start without any knowledge of the ALIAS referenced into the command which create this local directory.

3) sounds like minio client tell : "Oh I don't know this Alias so I will create it as a local directory"

4) minio client shoudn't return an error when an ALIAS doesn't exist into its config ?

harshavardhana commented 1 year ago
  • sounds like minio client tell : "Oh I don't know this Alias so I will create it as a local directory"
  • minio client shoudn't return an error when an ALIAS doesn't exist into its config ?

No that is not what the intention here is, if you do not have an alias it behaves like unix cp would in that scenario creating the directory and copying contents.

This is an expected designed behavior.