summaryrefslogtreecommitdiffstats
path: root/gluster-s3object/CentOS/docker-gluster-s3/README.md
diff options
context:
space:
mode:
authorSaravanakumar <sarumuga@redhat.com>2017-06-29 17:58:56 +0530
committerSaravanakumar <sarumuga@redhat.com>2017-06-29 18:03:40 +0530
commit3e33c9640d2b4b2d15a21483c34bb48845fce7bf (patch)
tree740a0189b03506e48447b993d88a1149253e3ea4 /gluster-s3object/CentOS/docker-gluster-s3/README.md
parent8e29c3a6f749837e694a6cb031b8740935a62dc3 (diff)
downloadgluster-3e33c9640d2b4b2d15a21483c34bb48845fce7bf.tar.gz
gluster-3e33c9640d2b4b2d15a21483c34bb48845fce7bf.tar.bz2
gluster-3e33c9640d2b4b2d15a21483c34bb48845fce7bf.tar.xz
gluster-3e33c9640d2b4b2d15a21483c34bb48845fce7bf.zip
rename docker-gluster-swift as docker-gluster-s3 and the top
level directory gluster-object as gluster-s3object Update README and test scripts to reflect name change. Signed-off-by: Saravanakumar <sarumuga@redhat.com>
Diffstat (limited to 'gluster-s3object/CentOS/docker-gluster-s3/README.md')
-rw-r--r--gluster-s3object/CentOS/docker-gluster-s3/README.md109
1 files changed, 109 insertions, 0 deletions
diff --git a/gluster-s3object/CentOS/docker-gluster-s3/README.md b/gluster-s3object/CentOS/docker-gluster-s3/README.md
new file mode 100644
index 0000000..baa6d28
--- /dev/null
+++ b/gluster-s3object/CentOS/docker-gluster-s3/README.md
@@ -0,0 +1,109 @@
+
+# docker-gluster-s3
+docker-gluster-s3 is to provide object interface for a Gluster volume.
+
+Let us see how to run gluster-s3 inside a docker container.
+
+## Building
+
+```bash
+# docker build --rm --tag gluster-s3 .
+```
+
+## Running
+
+On the host machine, mount one or more gluster volumes under the directory
+`/mnt/gluster-object` with mountpoint name being same as that of the volume.
+
+For example, if you have two gluster volumes named `test` and `test2`, they
+should be mounted at `/mnt/gluster-object/test` and `/mnt/gluster-object/test2`
+respectively. This directory on the host machine containing all the individual
+glusterfs mounts is then bind-mounted inside the container. This avoids having
+to bind mount individual gluster volumes.
+
+The same needs to be updated in etc/sysconfig/swift-volumes.
+For example(in swift-volumes):
+GLUSTER_VOLUMES='tv1'
+
+Where tv1 is the volume name.
+
+**Example:**
+
+```bash
+# docker run -d --privileged -v /sys/fs/cgroup/:/sys/fs/cgroup/:ro -p 8080:8080 -v /mnt/gluster-object:/mnt/gluster-object -e GLUSTER_VOLUMES="tv1" gluster-s3
+```
+
+If you have selinux set to enforced on the host machine, refer to the
+Troubleshooting section below before running the container.
+
+**Note:**
+
+~~~
+-d : Runs the container in the background.
+-p : Publishes the container's port to the host port. They need not be the same.
+ If host port is omitted, a random port will be mapped. So you can run
+ multiple instances of the container, each serving on a different port on
+ the same host machine.
+-v : Bind mount a host path inside the container.
+-e : Set and pass environment variable. In our case, provide a list of volumes
+ to be exported over object inerface by setting GLUSTER_VOLUMES environment
+ variable.
+~~~
+
+### Custom deployment
+
+You can provide your own configuration files and ring files and have the
+swift processes running inside container use those. This can be done by
+placing your conf files and ring files in a directory on your host machine
+and then bind-mounting it inside the container at `/etc/swift`.
+
+**Example:**
+
+Assuming you have conf files and ring files present at `/tmp/swift` on the
+machine, you can spawn the container as follows:
+
+```bash
+# docker run -d -p 8080:8080 -v /tmp/swift:/etc/swift -v /mnt/gluster-object:/mnt/gluster-object gluster-s3
+```
+
+If the host machine has SELinux set to enforced:
+
+```bash
+# chcon -Rt svirt_sandbox_file_t /tmp/swift
+```
+
+### Troubleshooting
+
+**SELinux**
+
+When a volume is bind mounted inside the container, you'll need blessings of
+SELinux on the host machine. Otherwise, the application inside the container
+won't be able to access the volume. Example:
+
+```bash
+[root@f24 ~]# docker exec -i -t nostalgic_goodall /bin/bash
+[root@042abf4acc4d /]# ls /mnt/gluster-object/
+ls: cannot open directory /mnt/gluster-object/: Permission denied
+```
+
+Ideally, running this command on host machine should work:
+
+```bash
+# chcon -Rt svirt_sandbox_file_t /mnt/gluster-object
+```
+
+However, glusterfs does not support setting of SELinux contexts [yet][1].
+You can always set SELinux to permissive on host machine by running
+`setenforce 0` or run container in privileged mode (`--privileged=true`).
+I don't like either. A better workaround would be to mount the glusterfs
+volumes on host machine as shown in following example:
+
+[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1252627
+
+```bash
+mount -t glusterfs -o selinux,context="system_u:object_r:svirt_sandbox_file_t:s0" `hostname`:test /mnt/gluster-object/test
+```
+
+### TODO
+
+* Install gluster-s3 from RPMs. (Currently installed from source)