Ask Your Question

Data location in storage nodes

asked 2012-08-01 20:25:15 -0600

jorhen111 gravatar image


We have set up a swift cloud and it is working well. However, we don't know which zones swift is using to store a specific data. Is there any way to do that ? Also, is there any way to have statistics to see which zone are the most used ?


edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted

answered 2012-11-12 04:44:39 -0600

sujay-m17 gravatar image

Hi Florian Hines, thanks for the info. I have a small doubt.

I have set up Swift all in one with loopback as storage

How does swift locate the objects with the help of the containers table in the account folder.

sqlite> select * from account_stat; AUTH_test|1351964500.78340|1351964500.71905|0|2|1|3086|1f701b5602c1aa6f08598ca35515b757|225c855a-20d8-4754-a3f0-c7244f32e9d3||0| sqlite> select * from container; 3|myContainer1|1351966542.56171|0|1|3086|0 4|publicContainer|1352176822.54750|0|0|0|0

How does swift use the above info to locate the objects of the container

sujay@ubuntu:/srv/2/node/sdb2/accounts/56335/281/3703f658243cec0da307d210a2678281$ swift-get-nodes /etc/swift/account.ring.gz test myContainer1

Account test Container myContainer1 Object

Partition 128322 Hash 7d509816c039ae6c6accb56198288b23

Server:Port Device sdb2 Server:Port Device sdb3 Server:Port Device sdb4 Server:Port Device sdb1 [Handoff]

curl -I -XHEAD "" curl -I -XHEAD "" curl -I -XHEAD "" curl -I -XHEAD "" # [Handoff]

ssh "ls -lah /srv/node/sdb2/objects/128322/b23/7d509816c039ae6c6accb56198288b23/" ssh "ls -lah /srv/node/sdb3/objects/128322/b23/7d509816c039ae6c6accb56198288b23/" ssh "ls -lah /srv/node/sdb4/objects/128322/b23/7d509816c039ae6c6accb56198288b23/" ssh "ls -lah /srv/node/sdb1/objects/128322/b23/7d509816c039ae6c6accb56198288b23/" # [Handoff]

or how will this help in locating the object?

what does HandOff mean?

edit flag offensive delete link more

answered 2012-08-01 20:46:27 -0600

You can see the location of a specific account, container, or object using swift-get-nodes:

fhines@ubuntu:~$ swift-get-nodes Usage: /usr/local/bin/swift-get-nodes [-a] <ring.gz> <account> [<container>] [] Shows the nodes responsible for the item specified. Example: $ /usr/local/bin/swift-get-nodes /etc/swift/account.ring.gz MyAccount Partition 5743883 Hash 96ae332a60b58910784e4417a03e1ad0 sdd1 sdb1 sdf1 sdt1 # [Handoff]

I'm not sure what types of stats you want but checking disk usage is an easy way to see if your balanced from disk usage perspective.

edit flag offensive delete link more

answered 2012-08-13 14:01:28 -0600

jorhen111 gravatar image

Thanks Florian Hines, that solved my question.

edit flag offensive delete link more

answered 2012-11-02 16:40:09 -0600

sujay-m17 gravatar image

Hi I used ( for swift setup using loopback as storage in a Ubuntu 64 bit VM

root@ubuntu:/srv# ls 1 2 3 4 swift swift-disk

swift -A -U test:tester -K testing list 㜄툍툐蔉蔋툏툐᠁蔉鐉鐉 鐋㜅蔈嘅᠄᠂㜃鐌嘇᠄툍嘅댎 댋᠂᠃ं댍嘅鐉☃嘆蔊蔋嘇鐉蔋 툍᠃㜆蔊댋댌댎᠄㜃댌鐊댍᠄ 툐蔉툎᠁鐉㜆᠁툎鐋᠁᠂鐋댎툐 ᠄᠂᠃鐌鐌鐋툎嘇蔈툏댌툎

instead of 1 2 3 4

root@ubuntu:~# swift -A -U test:tester -K testing upload ᠄᠂᠃鐌鐌鐋툎嘇蔈툏댌툎 Testfile


root@ubuntu:~# swift -A -U test:tester -K testing list ᠄᠂᠃鐌鐌鐋툎嘇蔈툏댌툎 Testfile 댌᠂댎鐊㜅蔈嘅᠃ं댌᠃鐉㜄 댌댌Ω嘅툐Ωँं嘅㜆

using the given solution root@ubuntu:/# /usr/local/bin/swift-get-nodes /etc/swift/account.ring.gz test ᠄᠂᠃鐌鐌鐋툎嘇蔈툏댌툎

Account test Container ᠄᠂᠃鐌鐌鐋툎嘇蔈툏댌툎 Object None

Partition 166850 Hash a2f0b58577e532298c10a13675c77699

Server:Port Device sdb2 Server:Port Device sdb4 Server:Port Device sdb1 Server:Port Device sdb3 [Handoff]

curl -I -XHEAD "" curl -I -XHEAD "" curl -I -XHEAD "" curl -I -XHEAD "" # [Handoff]

ssh "ls -lah /srv/node/sdb2/containers/166850/699/a2f0b58577e532298c10a13675c77699/" ssh "ls -lah /srv/node/sdb4/containers/166850/699/a2f0b58577e532298c10a13675c77699/" ssh "ls -lah /srv/node/sdb1/containers/166850/699/a2f0b58577e532298c10a13675c77699/" ssh "ls -lah /srv/node/sdb3/containers/166850/699/a2f0b58577e532298c10a13675c77699/" # [Handoff] root@ubuntu:/# ls -lah /srv/node/sdb2/containers/166850/699/a2f0b58577e532298c10a13675c77699/ ls: cannot access /srv/node/sdb2/containers/166850/699/a2f0b58577e532298c10a13675c77699/: No ... (more)

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2012-08-01 20:25:15 -0600

Seen: 2,070 times

Last updated: Nov 12 '12