Skip to content

Instantly share code, notes, and snippets.

@harshavardhana
Last active July 13, 2021 15:40
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • 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
@TuanAnhBien
Copy link

Hi @harshavardhana , i got a problem when run command: sudo rexray volume mount testbucket444, like below:
FATA[0000] error mounting volume error=open testbucket444: no such file or directory volume=testbucket444

I'm using:

  • rexray v0.10.2,
  • docker v1.13.1
  • ubuntu 14.04

@prein
Copy link

prein commented Oct 4, 2017

Thanks for sharing your config. Very helpful. Worked like a charm.

Do you know of any way to make it work as docker managed plugin? It doesn't accept S3FS_ENDPOINT variable. I'm trying to install rexray/s3fs:edge

@zjuchenyuan
Copy link

@TuanAnhBien
Hi, I also encountered the same problem, but I fixed it by

apt install s3fs

@Sovetnikov
Copy link

Docker managed plugin solution example will be great, since minfs docker plugin works like a charm
With rexray i have troubles starting from installing docker plugin and then configuring it with custom endpoint.
And i have no idea how to configure it in docker-compose as it requires endpoint keys to be provided at plugin creation time...

@harshavardhana
Copy link
Author

Docker managed plugin solution example will be great, since minfs docker plugin works like a charm

MinFS is deprecated you shouldn't use it. @Sovetnikov

@milewski
Copy link

do you know how to set the configuration when installing it by docker plugin install rexray/s3fs ?

@zx1986
Copy link

zx1986 commented Sep 12, 2018

do you know how to set the configuration when installing it by docker plugin install rexray/s3fs ?

I am looking for the solution too ...


https://blog.vizuri.com/practical-persistent-cloud-storage-for-docker-in-aws-using-rexray-pt-1

@merajnouredini
Copy link

I got an error when tried to install using curl -sSL https://dl.bintray.com/emccode/rexray/install | sh command, using curl -sSL https://rexray.io/install | sh everything worked fine

@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