OpenStack Swift - Container Sync (New & Old ways)
OpenStack Swift Container-Sync
Swift 內建功能利用背景工作, 讓 Container to Container 如同鏡像一樣同步所有資料. 不僅僅是自己的Container, 還可以跟其他人Account內的Container相互同步資料. 這個功能也被部分企業用來將資料從舊的Swift Cluster轉移到新的環境上.提示
如果User request是對object做POST的操作, 操作內容不一定會被同步, 除非object_post_as_copy = true 在 Proxy server 的設定, 目前這個值預設為開啟 true.
同步的設定可以有幾種模式 :
- One-way sync : 單向同步 containerA --> containerB
- Two-way sync : 雙向同步 containerA <--> containerB
- Chain : 鏈狀同步 containerA --> containerB --> containerC --> containerA
首先你必須要知道目前有兩種方法(新/舊)來設定 Container Sync
First of all, you need to know there are two styles for setting container-sync currently.
- OLD-style(舊): Supported since Swift's initial release. 任何版本,包含新版本
- NEW-style(新): Implemented in Swift 1.12 or later. 在1.12版本後才釋出
NEW-Style - 多了realm(域)的觀念.
新的做法需要先建立一個設定檔 ( /etc/swift/container-sync-realms.conf )在兩個叢集的"所有"節點. 具體一點來說, 只要會涉及到這個同步過程的所有Proxy Server與Container Server 上面都必須要有這個設定檔案.
範例
[DEFAULT]
[realm1]key = realm1key
key2 = realm1key2
cluster_name1 = https://host1/v1/
cluster_name2 = https://host2/v1/
[realm2]
key = realm2key
key2 = realm2key2
cluster_name3 = https://host3/v1/
cluster_name4 = https://host4/v1/
realm1 的名稱是可以自行定義, 用來配置一組Container-Sync域. 這個新的觀念可以提高Container-Sync功能的安全性還有彈性. Key則是用來做Request驗證的數位簽章. 送出請求的Container-Sync含有這個key, 接收到的 Proxy server 會驗證是否符合他這邊對應的資料, 如果送過來的key. 這個key並不等同于x-sync-key這個header.
[NEW-Style]
On both clusters (在兩邊的叢集都需要設定)
1. Create /etc/swift/container-sync-realms.conf on all nodes 所有節點都需要
(https://github.com/openstack/swift/blob/master/etc/container-sync-realms.conf-sample)
2. Adding [container-sync] section in /etc/swift/container-server/1.conf on Container Nodes
所有container-server運作的節點都需要設定.
(https://github.com/openstack/swift/blob/master/etc/container-server.conf-sample#L148)
3. Setting container_sync middleware in proxy’s pipline
To add the container_sync middleware to your proxy pipeline. It needs to be after any memcache middleware and before any auth middleware.
The container_sync section only needs the “use” item. For example:
[pipeline:main]
pipeline = healthcheck proxy-logging cache container_sync tempauth proxy-logging proxy-server
[filter:container_sync]
use = egg:swift#container_sync
Efforts on Cluster1
Set the sync-to and sync-key headers on container con1
$> swift post -t "//realm1/name1/AUTH_test/con2" -k "key" con1
Efforts on Cluster2
Set the sync-to and sync-key headers on container con1
$> swift post -t "//realm1/name2/AUTH_test/con1" -k "key" con2
[ OLD-style ]
One-Way sync - Sync data from c1con to c2con
Two-Way sync - Sync data from c1con to c2con, also c2con to c1con
Efforts on Cluster1
Configure container-sync in /etc/swift/container-server/1.conf on all SwiftStack Nodes running container servers in Cluster1.
1. Adding allowed_sync_hosts = $host1,$host2,$host3 in [DEFAULT]
section. $host can use either IP or HOSTNAME of the another
cluster's API entry point.
Example: (192.168.30.1 is the API IP of Cluster2)
2. Adding [container-sync] section in
/etc/swift/container-server/1.conf on all Nodes running container servers in Cluster1.
Example:
REF: https://github.com/openstack/swift/blob/master/etc/container-server.conf-sample#L148-L164
3. Restart Container-server to apply the changes
$> sudo -i swift-init all restart
4. Create and add sync information to a container by Swift CLI
* Create a container (skip it if it's already created)
$> swift post c1con
* Retrieve the account URI of c2con on Cluster2.
It's supposed to look like:
http://192.168.30.1/v1/AUTH_c2user2/c2con
* Set container-sync required headers on c1con
$> swift post -t 'http://192.168.30.1/v1/AUTH_c2user2/c2con'
-k ‘secret-key-must-same-on-both-container’ c1con
After the above operations, the container c1con should have two
headers now.
Efforts on Cluster2
Configure container-sync in /etc/swift/container-server/1.conf on all Nodes running container servers in Cluster2.
If you don’t want to setup Two-Way sync, please skip this step.
1. Adding allowed_sync_hosts = $host1,$host2,$host3 in [DEFAULT]
section. $host can use either IP or HOSTNAME of the another
cluster's API entry point.
Example: (192.168.20.1 is the API IP of Cluster1)
3. Restart Container-server to apply the changes
$> sudo -i swift-init all restart
4. Create and add sync information to a container by Swift CLI
* Create a container (skip it if it's already created)
$> swift post c1con
* Retrieve the account URI of c2con on Cluster2.
It's supposed to look like:
http://192.168.30.1/v1/AUTH_c2user2/c2con
* Set container-sync required headers on c1con
$> swift post -t 'http://192.168.30.1/v1/AUTH_c2user2/c2con'
-k ‘secret-key-must-same-on-both-container’ c1con
After the above operations, the container c1con should have two
headers now.
Efforts on Cluster2
Configure container-sync in /etc/swift/container-server/1.conf on all Nodes running container servers in Cluster2.
If you don’t want to setup Two-Way sync, please skip this step.
1. Adding allowed_sync_hosts = $host1,$host2,$host3 in [DEFAULT]
section. $host can use either IP or HOSTNAME of the another
cluster's API entry point.
Example: (192.168.20.1 is the API IP of Cluster1)
2. Adding [container-sync] section in /etc/swift/container-server/1.conf on all Nodes
running container servers in Cluster2.
Example:
running container servers in Cluster2.
Example:
3. Restart Container-server to apply the changes
$> sudo -i swift-init all restart
4. Create and add sync information to a container by Swift CLI
* Create a container (skip it if it's already created)
$> swift post c1con
# For Two-Way sync
* Retrieve the account URI of c1con on Cluster1.
It's supposed to look like:
http://192.168.20.1/v1/AUTH_c1user1/c1con
* Set container-sync headers required on c1con
# For Two-Way sync
$> swift post -t 'http://192.168.20.1/v1/AUTH_c1user1/c1con'
-k ‘secret-key-must-same-on-both-container’ c2con
# For One-Way sync, the secret key on c2con is enough.
$> swift post -k ‘secret-key-must-same-on-both-container’ c2con
After the above operations, the container c2con should have two
headers now.
[驗證]
The swift-container-sync daemons will perform the sync periodically. You can upload some objects into c1con on Cluster1. Wait 5 minutes and check the container c2con on Cluster2 for updates. Also, you can find the PUT logs in /var/log/swift/proxy_access.log in Cluster2.
[Important] Those PUT requests are issued by the container server on Cluster1. So, the Cluster2 API IP must be reachable by the container servers (nodes) on Cluster1.
If you don't want to wait for 5 minutes, you can stop the container-sync worker and execute the worker on Cluster1.
$> sudo -i swift-init container-sync stop
$> sudo -i swift-container-sync -o /etc/swift/container-server/1.conf
http://www.lyccc.org.tw/2014/03/trend-report-of-chinese-future-life.html?showComment=1435721681021#c764806893552380659
ReplyDeletecách làm kem dưỡng trắng da tự nhiênĐó có thể do chị em phụ nữ chăm sóc da không đúng cách, hoặc sử dụng những loại sản phẩm không rõ nguồn gốc,
ReplyDeletetự làm kem dưỡng da vùng mắtTàn nhanh và nám da còn do các tác nhân từ môi trường bên ngoài tác động vào như việc bảo vệ da da không tốt sử dụng mỹ phẩm không rõ nguồn gốc
tự làm kem dưỡng ẩm da mặtkhiến chị em tốn nhiều công sức mà vẫn không cải thiện được làn da.
tự làm kem dưỡng trắng da mặt tại nhàĐối với người có da khô thì nên lựa chon loại kem dưỡng ngược lại thường là các loại kem dưỡng có chứa hydrolyzen collagen, các chất béo hữu cơ, natri axit, lysine, vitamin E giúp làm mềm da khô tăng cường độ ẩm cho da.
tự làm kem dưỡng da mặt ban đêmNhưng làm sao để có làn da trắng hồng mịn màng, đến spa thì cho phí quá đắt đỏ, chị em đã tìm đủ mọi cách mà làn da vẫn không cải thiện.
tự làm kem dưỡng da cho da nhờnCác chất này không đơn thuần là cung cấp nước mà còn tăng cường độ ẩm giúp da cân bằng độ ẩm lấy lại vẻ mịn màng ngày nào.
tự làm kem dưỡng ẩm cho da mặtĐối với mỗi loại da đều có mỹ phẩm dưỡng da đặc trị riêng. Như đối với có lỗ chân lông to là một bất lợi cho bạn vì cách kén chọn sử dụng các sản phẩm dưỡng da. Nhưng cac chuyên gia đã nghiên cứu làm ra mặt nạ cho da có lỗ chân lông to.Cùng tìm hiểu cách
làm kem dưỡng da với dầu dừaDa nhạy cảm loại da hay bị kích ứng với các loại mỹ phẩm khác nhau. Nên việc chọn lựa mỹ phẩm cho da rất khó khăn phỉ có chuyên gia tư vấn cho bạn.Nhưng việc ấy bạn có thể yên tâm khi sử dụng
tự làm kem dưỡng ẩm cho da mặtNám da mặt có nhiều yếu tố nguyên nhân gây ra nhưng tuy thuộc vào từng nguyên nhan mà có cách chữa trị khác nhau. Hôm nay cùng chúng tôi Megavita tìm hiểu
tự làm kem dưỡng da chống lão hóaTrái cây bổ sung rất nhiều vitamin năng lượng cho sức khỏe con người không những thế mà còn có tác dụng làm đẹp da. Đặc biệt một phát hiện mới trị nám da bằng trái cấy. Tìm hiểu
get to my website to take a best quality barcode scaner machine and barcode printer machine
ReplyDeletemay in ma vach
may quet ma vach
banh trang tay ninh va dac san tay ninh chinh hang gia re tai tp ho chi minh
banh trang tay ninh
co mam chua tay ninh va muoi tom tay ninh
đặc sản tây ninh
muối tôm tây ninh
mắm chua tây ninh
kem trị thâm vùng kín
ReplyDeletekem dưỡng trắng da tay
kem dưỡng trắng da tay
kem trị thâm vùng kín
kem trị sẹo tốt nhất hiện nay
serum dưỡng trắng da nào tốt
kem trị nám hiệu quả nhất
kem trị nám tàn nhang hiệu quả
kem trị nám tàn nhang đồi mồi
kem trị quầng thâm mắt hiệu quả
kem trị quầng thâm mắt
cac loai may quet ma vach
ReplyDeleteban may quet ma vach
click for me to buy the best product
may in ma vach gia re may in ma vach gia re nhat tai viet nam
https://servicecenteriphone.blogspot.com/ http://www.lampungservice.com/2018/05/kode-rahasia.html
ReplyDeletehttps://kursusteknisiservicehp.blogspot.com/https://jskursus.blogspot.com/https://kursusservicehplampung.blogspot.com/
https://jasaserviceteknisi.blogspot.com/https://jasaeditfotobandarlampung.blogspot.com/https://sevicecenterhimax.blogspot.com/https://servicecenteradvan.blogspot.com/
https://jasapengetikandibandarlampung.blogspot.com/
ReplyDeleteBest Article buy Pain Pills online Excellent post. I appreciate this site. Stick with it! Because the admin of this web page is working, no doubt very quickly it will be well-known, due to its quality contents.This website was how do you say it? Relevant!! Finally, I’ve found something that helped me.
Best Article buy Roxicodone online Excellent post
buy Xanax online
buy Oxycodone online
Best Article buy Pain Medications online Excellent post. I appreciate this site. Stick with it! Because the admin of this web page is working, no doubt very quickly it will be well-known, due to its quality contents.This website was how do you say it? Relevant!! Finally, I’ve found something that helped me.
buy Research Chemicals online
buy Roxicodone online
buy Cbd Isolate online
What an awesome written by you! I am too glad to read this kind of informative blog article. Thanks to sharing this with us, really thank you!!!!!!
ReplyDeleteDubai VPS Server
BUY LSD ONLINE
ReplyDeleteBUY VYVANSE ONLINE
BUY ADDERALL ONLINE
BUY PERCOCET ONLINE
BUY BLUE DREAM DANK VAPE ONLINE
BUY BLUE DREAM BANANA OG BRASS KNUCKLES ONLINE
BUY BLUE DREAM WATERMELON DANK VAPE ONLINE
BUY BLUE DREAM KINGPEN ONLINE
BUY BLUE DREAM ONLINE
BUY MOONROCK ONLINE
BUY SOUR DIESEL ONLINE
BUY GRAND DADDY PURPLE ONLINE
BUY sunrocks ONLINE
BUY WEED ONLINE
pineapple express online cheap sale in usa
buy nova og online
buy afghan kush online
buy nova-og-kush online
buy valuim online
buy ketamine rocks online
buy nebutal online
buy cocaine online
iboga for sale
buy ibogaine hcl online
buy ibogaine hcl online
buy ibogaine online
buy iboga root barks online
buy iboga powder online
tabernanthe ibogaine hcl for sale
ibogaine hcl research
iboga for sale
BUY WEED ONLINE
BUY OXYCODONE ONLINE
BUY IBOGAINE ONLINE
BUY DANK VAPE ONLINE
BUY PURPLE QUEEN ONLINE
BUY IBOGAINE CAPSULES ONLINE
BUY SUBUTEX 8MG ONLINE
BUY GELATO DANK VAPE CARTRIDGE ONLINE
Great Article Cloud Computing Projects
ReplyDeleteNetworking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training