Skip to content

Instantly share code, notes, and snippets.

@TJC
Created January 5, 2017 01:28
Show Gist options
  • Select an option

  • Save TJC/00a4984925771ee6c93390ef62514dd5 to your computer and use it in GitHub Desktop.

Select an option

Save TJC/00a4984925771ee6c93390ef62514dd5 to your computer and use it in GitHub Desktop.
Test Minio resiliency
#!/bin/bash
echo "first file is ok" > first.txt
echo "second file is ok" > second.txt
echo "third file is ok" > third.txt
docker-compose up -d
echo "Waiting for docker compose for 10 seconds"
echo "Note: this demo assumes you've configured mc to have an endpoint called local configured...."
sleep 10
mc mb local/test
mc cp first.txt local/test/
mc cp second.txt local/test/
sleep 1
echo "Stopping a single server"
docker stop miniio_minio3_1
sleep 2
mc cp third.txt local/test/
sleep 2
echo "Starting a single server"
docker start miniio_minio3_1
sleep 2
mc cat local/test/first.txt
mc cat local/test/second.txt
mc cat local/test/third.txt
mc cat local/test/third.txt
mc cat local/test/third.txt
mc cat local/test/third.txt
mc cat local/test/third.txt
mc cat local/test/third.txt
mc cat local/test/third.txt
docker-compose down
@TJC

TJC commented Jan 5, 2017

Copy link
Copy Markdown
Author

Output includes:

Stopping a single server
miniio_minio3_1
third.txt:           11 B / 11 B ┃▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓┃ 100.00% 225 B/s 0s
Starting a single server
miniio_minio3_1
first file
second file
third file
third file
mc: <ERROR> Unable to read from ‘local/test/third.txt’. Object key is missing, object key cannot be empty
mc: <ERROR> Unable to read from ‘local/test/third.txt’. Object key is missing, object key cannot be empty
mc: <ERROR> Unable to read from ‘local/test/third.txt’. Object key is missing, object key cannot be empty
mc: <ERROR> Unable to read from ‘local/test/third.txt’. Object key is missing, object key cannot be empty
mc: <ERROR> Unable to read from ‘local/test/third.txt’. Object key is missing, object key cannot be empty

@TJC

TJC commented Jan 5, 2017

Copy link
Copy Markdown
Author

Debug output of mc:

 mc cat --debug local/test/third.txt
mc: <DEBUG> GET /test/?location= HTTP/1.1
Host: 127.0.0.1:9001
User-Agent: Minio (linux; amd64) minio-go/2.0.2 mc/2016-12-09T18:23:19Z
Authorization: AWS4-HMAC-SHA256 Credential=minio/20170105/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20170105T014908Z
Accept-Encoding: gzip

mc: <DEBUG> HTTP/1.1 200 OK
Transfer-Encoding: chunked
Accept-Ranges: bytes
Content-Type: text/xml; charset=utf-8
Date: Thu, 05 Jan 2017 01:49:08 GMT
Server: Minio/DEVELOPMENT.2017-01-04T07-40-17Z (linux; amd64)
Vary: Origin
X-Amz-Request-Id: 5A3KQHTJKU986DRH

mc: <DEBUG> Response Time:  2.623434ms

mc: <DEBUG> GET /test/?delimiter=%2F&max-keys=1000&prefix=third.txt HTTP/1.1
Host: 127.0.0.1:9001
User-Agent: Minio (linux; amd64) minio-go/2.0.2 mc/2016-12-09T18:23:19Z
Authorization: AWS4-HMAC-SHA256 Credential=minio/20170105/us-east-1/s3/aws4_request, SignedHeaders=expect;host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
Expect: 100-continue
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20170105T014908Z
Accept-Encoding: gzip

mc: <DEBUG> HTTP/1.1 200 OK
Transfer-Encoding: chunked
Accept-Ranges: bytes
Content-Type: text/xml; charset=utf-8
Date: Thu, 05 Jan 2017 01:49:08 GMT
Server: Minio/DEVELOPMENT.2017-01-04T07-40-17Z (linux; amd64)
Vary: Origin
X-Amz-Request-Id: 98VDW3307XOQ60BN

mc: <DEBUG> Response Time:  4.971528ms

mc: <ERROR> Unable to read from ‘local/test/third.txt’. Object key is missing, object key cannot be empty
 (3) cat-main.go:169 cmd.mainCat(..) Tags: [local/test/third.txt]
 (2) cat-main.go:87 cmd.catURL(..) Tags: [local/test/third.txt]
 (1) client-url.go:187 cmd.url2Stat(..) Tags: [local/test/third.txt]
 (0) client-s3.go:826 cmd.(*s3Client).Stat(..)
 Release-Tag:RELEASE.2016-12-09T18-23-19Z | Commit:64166319eeae | Host:adonai | OS:linux | Arch:amd64 | Lang:go1.7.3 | Mem:1.9MB/5.2MB | Heap:1.9MB/3.7MB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment