Data location in storage nodes

Asked by Jorge Henrique

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

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Solved by:
Florian Hines
Solved:
Last query:
Last reply:
Revision history for this message
Best Florian Hines (pandemicsyn) said :
#1

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>] [<object>]
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.

Revision history for this message
Jorge Henrique (jorhen111) said :
#2

Thanks Florian Hines, that solved my question.

Revision history for this message
sujay (sujay-m17) said :
#4

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?