First look at the topology diagram:
650) this.width=650; "style=" border:0px;width:550px;height:408px;vertical-align:middle; "src="/HTTP/ Qqadapt.qpic.cn/adapt/0/f4ec0bbf-df87-eb72-1308-6464c896bada/800?pt=0&ek=1&kp=1&sce=0-12-12 "alt=" 800?pt=0&ek=1&kp=1&sce=0-12-12 "/>
Each file and virtual node is a one-to-one relationship, each upload a file will be assigned a virtual node, the number of virtual nodes is generally 2 of the power of N.
Each virtual node and zone is a one-to-many relationship, assuming that each file has two copies, then each virtual node corresponds to two zones, here only a single copy of the discussion file, so a virtual node only corresponds to a zone.
and a zone can correspond to multiple virtual nodes, such as 6 virtual nodes 3 zones, then each zone corresponds to two virtual nodes. If 2^n a virtual node how to assign to zone, it depends on the weight of each zone (weight).
For example, file1 corresponding to the 1th virtual node, 1th virtual node corresponding to the Zone1, so file1 is stored in zone1, file2 corresponding 4th virtual node, 4th virtual node corresponds to Z1, Then File2 is also stored in the zone1 (assuming that file4 corresponds to the 4th virtual node).
Now you are ready to add a new zone to the environment, such as:
650) this.width=650; "style=" border:0px;width:637px;height:442px;vertical-align:middle; "src="/HTTP/ Qqadapt.qpic.cn/adapt/0/a21d1f4d-dbff-f879-e9bd-ce754580e692/800?pt=0&ek=1&kp=1&sce=0-12-12 "alt=" 800?pt=0&ek=1&kp=1&sce=0-12-12 "/>
After adding a new zone, the correspondence between the virtual node and the zone will be redistributed (rebalance), as in.
At this point 4th virtual node corresponds to Zone4, according to the current allocation, file2 should be stored in zone4, but according to the previous analysis, File2 has been stored in zone1, then start to File2 from Zone1 to Zone4.
Start the test below:
Currently Swift uses a zone, so these three objects are in the same zone:
650) this.width=650; "style=" border:0px;width:817px;height:181px;vertical-align:middle; "src="/HTTP/ Qqadapt.qpic.cn/adapt/0/5b00e82b-310d-b2f2-809a-49bc8d07029a/800?pt=0&ek=1&kp=1&sce=0-12-12 "alt=" 800?pt=0&ek=1&kp=1&sce=0-12-12 "/>
Now add a new zone:
650) this.width=650; "style=" border:0px;width:757px;height:75px;vertical-align:middle; "src="/HTTP/ Qqadapt.qpic.cn/adapt/0/61f092e6-f6b0-05f6-04b9-38794a3abfbd/800?pt=0&ek=1&kp=1&sce=0-12-12 "alt=" 800?pt=0&ek=1&kp=1&sce=0-12-12 "/>
Now add the new partition to the build file:
650) this.width=650; "style=" border:0px;width:870px;height:391.5px;vertical-align:middle; "src="/HTTP/ Qqadapt.qpic.cn/adapt/0/177ec3b3-bf12-0178-a4ce-d64f0b60b2ed/800?pt=0&ek=1&kp=1&sce=0-12-12 "alt=" 800?pt=0&ek=1&kp=1&sce=0-12-12 "/>
650) this.width=650; "style=" border:0px;width:865px;height:184px;vertical-align:middle; "src="/HTTP/ Qqadapt.qpic.cn/adapt/0/ef6ed2a0-1bc9-a675-c905-77eabb689b2e/800?pt=0&ek=1&kp=1&sce=0-12-12 "alt=" 800?pt=0&ek=1&kp=1&sce=0-12-12 "/>
The data originally distributed in Swiftloopbak will be moved to the new zone:
650) this.width=650; "style=" border:0px;width:870px;height:91.94px;vertical-align:middle; "src="/HTTP/ Qqadapt.qpic.cn/adapt/0/6b89133d-62f6-bbe1-67de-b7286df713bf/800?pt=0&ek=1&kp=1&sce=0-12-12 "alt=" 800?pt=0&ek=1&kp=1&sce=0-12-12 "/> upload some new file tests:
650) this.width=650; "style=" border:0px;width:870px;height:313.39px;vertical-align:middle; "src="/HTTP/ Qqadapt.qpic.cn/adapt/0/35966ccd-5d53-a0d1-ec46-a814f749d188/800?pt=0&ek=1&kp=1&sce=0-12-12 "alt=" 800?pt=0&ek=1&kp=1&sce=0-12-12 "/>
This article is from the "Old section studio" blog, please make sure to keep this source http://lduan.blog.51cto.com/5428084/1771680
The popular understanding of the ring in Openstack-swift