Skip to content

Instantly share code, notes, and snippets.

@maedoc
Last active December 2, 2022 08:10
Show Gist options
  • Save maedoc/74acf613f19e2658c8dbf09ba415f8d6 to your computer and use it in GitHub Desktop.
Save maedoc/74acf613f19e2658c8dbf09ba415f8d6 to your computer and use it in GitHub Desktop.
Minio testing
# debug w/ make -r -R --debug -n
#
# TODO try deployment expansion
# TODO integrate with iam & key server
# TODO test fuse fs performance
# TODO try replication
disk_size=4G
disk_count=1
big_gb=2
disks = $(foreach var,$(shell seq $(disk_count)),disk$(var))
# https://min.io/docs/minio/linux/operations/concepts/erasure-coding.html
export MINIO_STORAGE_CLASS_STANDARD=EC:4
export MINIO_STORAGE_CLASS_RRS=EC:2
run: setup mc big.rand
./mc alias set test http://127.0.0.1:9000 minioadmin minioadmin
./mc mb test/test
./mc cp big.rand test/test/big.rand
du -h -d1 | head -n2
./mc cp big.rand test/test/big-copy.rand
du -h -d1 | head -n2
./mc cp --storage-class REDUCED_REDUNDANCY big2.rand test/test/big.rand
du -h -d1 | head -n2
./mc rm test/test/big.rand
setup: minio.pid
df -h | grep disk
disk%:
truncate -s $(disk_size) [email protected]
mkfs.xfs [email protected]
mkdir -p $@
sudo mount [email protected] $@
sudo chown -R $(shell whoami) $@
minio.pid: $(disks) minio
#./minio server disk{1...$(disk_count)} &> minio.log
./minio server disk1 &
pgrep minio > $@
stop-minio:
kill -2 $$(cat minio.pid) || true
rm -fv minio.pid
clean: stop-minio
for d in $(disks); do sudo umount $$d || true; done
rm -rfv disk*
rm -fv disk*.xfs
rm -fv big.rand
rm -fv minio.log
# don't remove stuff
.SECONDARY:
minio:
wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
mc:
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
big.rand:
dd if=/dev/random of=big.rand bs=1G count=$(big_gb)
dd if=/dev/random of=big2.rand bs=1G count=$(big_gb)
# I should really use ansible but too lazy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment