Last active
January 18, 2021 23:14
-
-
Save donatello/f859b3481e5719e0945f71f509a2c089 to your computer and use it in GitHub Desktop.
Run Minio on localhost (4 node distributed on ports 9001-9004)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
uuid1="export1" | |
uuid2="export2" | |
uuid3="export3" | |
uuid4="export4" | |
DATA_DIR=/tmp | |
MINIO=$HOME/Code/minio/go/minio/minio | |
export MINIO_ACCESS_KEY="minio" | |
export MINIO_SECRET_KEY="minio123" | |
#export MINIO_HTTP_TRACE="/dev/stdout" | |
mkdir -p "${DATA_DIR}/$uuid1" "${DATA_DIR}/$uuid2" "${DATA_DIR}/$uuid3" "${DATA_DIR}/$uuid4" | |
mkdir -p "${DATA_DIR}/cfg-$uuid1/certs/CAs" "${DATA_DIR}/cfg-$uuid2/certs/CAs" "${DATA_DIR}/cfg-$uuid3/certs/CAs" "${DATA_DIR}/cfg-$uuid4/certs/CAs" | |
mkdir -p "${DATA_DIR}/certs-tmp" | |
(cd ${DATA_DIR}/certs-tmp && \ | |
openssl ecparam -genkey -name prime256v1 | openssl ec -out private.key && \ | |
openssl req -new -x509 -days 3650 -key private.key -out public.crt -subj "/C=US/ST=state/L=location/O=organization/CN=localhost" && \ | |
cp private.key public.crt ${DATA_DIR}/cfg-$uuid1/certs && \ | |
cp private.key public.crt ${DATA_DIR}/cfg-$uuid2/certs && \ | |
cp private.key public.crt ${DATA_DIR}/cfg-$uuid3/certs && \ | |
cp private.key public.crt ${DATA_DIR}/cfg-$uuid4/certs && \ | |
cp public.crt ${DATA_DIR}/cfg-$uuid1/certs/CAs && \ | |
cp public.crt ${DATA_DIR}/cfg-$uuid2/certs/CAs && \ | |
cp public.crt ${DATA_DIR}/cfg-$uuid3/certs/CAs && \ | |
cp public.crt ${DATA_DIR}/cfg-$uuid4/certs/CAs && \ | |
rm -rf ../certs-tmp | |
) | |
${MINIO} server -C ${DATA_DIR}/cfg-$uuid1 --address localhost:9001 "https://localhost:9001${DATA_DIR}/${uuid1}" "https://localhost:9002${DATA_DIR}/${uuid2}" "https://localhost:9003${DATA_DIR}/${uuid3}" "https://localhost:9004${DATA_DIR}/${uuid4}"& | |
${MINIO} server -C ${DATA_DIR}/cfg-$uuid2 --address localhost:9002 "https://localhost:9001${DATA_DIR}/${uuid1}" "https://localhost:9002${DATA_DIR}/${uuid2}" "https://localhost:9003${DATA_DIR}/${uuid3}" "https://localhost:9004${DATA_DIR}/${uuid4}"& | |
${MINIO} server -C ${DATA_DIR}/cfg-$uuid3 --address localhost:9003 "https://localhost:9001${DATA_DIR}/${uuid1}" "https://localhost:9002${DATA_DIR}/${uuid2}" "https://localhost:9003${DATA_DIR}/${uuid3}" "https://localhost:9004${DATA_DIR}/${uuid4}"& | |
${MINIO} server -C ${DATA_DIR}/cfg-$uuid4 --address localhost:9004 "https://localhost:9001${DATA_DIR}/${uuid1}" "https://localhost:9002${DATA_DIR}/${uuid2}" "https://localhost:9003${DATA_DIR}/${uuid3}" "https://localhost:9004${DATA_DIR}/${uuid4}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment