How to install and user Swiftonfile
How to install and user Swiftonfile
GlusterFS Swift 프로젝트은 Swiftonfile 을 설치하는 방법을 참조하여 정리 한 문서
OpenStack Havana on Ubuntu
https://docs.google.com/document/d/1m4dT_C2jI2JhlRnA8BOd2i6uvePZ6BptV6GJLD6F6UM/edit?usp=sharing
GlusterFS Swift 프로젝트은 Swiftonfile 을 설치하는 방법을 참조하여 정리 한 문서
1. Overview
1.1. swiftonfie 개요
Gluster-swift allows GlusterFS to be used as the backend to the object store OpenStack Swift.
The following guide will get you quickly started with a gluster-swift environment on a Fedora or RHEL/CentOS system. This guide is a great way to begin using gluster-swift, and can be easily deployed on a single virtual machine. The final result will be a single gluster-swift node.
NOTE: In Gluster-Swift, accounts must be GlusterFS volumes.
1.2. swiftonfile with keystone
swiftonfile에서 openstack keystone 과 연동하는 부분까지는 아직 Guide 형태가 나오지 않음
2. System Setup
2.1. Prerequisites on CentOS/RHEL
On CentOS/RHEL you will need to setup GlusterFS and EPEL repos.
> OS 설치에 따른 제약이 따른다.
2.1.1. GlusterFS CentOS/RHEL Repo
2.1.1.1. CentOS
# wget -O /etc/yum.repos.d/glusterfs-epel.repo \
http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo
2.1.1.1. RHEL
# wget -O /etc/yum.repos.d/glusterfs-epel.repo \
http://download.gluster.org/pub/gluster/glusterfs/LATEST/RHEL/glusterfs-epel.repo
2.1.2. EPEL CentOS/RHEL Repo
Please refer to EPEL for more information on how to setup the EPEL repo.
# yum install http://mirror.premi.st/epel/6/x86_64/epel-release-6-8.noarch.rpm
2.2. Required Package Installation
Install and start the required packages on your system to create a GlusterFS volume.
# yum install glusterfs glusterfs-server glusterfs-fuse memcached xfsprogs
2.2.1. Start services
Type the following to start memcached and glusterfs services:
# service memcached start; \
service glusterd start
Type the following to start the services automatically on system startup:
# chkconfig memcached on; \
chkconfig glusterd on
2.3. Gluster Volume Setup
Now you need to determine whether you are going to use a partition or a loopback device for storage.
2.3.1. Partition Storage Setup
2.3.1.1. create a GlusterFS brick
If you are using a separate disk partition, please execute the following instructions to create a GlusterFS brick:
# mkfs.xfs -i size=512 /dev/
# mkdir -p /export/brick
2.3.1.2. Add the following line to /etc/fstab
to mount the storage automatically on system startup:
/dev/ /export/brick xfs inode64,noatime,nodiratime 0 0
2.3.1.3. Now type the following to mount the storage:
# mount -a
2.3.2. Loopback Storage Setup
> 별도의 디스크가 없을 경우 설정
If you do not have a separate partition, please execute the following instructions to create a disk image as a file:
2.3.2.1. create a disk image as a file
# truncate -s 5GB /srv/swift-disk
# mkfs.xfs -i size=512 /srv/swift-disk
# mkdir -p /export/brick
2.3.2.2. Add the following line to /etc/fstab
to mount the storage automatically on system startup:
/srv/swift-disk /export/brick xfs loop,inode64,noatime,nodiratime 0 0
2.3.2.3. Now type the following to mount the storage:
# mount -a
2.4. Create a GlusterFS Volume
You now need to create a GlusterFS volume (make sure your hostname is in /etc/hosts or is DNS-resolvable)
# mkdir /export/brick/b1
# gluster volume create myvolume `hostname`:/export/brick/b1
# gluster volume start myvolume
3. Gluster-Swift Setup
3.1. Repository Setup on RHEL/CentOS
Gluster-Swift requires OpenStack Swift's Havana release, which may not be available on some older operating systems. For RHEL/CentOS systems, please setup Red Hat RDO's repo by executing the following command:
# yum install http://repos.fedorapeople.org/repos/openstack/openstack-havana/rdo-release-havana-7.noarch.rpm
3.2. Download
Download the latest Havana release RPMs from launchpad.net downloads:
> epel
3.3. Install
Install the RPM by executing the following:
yum install -y
3.3.1. Prerequisites openstack
yum install openstack-utils
yum install openstack-selinux
3.3.2. install glusterfs-openstack-swift
yum install https://launchpad.net/gluster-swift/havana/1.10.0-2/+download/glusterfs-openstack-swift-1.10.0-2.5.el6.noarch.rpm
3.3.3. glusterfs-openstack-swift 와 install 되는 패키지 정보
openstack-swift openstack-swift-account openstack-swift-container openstack-swift-object openstack-swift-proxy python-prettytable memcached glusterfs-api
3.4. Enabling gluster-swift accross reboots
Type the following to make sure gluster-swift is enabled at system startup:
# chkconfig openstack-swift-proxy on; \
chkconfig openstack-swift-account on; \
chkconfig openstack-swift-container on; \
chkconfig openstack-swift-object on
3.4.1. Fedora 19 Adjustment
Currently gluster-swift requires its processes to be run as root. You need to edit the openstack-swift-*.service files in /etc/systemd/system/multi-user.target.wants and change the User entry value to root.
Then run the following command to reload the configuration:
systemctl --system daemon-reload
3.5. Configuration
As with OpenStack Swift, gluster-swift uses /etc/swift as the directory containing the configuration files. You will need to base the configuration files on the template files provided. On new installations, the simplest way is to copy the *.conf-gluster files to *.conf files as follows:
# cd /etc/swift
# for tmpl in *.conf-gluster ; do cp ${tmpl} ${tmpl%.*}.conf; done
3.5.1. Generate Ring Files
You now need to generate the ring files, which inform gluster-swift which GlusterFS volumes are accessible over the object storage interface. The format is
gluster-swift-gen-builders [VOLUME] [VOLUME...]
Where VOLUME is the name of the GlusterFS volume which you would like to access over gluster-swift.
Let's now expose the GlusterFS volume called myvolume you created above by executing the following command:
# cd /etc/swift
# /usr/bin/gluster-swift-gen-builders myvolume
3.6. Start gluster-swift
Use the following commands to start gluster-swift:
service openstack-swift-object start
service openstack-swift-container start
service openstack-swift-account start
service openstack-swift-proxy start
OR
for service in swift-{object,container,account,proxy}; do start $service; done
4. Using gluster-swift
4.1. Create a container
Create a container using the following command:
# curl -v -X PUT http://localhost:8080/v1/AUTH_myvolume/mycontainer
# curl -v -X PUT http://localhost:8080/v1/AUTH_myvolume/mycontainer
* About to connect() to localhost port 8080 (#0)
* Trying ::1... 연결이 거부됨
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_myvolume/mycontainer HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.6.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 201 Created
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: tx204562c85e564286a612b-0053b39bf5
< Date: Wed, 02 Jul 2014 05:43:17 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0
|
It should return HTTP/1.1 201 Created on a successful creation. You can also confirm that the container has been created by inspecting the GlusterFS volume:
# ls /mnt/gluster-object/myvolume
4.1.1. Create an object
You can now place an object in the container you have just created:
# echo "Hello World" > mytestfile
# curl -v -X PUT -T mytestfile http://localhost:8080/v1/AUTH_myvolume/mycontainer/mytestfile
* About to connect() to localhost port 8080 (#0)
* Trying ::1... 연결이 거부됨
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_myvolume/mycontainer/mytestfile HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.6.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> Content-Length: 12
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< HTTP/1.1 201 Created
< Last-Modified: Wed, 02 Jul 2014 06:20:50 GMT
< Content-Length: 0
< Etag: e59ff97941044f85df5297e1c302d260
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: txdd03c8c535aa41fea0b30-0053b3a4c2
< Date: Wed, 02 Jul 2014 06:20:50 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0
|
To confirm that the object has been written correctly, you can compare the test file with the object you created:
cat /mnt/gluster-object/myvolume/mycontainer/mytestfile
4.1.2. Request the object
Now you can retreive the object and inspect its contents using the following commands:
# curl -v -X GET -o newfile http://localhost:8080/v1/AUTH_myvolume/mycontainer/mytestfile
# cat newfile
X. 참조사항
X.1. What now?
For more information, please visit the following links:
Authentication Services Start Guide
GlusterFS Quick Start Guide
OpenStack Swift API
X.2. swiftonfile install guide
> 해당 내용
> guide
X.3. glusterfs-swift install guide
OpenStack Havana on Ubuntu
https://docs.google.com/document/d/1m4dT_C2jI2JhlRnA8BOd2i6uvePZ6BptV6GJLD6F6UM/edit?usp=sharing
댓글
댓글 쓰기