diff options
author | Humble Devassy Chirammal <humble.devassy@gmail.com> | 2017-08-07 09:37:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-07 09:37:23 +0000 |
commit | ef2078234bc1a18c5ebefa62d21f12149b4c9e80 (patch) | |
tree | 07ce370ef808ff36fbdf42f62935c59b851c23ce | |
parent | e5da35f7f83b2be0b78aadc1056a5dd9d77f4835 (diff) | |
parent | d301d192ce98f40ffb683ea61d9b1ee90aee60b4 (diff) | |
download | gluster-ef2078234bc1a18c5ebefa62d21f12149b4c9e80.tar.gz gluster-ef2078234bc1a18c5ebefa62d21f12149b4c9e80.tar.bz2 gluster-ef2078234bc1a18c5ebefa62d21f12149b4c9e80.tar.xz gluster-ef2078234bc1a18c5ebefa62d21f12149b4c9e80.zip |
Merge pull request #51 from SaravanaStorageNetwork/use_s3_account
Rename variables
8 files changed, 23 insertions, 23 deletions
diff --git a/.travis.yml b/.travis.yml index cc7ecb5..78f0592 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ before_install: - sleep 10 - docker exec -it gfedora systemctl is-active glusterd - docker build -t gluster/s3object ./gluster-s3object/CentOS/docker-gluster-s3/ -- docker run -d --name s3object --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -e GLUSTER_VOLUMES=vol -e GLUSTER_USER="admin" -e GLUSTER_PASSWORD="redhat" gluster/s3object +- docker run -d --name s3object --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -e S3_ACCOUNT=vol -e S3_USER="admin" -e S3_PASSWORD="redhat" gluster/s3object - sleep 10 - docker exec -it s3object systemctl is-active swift-object @@ -137,12 +137,12 @@ 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' +S3_ACCOUNT='tv1' Where tv1 is the volume name. ~~~ -$ docker run -d --privileged -v /sys/fs/cgroup/:/sys/fs/cgroup/:ro -p 8080:8080 -v /mnt/gluster-object:/mnt/gluster-object gluster/gluster-s3 +$ docker run -d --privileged -v /sys/fs/cgroup/:/sys/fs/cgroup/:ro -p 8080:8080 -v /mnt/gluster-object:/mnt/gluster-object -e S3_ACCOUNT="tv1" -e S3_USER="admin" -e S3_PASSWORD="redhat" gluster/gluster-s3 ~~~ Now, We can get/put objects into the gluster volume, using the gluster-s3 Docker container. diff --git a/gluster-s3object/CentOS/docker-gluster-s3/README.md b/gluster-s3object/CentOS/docker-gluster-s3/README.md index a8bd935..8b3e151 100644 --- a/gluster-s3object/CentOS/docker-gluster-s3/README.md +++ b/gluster-s3object/CentOS/docker-gluster-s3/README.md @@ -23,14 +23,14 @@ 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' +S3_ACCOUNT='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" -e GLUSTER_USER="admin" -e GLUSTER_PASSWORD="redhat" gluster-s3 +# docker run -d --privileged -v /sys/fs/cgroup/:/sys/fs/cgroup/:ro -p 8080:8080 -v /mnt/gluster-object:/mnt/gluster-object -e S3_ACCOUNT="tv1" -e S3_USER="admin" -e S3_PASSWORD="redhat" gluster-s3 ``` If you have selinux set to enforced on the host machine, refer to the @@ -46,7 +46,7 @@ Troubleshooting section below before running the container. 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 + to be exported over object inerface by setting S3_ACCOUNT environment variable. ~~~ diff --git a/gluster-s3object/CentOS/docker-gluster-s3/etc/sysconfig/swift-volumes b/gluster-s3object/CentOS/docker-gluster-s3/etc/sysconfig/swift-volumes index 3aeb7ec..83b3a33 100644 --- a/gluster-s3object/CentOS/docker-gluster-s3/etc/sysconfig/swift-volumes +++ b/gluster-s3object/CentOS/docker-gluster-s3/etc/sysconfig/swift-volumes @@ -1,4 +1,4 @@ # Set Gluster volumes to be used by gluster-object service -GLUSTER_VOLUMES="tv1" -GLUSTER_USER="admin" -GLUSTER_PASSWORD="redhat" +S3_ACCOUNT="tv1" +S3_USER="admin" +S3_PASSWORD="redhat" diff --git a/gluster-s3object/CentOS/docker-gluster-s3/gluster-swift-add-user b/gluster-s3object/CentOS/docker-gluster-s3/gluster-swift-add-user index 59eb1b2..0b4262b 100755 --- a/gluster-s3object/CentOS/docker-gluster-s3/gluster-swift-add-user +++ b/gluster-s3object/CentOS/docker-gluster-s3/gluster-swift-add-user @@ -1,13 +1,13 @@ #!/bin/bash if [ "$#" -lt 3 ]; then - echo "Incorrect args. invoke gluster-swift-add-user $GLUSTER_USER $GLUSTER_PASSWORD $GLUSTER_VOLUMES" + echo "Incorrect args. invoke gluster-swift-add-user $S3_USER $S3_PASSWORD $S3_ACCOUNT" exit 1 else - GLUSTER_USER=$1 - GLUSTER_PASSWORD=$2 - GLUSTER_VOLUMES=$(echo $3 | cut -d" " -f1) + S3_USER=$1 + S3_PASSWORD=$2 + S3_ACCOUNT=$(echo $3 | cut -d" " -f1) sleep 5 gswauth-prep -A http://0.0.0.0:8080/auth -K gswauthkey - gswauth-add-account -K gswauthkey $GLUSTER_VOLUMES - gswauth-add-user -K gswauthkey -a $GLUSTER_VOLUMES $GLUSTER_USER $GLUSTER_PASSWORD + gswauth-add-account -K gswauthkey $S3_ACCOUNT + gswauth-add-user -K gswauthkey -a $S3_ACCOUNT $S3_USER $S3_PASSWORD fi diff --git a/gluster-s3object/CentOS/docker-gluster-s3/swift-adduser.service b/gluster-s3object/CentOS/docker-gluster-s3/swift-adduser.service index ee4c8d7..80f1819 100644 --- a/gluster-s3object/CentOS/docker-gluster-s3/swift-adduser.service +++ b/gluster-s3object/CentOS/docker-gluster-s3/swift-adduser.service @@ -5,7 +5,7 @@ After=swift-object.service [Service] Type=oneshot EnvironmentFile=-/etc/sysconfig/swift-volumes -ExecStart=/usr/local/bin/gluster-swift-add-user $GLUSTER_USER $GLUSTER_PASSWORD $GLUSTER_VOLUMES +ExecStart=/usr/local/bin/gluster-swift-add-user $S3_USER $S3_PASSWORD $S3_ACCOUNT [Install] WantedBy=multi-user.target diff --git a/gluster-s3object/CentOS/docker-gluster-s3/swift-gen-builders.service b/gluster-s3object/CentOS/docker-gluster-s3/swift-gen-builders.service index efafca5..780bb8b 100644 --- a/gluster-s3object/CentOS/docker-gluster-s3/swift-gen-builders.service +++ b/gluster-s3object/CentOS/docker-gluster-s3/swift-gen-builders.service @@ -5,7 +5,7 @@ Before=memcached.service [Service] Type=oneshot EnvironmentFile=-/etc/sysconfig/swift-volumes -ExecStart=/usr/bin/gluster-swift-gen-builders $GLUSTER_VOLUMES gsmetadata +ExecStart=/usr/bin/gluster-swift-gen-builders $S3_ACCOUNT gsmetadata [Install] WantedBy=multi-user.target diff --git a/gluster-s3object/CentOS/docker-gluster-s3/update_gluster_vol.sh b/gluster-s3object/CentOS/docker-gluster-s3/update_gluster_vol.sh index 9e9c60e..cfc7a09 100644 --- a/gluster-s3object/CentOS/docker-gluster-s3/update_gluster_vol.sh +++ b/gluster-s3object/CentOS/docker-gluster-s3/update_gluster_vol.sh @@ -1,14 +1,14 @@ #!/bin/bash # To update gluster volume name in swift-volumes, used by swift-gen-builders.service -if [[ -z "$GLUSTER_VOLUMES" || -z "$GLUSTER_USER" || -z "$GLUSTER_PASSWORD" ]]; then - echo "You need to set GLUSTER_VOLUMES, GLUSTER_USER, GLUSTER_PASSWORD env variable" +if [[ -z "$S3_ACCOUNT" || -z "$S3_USER" || -z "$S3_PASSWORD" ]]; then + echo "You need to set S3_ACCOUNT, S3_USER, S3_PASSWORD env variable" exit 1 else - echo "GLUSTER_VOLUMES env variable is set. Update in swift-volumes" - sed -i.bak '/^GLUSTER_VOLUMES=/s/=.*/='\""$GLUSTER_VOLUMES"\"'/' /etc/sysconfig/swift-volumes - sed -i.bak '/^GLUSTER_USER=/s/=.*/='\""$GLUSTER_USER"\"'/' /etc/sysconfig/swift-volumes - sed -i.bak '/^GLUSTER_PASSWORD=/s/=.*/='\""$GLUSTER_PASSWORD"\"'/' /etc/sysconfig/swift-volumes + echo "S3_ACCOUNT env variable is set. Update in swift-volumes" + sed -i.bak '/^S3_ACCOUNT=/s/=.*/='\""$S3_ACCOUNT"\"'/' /etc/sysconfig/swift-volumes + sed -i.bak '/^S3_USER=/s/=.*/='\""$S3_USER"\"'/' /etc/sysconfig/swift-volumes + sed -i.bak '/^S3_PASSWORD=/s/=.*/='\""$S3_PASSWORD"\"'/' /etc/sysconfig/swift-volumes fi # Hand off to CMD |