Openstck swift 이론

Openstack 2017.07.28 11:40 |

https://docs.openstack.org/swift/latest/overview_ring.html

저작자 표시
신고

'Openstack' 카테고리의 다른 글

Openstck swift 이론  (0) 11:40:35
Open Stack - Switf 설치  (0) 2017.07.17
Posted by 덕쑤

댓글을 달아 주세요

- Open Stack - Switf  설치 방법

​Open stack 최신 버전인 Ocata 버전의 Swift를 Ubuntu에 설치 하는 방법을 설명합니다(2017-07-17).  
출처 : https://www.openstack.org/


  -- 설치 테스트 구성도 



​1. OpenStack packages 설치 

​(모든 노드에서 실행) 

apt install software-properties-common
add-apt-repository cloud-archive:ocata​

apt update && apt dist-upgrade​

​apt install python-openstackclient

​2. SQL database

​(Controll 노드 에서 실행)

apt install mariadb-server python-pymysql


편집 /etc/mysql/mariadb.conf.d/99-openstack.cnf
bind-address 은 관리용 IP 를 입력 한다. 

[mysqld]

bind-address = 10.0.0.11


default-storage-engine = innodb

innodb_file_per_table = on

max_connections = 4096

collation-server = utf8_general_ci

character-set-server = utf8


service mysql restart
mysql_secure_installation


3. KeyStone 설치

​(Controll 노드 에서 실행)

mysql
MariaDB [(none)]> CREATE DATABASE keystone;

MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'KEYSTONE_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'KEYSTONE_DBPASS';

apt install keystone

편집 /etc/keystone/keystone.conf

[database]

connection = mysql+pymysql://keystone:KEYSTONE_DBPASS@controller/keystone


[token]

provider = fernet


su -s /bin/sh -c "keystone-manage db_sync" keystone

keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone


keystone-manage bootstrap --bootstrap-password ADMIN_PASS --bootstrap-admin-url http://controller:35357/v3/ \
--bootstrap-internal-url http://controller:5000/v3/ --bootstrap-public-url http://controller:5000/v3/ \
--bootstrap-region-id RegionOn

편집 /etc/apache2/apache2.conf

ServerName controller


service apache2 restart
rm -f /var/lib/keystone/keystone.db


4. controller node 설치

openstack user create --domain default --password-prompt swift
openstack role add --project service --user swift admin
openstack service create --name swift --description "OpenStack Object Storage" object-store

openstack endpoint create --region RegionOne object-store public http://controller:8080/v1/AUTH_%\(tenant_id\)s
openstack endpoint create --region RegionOne object-store internal http://controller:8080/v1/AUTH_%\(tenant_id\)s
openstack endpoint create --region RegionOne object-store admin http://controller:8080/v1

apt-get install swift swift-proxy python-swiftclient python-keystoneclient python-keystonemiddleware memcached


생성 /etc/swift 

curl -o /etc/swift/proxy-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/proxy-server.conf-sample?h=stable/ocata

편집 /etc/swift/proxy-server.conf

[DEFAULT]

bind_port = 8080

user = swift

swift_dir = /etc/swift


[pipeline:main]

pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk ratelimit authtoken keystoneauth container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-server


[app:proxy-server]

use = egg:swift#proxy

account_autocreate = True


[filter:keystoneauth]

use = egg:swift#keystoneauth

operator_roles = admin,user


[filter:authtoken]

paste.filter_factory = keystonemiddleware.auth_token:filter_factory

auth_uri = http://controller:5000

auth_url = http://controller:35357

memcached_servers = controller:11211

auth_type = password

project_domain_name = default

user_domain_name = default

project_name = service

username = swift

password = SWIFT_PASS

delay_auth_decision = True


[filter:cache]

use = egg:swift#memcache

memcache_servers = controller:11211


5. storage nodes 설치

apt-get install xfsprogs rsync

mkfs.xfs /dev/sdb
mkfs.xfs /dev/sdc

mkdir -p /srv/node/sdb
mkdir -p /srv/node/sdc

편집 /etc/fstab
/dev/sdb /srv/node/sdb xfs noatime,nodiratime,nobarrier,logbufs=8 0 2
/dev/sdc /srv/node/sdc xfs noatime,nodiratime,nobarrier,logbufs=8 0 2

mount /srv/node/sdb
mount /srv/node/sdc

편집 /etc/rsyncd.conf
uid = swift
gid = swift
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = MANAGEMENT_INTERFACE_IP_ADDRESS

[account]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/account.lock

[container]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/container.lock

[object]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/object.lock

편집 /etc/default/rsync
RSYNC_ENABLE=true
service rsync start

apt-get install swift swift-account swift-container swift-object
curl -o /etc/swift/account-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/account-server.conf-sample?h=stable/ocata
curl -o /etc/swift/container-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/container-server.conf-sample?h=stable/ocata
curl -o /etc/swift/object-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/object-server.conf-sample?h=stable/ocata

편집 /etc/swift/account-server.conf
[DEFAULT]
bind_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
bind_port = 6202
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True

[pipeline:main]
pipeline = healthcheck recon account-server

[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift

[pipeline:main]
pipeline = healthcheck recon container-server

[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift

[DEFAULT]
bind_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
bind_port = 6200
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True

[pipeline:main]
pipeline = healthcheck recon object-server

[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
recon_lock_path = /var/lock


chown -R swift:swift /srv/node

mkdir -p /var/cache/swift
chown -R root:swift /var/cache/swift
chmod -R 775 /var/cache/swift

저작자 표시
신고

'Openstack' 카테고리의 다른 글

Openstck swift 이론  (0) 11:40:35
Open Stack - Switf 설치  (0) 2017.07.17
Posted by 덕쑤

댓글을 달아 주세요

The server failed to handle your request, due to an internal error.  The given message may give details useful 

message: xenopsd internal error: VM = 58eb101d-6068-8cc9-a2e8-233dee8ce631; domid = 242; Bootloader.Bad_error T

  File "/usr/bin/pygrub", line 897, in ?

    part_offs = get_partition_offsets(file)

  File "/usr/bin/pygrub", line 105, in get_partition_offsets

    image_type = identify_disk_image(file)

  File "/usr/bin/pygrub", line 49, in identify_disk_image

    fd = os.open(file, os.O_RDONLY)

OSError: [Errno 2] No such file or directory: '/dev/sm/backend/db1476aa-e424-7fb7-fc58-131bd7d45f98/ef76d6ef-7


위 같은 에러 메세지는 부팅 파티션 메타 정보 삭제시 발생한다. 
이럴 경우 메타 정보를 만들어 주면 되지만 수동으로 하면 시간도 오래 걸리고 틀리면 짜증난다..
꼼수로 스냅샷을 찍어서 그 스냅샷 이미지를 이용해서 부팅하는 방법이 있다 


잘 아시다 시피 스냅샹을 하면 성능이 떨어지는 못 살리는거 보단 좋다 살리자 VM !!

저작자 표시
신고
Posted by 덕쑤

댓글을 달아 주세요

티스토리 툴바