Skip to content

Instantly share code, notes, and snippets.

@harshavardhana
Last active July 13, 2021 15:40
Show Gist options
  • Save harshavardhana/0055fc7879e82fd6ebdfb3064109881f to your computer and use it in GitHub Desktop.
Save harshavardhana/0055fc7879e82fd6ebdfb3064109881f to your computer and use it in GitHub Desktop.
REX-Ray with Minio

Getting Started

The following command will install the latest version of REX-Ray to /usr/bin/rexray on Linux systems:

$ sudo apt install s3fs
$ curl -sSL https://dl.bintray.com/emccode/rexray/install | sh

Depending on the Linux distribution REX-Ray will be registered as either a SystemD or SystemV service.

Configure

REX-Ray requires a configuration file for storing details used to communicate with storage providers. This can include authentication credentials and driver specific configuration options. After REX-Ray has been installed, copy and paste the contents below to a new file on the host at /etc/rexray/config.yml to configure s3fs storage driver.

libstorage:
  service: s3fs
s3fs:
  accessKey: Q3AM3UQ867SPQQA43P2F
  secretKey: zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
  endpoint: https://play.minio.io:9000  
  region: us-east-1
  disablePathStyle: false 
  options:
  - url=https://play.minio.io:9000
  - use_path_request_style
  - nonempty

To verify the configuration file is working, use REX-Ray to list the volumes:

sudo rexray volume new testbucket
sudo rexray volume ls
ID                                                            Name                                                          Status    Size
testbucket                                                    testbucket                                                    attached  0

Start as service

Container platforms rely on REX-Ray to be running as a service to function properly. For instance, Docker communicates to the REX-Ray Volume Driver via a UNIX socket file.

sudo rexray service start

Mount a volume

After a volume has been created, the rexray volume mount command can be used to both attach and mount it to the current host:

sudo rexray volume mount testbucket
ID          Name        Status    Size  Path
testbucket  testbucket  attached  0     /var/lib/rexray/volumes/testbucket/data

Unmount a volume

Once a volume is no longer needed, the rexray volume unmount command will unmount the volume:

sudo rexray volume unmount
ID          Name        Status     Size
testbucket  testbucket  available  0
libstorage:
service: s3fs
s3fs:
accessKey: Q3AM3UQ867SPQQA43P2F
secretKey: zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
endpoint: https://play.minio.io:9000
region: us-east-1
disablePathStyle: false
options:
- url=https://play.minio.io:9000
- use_path_request_style
- allow_other
- nonempty
@harshavardhana
Copy link
Author

URLs have changed this is an older document @m-nouredini

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