Ask Your Question
0

Data location in storage nodes

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

jorhen111 gravatar image

Hi,

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 ?

            Thanks,

        Jorge
edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted
0

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

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 README.md

Account test Container myContainer1 Object README.md

Partition 128322 Hash 7d509816c039ae6c6accb56198288b23

Server:Port Device 127.0.0.1:6022 sdb2 Server:Port Device 127.0.0.1:6032 sdb3 Server:Port Device 127.0.0.1:6042 sdb4 Server:Port Device 127.0.0.1:6012 sdb1 [Handoff]

curl -I -XHEAD "http://127.0.0.1:6022/sdb2/128322/test/myContainer1/README.md" curl -I -XHEAD "http://127.0.0.1:6032/sdb3/128322/test/myContainer1/README.md" curl -I -XHEAD "http://127.0.0.1:6042/sdb4/128322/test/myContainer1/README.md" curl -I -XHEAD "http://127.0.0.1:6012/sdb1/128322/test/myContainer1/README.md" # [Handoff]

ssh 127.0.0.1 "ls -lah /srv/node/sdb2/objects/128322/b23/7d509816c039ae6c6accb56198288b23/" ssh 127.0.0.1 "ls -lah /srv/node/sdb3/objects/128322/b23/7d509816c039ae6c6accb56198288b23/" ssh 127.0.0.1 "ls -lah /srv/node/sdb4/objects/128322/b23/7d509816c039ae6c6accb56198288b23/" ssh 127.0.0.1 "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
0

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

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 10.1.1.7:8000 sdd1 10.1.9.2:8000 sdb1 10.1.5.5:8000 sdf1 10.1.5.9:8000 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
0

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

jorhen111 gravatar image

Thanks Florian Hines, that solved my question.

edit flag offensive delete link more
0

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

sujay-m17 gravatar image

Hi I used http://docs.openstack.org/developer/swift/development_saio.html (http://docs.openstack.org/developer/s...) 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 http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing list 㜄툍툐蔉蔋툏툐᠁蔉鐉鐉 鐋㜅蔈嘅᠄᠂㜃鐌嘇᠄툍嘅댎 댋᠂᠃ं댍嘅鐉☃嘆蔊蔋嘇鐉蔋 툍᠃㜆蔊댋댌댎᠄㜃댌鐊댍᠄ 툐蔉툎᠁鐉㜆᠁툎鐋᠁᠂鐋댎툐 ᠄᠂᠃鐌鐌鐋툎嘇蔈툏댌툎

instead of 1 2 3 4

root@ubuntu:~# swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing upload ᠄᠂᠃鐌鐌鐋툎嘇蔈툏댌툎 Testfile

Testfile

root@ubuntu:~# swift -A http://127.0.0.1:8080/auth/v1.0 -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 127.0.0.1:6022 sdb2 Server:Port Device 127.0.0.1:6042 sdb4 Server:Port Device 127.0.0.1:6012 sdb1 Server:Port Device 127.0.0.1:6032 sdb3 [Handoff]

curl -I -XHEAD "http://127.0.0.1:6022/sdb2/166850/test/%EF%84%92%E1%A0%84%E1%A0%82%E1%A0%83%E9%90%8C%E9%90%8C%E9%90%8B%ED%88%8E%E5%98%87%EF%84%91%E8%94%88%ED%88%8F%EB%8C%8C%ED%88%8E" curl -I -XHEAD "http://127.0.0.1:6042/sdb4/166850/test/%EF%84%92%E1%A0%84%E1%A0%82%E1%A0%83%E9%90%8C%E9%90%8C%E9%90%8B%ED%88%8E%E5%98%87%EF%84%91%E8%94%88%ED%88%8F%EB%8C%8C%ED%88%8E" curl -I -XHEAD "http://127.0.0.1:6012/sdb1/166850/test/%EF%84%92%E1%A0%84%E1%A0%82%E1%A0%83%E9%90%8C%E9%90%8C%E9%90%8B%ED%88%8E%E5%98%87%EF%84%91%E8%94%88%ED%88%8F%EB%8C%8C%ED%88%8E" curl -I -XHEAD "http://127.0.0.1:6032/sdb3/166850/test/%EF%84%92%E1%A0%84%E1%A0%82%E1%A0%83%E9%90%8C%E9%90%8C%E9%90%8B%ED%88%8E%E5%98%87%EF%84%91%E8%94%88%ED%88%8F%EB%8C%8C%ED%88%8E" # [Handoff]

ssh 127.0.0.1 "ls -lah /srv/node/sdb2/containers/166850/699/a2f0b58577e532298c10a13675c77699/" ssh 127.0.0.1 "ls -lah /srv/node/sdb4/containers/166850/699/a2f0b58577e532298c10a13675c77699/" ssh 127.0.0.1 "ls -lah /srv/node/sdb1/containers/166850/699/a2f0b58577e532298c10a13675c77699/" ssh 127.0.0.1 "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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 79 times

Last updated: Nov 12 '12