본문 바로가기
Infra/프라이빗 클라우드 인프라

Swift deivce add

by shinebee* 2020. 7. 8.

1. 모든 Object 삭제

 

[ Glance with Swift backend ]

1. cd /usr/share/diskimage-builder/elements/centos7/post-install.d 2. cat 01-enable-service #!/bin/bash systemctl enable httpd 설치 후에 systemctl enable httpd 명령어를 실행하기 위한 01-enable-servi..

suee-b.tistory.com

 

 

2. Swift 서비스 중단

openstack-service stop swift

 

 

3.  기존 디바이스 제거

/etc/fstab: loop0 제거
umount -a

 

 

4. 새 디스크 추가

  • Disk 3개 (10G)
  • vdb, vdc, vdd
  • 파일시스템 생성 = xfs

 

 

5. mount

mkdir -p /srv/node/device{1..3}

vi /etc/fstab
    /dev/vdb	/srv/node/device1	xfs		defaults	0 0
    /dev/vdc	/srv/node/device2	xfs		defaults	0 0
    /dev/vdd	/srv/node/device3	xfs		defaults	0 0

 

 

6. 소유권 변경

  • swift:swift
chown -R swift:swift /srv/node/device{1..3}

 

 

7. SELinux File Context 변경

  • system_u:object_r:swift_data_t:s0
ls -lZ
chcon -t swift_data_t device{1..3}
(restorecon -rv /srv/node/device{1..3})

 

 

8. 링 빌더 삭제

rm -rf /etc/swift/*.builder

 

 

9. 링 파일 생성

  • PP(Partition Power): 10  →  partitions 1024
    REPLICA(복제본): 3
    MIN_PAR_HOUR(MINimum PARtition HOUR): 1
ex) swift-ring-builder /etc/swift/a|c|o.builder create <PP> <REPLICA> <MIN_PAR_HOUR>

swift-ring-builder /etc/swift/account.builder create 10 3 1
swift-ring-builder /etc/swift/container.builder create 10 3 1
swift-ring-builder /etc/swift/object.builder create 10 3 1

 

 

10. 디바이스 추가

ex) swift-ring-builder /etc/swift/a|c|o.builder add \
    --region 1 --zone 1|2|3 --device device1|2|3 \
    --weight 100 --ip 192.168.122.10 --port 600X
    
swift-ring-builder /etc/swift/account.builder add --region 1 --zone 1 --device device1 --weight 100 --ip 192.168.122.10 --port 6002
swift-ring-builder /etc/swift/account.builder add --region 1 --zone 2 --device device2 --weight 100 --ip 192.168.122.10 --port 6002
swift-ring-builder /etc/swift/account.builder add --region 1 --zone 3 --device device3 --weight 100 --ip 192.168.122.10 --port 6002

swift-ring-builder /etc/swift/container.builder add \
    --region 1 --zone 1|2|3 --device device1|2|3 \
    --weight 100 --ip 192.168.122.10 --port 6001

swift-ring-builder /etc/swift/object.builder add \
    --region 1 --zone 1|2|3 --device device1|2|3 \
    --weight 100 --ip 192.168.122.10 --port 6000

 

 

11. 밸런스 조정

swift-ring-builder /etc/swift/account.builder rebalance
swift-ring-builder /etc/swift/container.builder rebalance
swift-ring-builder /etc/swift/object.builder rebalance

 

 

12. 서비스 실행 및 확인

openstack-service start swift
openstack-service status swift

 

※ 다른 사용자로 이미지를 업로드 하고 swift 계정으로 container를 확인하면 삭제한 glance container가 돌아와있는것을 확인할 수 있다.

 

※ cd  /srv/node  ->  tree명령어로 똑같이 속성이 올라간 것을 확인할 수 있다.

 

※ swift service가 돌아가는 상태로 disk를 하나 더 추가하여 (zone 4, device 4, replica 추가) 바로 적용이 되는지 확인.

'Infra > 프라이빗 클라우드 인프라' 카테고리의 다른 글

LBaaS를 통한 Loadbalance  (0) 2020.07.13
NFS를 Cinder로 사용하기  (0) 2020.07.10
Object Storage(swift) 서비스 관리  (0) 2020.07.08
Image 생성 - error  (0) 2020.07.07
[ Glance with Swift backend ]  (0) 2020.07.07

댓글