-
Notifications
You must be signed in to change notification settings - Fork 0
mc mirror testing
Allan Roger Reid edited this page Dec 4, 2024
·
2 revisions
ssh -p 20431 [email protected] -o "ServerAliveInterval=5" -o "ServerAliveCountMax=100000" -o "StrictHostKeyChecking=off"
ssh -p 20673 [email protected] -o "ServerAliveInterval=5" -o "ServerAliveCountMax=100000" -o "StrictHostKeyChecking=off"
rm -rf certgen-linux-amd64
wget http://github.com/minio/certgen/releases/latest/download/certgen-linux-amd64
chmod +x certgen-linux-amd64
./certgen-linux-amd64 -host "127.0.0.1"
mkdir -p ~/.minio/certs/CAs
cp public.crt ~/.minio/certs
cp private.key ~/.minio/certs
loginctl enable-linger ubuntu
wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
mkdir data
./minio server data --address :9000 --console-address :9090 --certs-dir ~/.minio/certs & >> /tmp/minio.log
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
sudo mv mc /usr/local/bin
mc alias set source https://mc-mirror-source.lab.min.dev:9000 minioadmin minioadmin
mc alias set target https://mc-mirror-target.lab.min.dev:9000 minioadmin minioadmin
mkdir source
cd source
dd if=/dev/urandom bs=1M count=128 iflag=fullblock of=object
cd ~
mkdir -p ~/raw/prefix
cd ~/raw
split -b 1MiB --additional-suffix=.ext ~/source/object object
split -b 1MiB --additional-suffix=.jpg ~/source/object object
cd ~/raw/prefix
split -b 1MiB --additional-suffix=.pdf ~/source/object object
split -b 1MiB --additional-suffix=.doc ~/source/object object
split -b 1MiB --additional-suffix=.txt ~/source/object object
ls -1 ~/raw | wc -l
ls -1 ~/raw/prefix | wc -l
#### 257 (-1)
#### 384
#### = 640
mc ls source/
mc rm source/unversioned
mc mb source/unversioned
mc mirror --watch --overwrite --preserve ~/raw/ source/unversioned/raw/
mc cp --recursive ~/raw/ source/unversioned/raw
mc mb target/unversioned
mc ls source/unversioned
mc mirror --watch --overwrite --preserve source/unversioned/raw/ target/unversioned/raw/
mc ls --recursive --summarize target/
#### Total Size: 640 MiB
#### Total Objects: 640
cd ~/raw/prefix
split -b 2MiB --additional-suffix=.pdf ~/source/object object
split -b 3MiB --additional-suffix=.doc ~/source/object object
split -b 4MiB --additional-suffix=.txt ~/source/object object
ls -1 ~/raw | wc -l
ls -1 ~/raw/prefix | wc -l
#### 257 (-1)
#### 384
#### = 640
mc ls --recursive --summarize target/
#### Total Size: 885 MiB
#### Total Objects: 640
mc rm --recursive --force source/unversioned/raw/prefix
mc ls --recursive --summarize source/unversioned/raw/prefix
#### Total Size: 0 B
#### Total Objects: 0
mc ls --recursive --summarize target/unversioned/raw/prefix
#### Total Size: 0 B
#### Total Objects: 0
mc ls --recursive --summarize target/
#### Total Size: 256 MiB
#### Total Objects: 256
mc tree --files source/unversioned | grep prefix
mc tree --files target/unversioned | grep prefix
--
mc ls source/
mc rb --force source/versioned
mc mb source/versioned
mc rb --force target/versioned
mc mb target/versioned
mc version enable source/versioned
mc version enable target/versioned
mkdir -p raw_versioned/prefix
rm -rf ~/raw_versioned/*
mc mirror --watch --overwrite --preserve ~/raw_versioned source/versioned/raw
mc mirror --watch --overwrite --preserve source/versioned/raw target/versioned
cp -R ~/raw ~/raw_versioned
cp -R ~/raw ~/raw_versioned
cp -R ~/raw ~/raw_versioned
FLAG - second trigger s3s3 will not take effect. It must be recreated. Data is intact FLAG - even though all copying is finished on fs, versions will be missing on f3s3 mirror; thus s3s3 is also broken FLAG - everything below is happy path only
mc ls --recursive --summarize source/versioned/raw
#### Total Size: 885 MiB
#### Total Objects: 640
mc ls --recursive --summarize --versions source/versioned/raw
#### Total Size: 2.6 GiB
#### Total Objects: 1920
mc ls --recursive --summarize target/versioned/raw
#### Total Size: 885 MiB
#### Total Objects: 640
mc ls --recursive --summarize --versions target/versioned/raw
#### Total Size: 885 MiB
#### Total Objects: 640
mc ls --recursive --summarize source/versioned/raw/raw/prefix
Total Size: 629 MiB
Total Objects: 384
mc ls --recursive --summarize --versions source/versioned/raw/raw/prefix
Total Size: 1.8 GiB
Total Objects: 1152
mc rm --recursive --force source/versioned/raw/raw/prefix
mc ls --recursive --summarize source/versioned/raw/raw/prefix
Total Size: 0 B
Total Objects: 0
mc ls --recursive --summarize --versions source/versioned/raw/raw/prefix
Total Size: 1.8 GiB
Total Objects: 1536
mc ls --recursive --summarize target/versioned/raw/prefix
Total Size: 629 MiB
Total Objects: 384
mc ls --recursive --summarize --versions target/versioned/raw/prefix
Total Size: 629 MiB
Total Objects:
--json flag creates a json stream which must be .. streamed