github.com/minio/minio@v0.0.0-20240328213742-3f72439b8a27/docs/bucket/replication/sio-error.sh (about) 1 #!/bin/bash 2 3 echo "Running $0" 4 5 set -e 6 set -x 7 8 export CI=1 9 10 make || exit 255 11 12 killall -9 minio || true 13 14 rm -rf /tmp/xl/ 15 mkdir -p /tmp/xl/1/ /tmp/xl/2/ 16 17 export MINIO_KMS_SECRET_KEY="my-minio-key:OSMM+vkKUTCvQs9YL/CVMIMt43HFhkUpqJxTmGl6rYw=" 18 19 NODES=4 20 21 args1=() 22 args2=() 23 for i in $(seq 1 $NODES); do 24 args1+=("http://localhost:$((9000 + i))/tmp/xl/1/$i ") 25 args2+=("http://localhost:$((9100 + i))/tmp/xl/2/$i ") 26 done 27 28 for i in $(seq 1 $NODES); do 29 ./minio server --address "127.0.0.1:$((9000 + i))" ${args1[@]} & # | tee /tmp/minio/node.$i & 30 ./minio server --address "127.0.0.1:$((9100 + i))" ${args2[@]} & # | tee /tmp/minio/node.$i & 31 done 32 33 sleep 10 34 35 ./mc alias set myminio1 http://localhost:9001 minioadmin minioadmin 36 ./mc alias set myminio2 http://localhost:9101 minioadmin minioadmin 37 38 sleep 1 39 40 ./mc mb myminio1/testbucket/ --with-lock 41 ./mc mb myminio2/testbucket/ --with-lock 42 43 ./mc encrypt set sse-s3 my-minio-key myminio1/testbucket/ 44 ./mc encrypt set sse-s3 my-minio-key myminio2/testbucket/ 45 46 ./mc replicate add myminio1/testbucket --remote-bucket http://minioadmin:minioadmin@localhost:9101/testbucket --priority 1 47 ./mc replicate add myminio2/testbucket --remote-bucket http://minioadmin:minioadmin@localhost:9001/testbucket --priority 1 48 49 sleep 1 50 51 cp README.md internal.tar 52 53 ./mc cp internal.tar myminio1/testbucket/dir/1.tar 54 ./mc cp internal.tar myminio2/testbucket/dir/2.tar 55 56 sleep 1 57 58 ./mc ls -r --versions myminio1/testbucket/dir/ >/tmp/dir_1.txt 59 ./mc ls -r --versions myminio2/testbucket/dir/ >/tmp/dir_2.txt 60 61 out=$(diff -qpruN /tmp/dir_1.txt /tmp/dir_2.txt) 62 ret=$? 63 if [ $ret -ne 0 ]; then 64 echo "BUG: expected no 'diff' after replication: $out" 65 exit 1 66 fi