Ask Your Question
0

where is the code about objects mapping?

asked 2013-11-11 02:01:21 -0500

qi-weining gravatar image

When I upload a object "ppt.pdf" to the container "container_test1" of swift SAIO, I find one of the path of the object is "/mnt/sdb1/1/node/sdb1/objects/497/382/7c5f513fe9483ed4d2646c059a79d382/1383891714.41626.data". I want to hnow where is the code to map a object from swift to the disk?

edit retag flag offensive close merge delete

16 answers

Sort by » oldest newest most voted
0

answered 2013-11-12 14:19:05 -0500

If this is the first time you try swift, please use the newest codes. That error seems a very old bug.

edit flag offensive delete link more
0

answered 2013-11-13 00:59:57 -0500

qi-weining gravatar image

Thanks, , Kun Huang. You are so kind. Your advices almost resolve my problems. But there is one thing left. I want to get the object's full path, including the last "**.data". "swift-get-nodes" method tells me the path, not including the object's *.data file name.

Such as when I used "swift-get-nodes", I got "/mnt/sdb1/1/node/sdb1/objects/497/382/7c5f513fe9483ed4d2646c059a79d382/". But I also need the last "1383891714.41626.data". I hope I can get "/mnt/sdb1/1/node/sdb1/objects/497/382/7c5f513fe9483ed4d2646c059a79d382/1383891714.41626.data"

Thank you very much.

swift@cloud1:~$ swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing list test1 cert.key proxy-server.conf swift@cloud1:~$ swift-get-nodes -a /etc/swift/object.ring.gz test test1 cert.key

Account test Container test1 Object cert.key

Partition 34233 Hash 216e50dc72887cf0c7982b0edd5b63b6

Server:Port Device 192.168.1.3:6010 sdb1 Server:Port Device 192.168.1.5:6010 sdb1 Server:Port Device 192.168.1.4:6010 sdb1

curl -I -XHEAD "http://192.168.1.3:6010/sdb1/34233/test/test1/cert.key" curl -I -XHEAD "http://192.168.1.5:6010/sdb1/34233/test/test1/cert.key" curl -I -XHEAD "http://192.168.1.4:6010/sdb1/34233/test/test1/cert.key"

Use your own device location of servers: such as "export DEVICE=/srv/node" ssh 192.168.1.3 "ls -lah ${DEVICE:-/srv/node}/sdb1/objects/34233/3b6/216e50dc72887cf0c7982b0edd5b63b6/" ssh 192.168.1.5 "ls -lah ${DEVICE:-/srv/node}/sdb1/objects/34233/3b6/216e50dc72887cf0c7982b0edd5b63b6/" ssh 192.168.1.4 "ls -lah ${DEVICE:-/srv/node}/sdb1/objects/34233/3b6/216e50dc72887cf0c7982b0edd5b63b6/" swift@cloud1:~$

edit flag offensive delete link more
0

answered 2013-11-13 01:59:40 -0500

qi-weining gravatar image

I meet another strange problem.

I use ssh to connect 192.168.1.3. And I can find the path "/srv/node/sdb1/objects". But I can not find the path /srv/node/sdb1/objects/34233. There is no such a path named 34233.

It is really confused me.

swift@cloud1:~$ ssh 192.168.1.3 "ls -lah ${DEVICE:-/srv/node}/sdb1/objects/34233/3b6/216e50dc72887cf0c7982b0edd5b63b6/"

swift@192.168.1.3's password: ls: 初始化月份字符串出错 ls: 无法访问/srv/node/sdb1/objects/34233/3b6/216e50dc72887cf0c7982b0edd5b63b6/: 没有那个文件或目录

edit flag offensive delete link more
0

answered 2013-11-13 03:54:44 -0500

qi-weining gravatar image

In SAIO, I upload 3 objects. And there are 3 folders in 4 nodes. But there is no such a folder “Partition 72 Hash 12365c8a2807d62b0759a4f3bc727d76” which is "swift-get-nodes" returned for me.

My SAIO is just installed the newest one.

swift@qwn-G31M-S2C:/mnt/sdb1/2/node/sdb2$ cd objects swift@qwn-G31M-S2C:/mnt/sdb1/2/node/sdb2/objects$ ls -f . .. 336 577 swift@qwn-G31M-S2C:/mnt/sdb1/2/node/sdb2/objects$ cd /mnt/sdb1/3/node/sdb3/objects swift@qwn-G31M-S2C:/mnt/sdb1/3/node/sdb3/objects$ ls -f . .. 336 497 577 swift@qwn-G31M-S2C:/mnt/sdb1/3/node/sdb3/objects$ cd /mnt/sdb1/4/node/sdb4/objects swift@qwn-G31M-S2C:/mnt/sdb1/4/node/sdb4/objects$ ls -f . .. 336 497 577 swift@qwn-G31M-S2C:/mnt/sdb1/4/node/sdb4/objects$ cd /mnt/sdb1/1/node/sdb1/objects swift@qwn-G31M-S2C:/mnt/sdb1/1/node/sdb1/objects$ ls -f . .. 497

swift@qwn-G31M-S2C:~$ swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing list container_test1 PPT2.pdf etc/swift/proxy-server.conf home/swift/PPT.pdf swift@qwn-G31M-S2C:~$ swift-get-nodes -a /etc/swift/object.ring.gz test container_test1 PPT2.pdf

Account test Container container_test1 Object PPT2.pdf

Partition 72 Hash 12365c8a2807d62b0759a4f3bc727d76

Server:Port Device 127.0.0.1:6030 sdb3 Server:Port Device 127.0.0.1:6010 sdb1 Server:Port Device 127.0.0.1:6020 sdb2 Server:Port Device 127.0.0.1:6040 sdb4 [Handoff]

curl -I -XHEAD "http://127.0.0.1:6030/sdb3/72/test/container_test1/PPT2.pdf" curl -I -XHEAD "http://127.0.0.1:6010/sdb1/72/test/container_test1/PPT2.pdf" curl -I -XHEAD "http://127.0.0.1:6020/sdb2/72/test/container_test1/PPT2.pdf" curl -I -XHEAD "http://127.0.0.1:6040/sdb4/72/test/container_test1/PPT2.pdf" # [Handoff]

Use your own device location of servers: such as "export DEVICE=/srv/node" ssh 127.0.0.1 "ls -lah ${DEVICE:-/srv/node}/sdb3/objects/72/d76/12365c8a2807d62b0759a4f3bc727d76/" ssh 127.0.0.1 "ls -lah ${DEVICE:-/srv/node}/sdb1/objects/72/d76/12365c8a2807d62b0759a4f3bc727d76/" ssh 127.0.0.1 "ls -lah ${DEVICE:-/srv/node}/sdb2/objects/72/d76/12365c8a2807d62b0759a4f3bc727d76/" ssh 127.0.0.1 "ls -lah ${DEVICE:-/srv/node}/sdb4/objects/72/d76/12365c8a2807d62b0759a4f3bc727d76/" # [Handoff]

edit flag offensive delete link more
0

answered 2013-11-13 05:20:51 -0500

Your account "test" actually is "AUTH_test". Try this instead : )

edit flag offensive delete link more
0

answered 2013-11-13 08:45:41 -0500

qi-weining gravatar image

Thanks, Kun Huang. Your advices are so powerful.

In SAIO, it returned the right folder. and ssh line return the object name I wanted.

swift@qwn-G31M-S2C:/mnt/sdb1/1/node/sdb1/objects$ DEVICE=/mnt/sdb1/2/node swift@qwn-G31M-S2C:/mnt/sdb1/1/node/sdb1/objects$ ssh 127.0.0.1 "ls -lah ${DEVICE:-/srv/node}/sdb2/objects/577/e45/905d09490feb7978d139ebac97634e45/" swift@127.0.0.1's password: 总用量 82M drwxr-xr-x 2 swift swift 34 11月 12 21:28 . drwxr-xr-x 3 swift swift 45 11月 12 21:28 .. -rw------- 1 swift swift 82M 11月 12 21:28 1384262912.01738.data

But in the distributed swift in 4 DELL servers, the folder is not right. It is changed to another folder, but it is not exist neither.

The authentication of account and user is tempauth in SAIO, and it is swauth in distributed swift in 4 DELL servers.

Thank you for your warm-hearted help. It really encourage me. And make the testing interesting and fast.

I must try the "swift-get-nodes" line in 4 DELL servers. That will be the system deployed.

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: 2013-11-11 02:01:21 -0500

Seen: 99 times

Last updated: Nov 13 '13