Where will be the objects stored in the filesystem ?

Asked by sujay on 2012-10-30

I followed http://docs.openstack.org/developer/swift/development_saio.html URL to install openstack swift in Ubuntu 64 bit server with loopback as storage. I have the following doubts?

1. When I do swift upload file where (which container) will the file get stored in ? please absolute give the path in the filesystem

2. Will Replication occur ? If yes How does it store the objects ? How can i find multiple copies

3. How can i view the log of object storage ?

4. Can i create my own authentication mechanism without using the curl ?

Question information

English Edit question
OpenStack Object Storage (swift) Edit question
No assignee Edit question
Solved by:
Samuel Merritt
Last query:
Last reply:

This question was reopened

Samuel Merritt (torgomatic) said : #1

1. The command is "swift upload <container> <file> [<file> ...]", so the container is whatever you specify.

2. http://docs.openstack.org/developer/swift/index.html and http://docs.openstack.org/developer/swift/overview_replication.html

3. it's in /var/log/swift

4. http://docs.openstack.org/developer/swift/development_auth.html

sujay (sujay-m17) said : #2

1. In the URL it is specified as /srv/[1-4]/node for devices in the configuration files.

But in my opinion was when i do
swift upload container file
i thought the file would go to the container and i can see the container directory on my hard disk. But i tried searching for the file on my hard disk and i couldn't find one.

sujay (sujay-m17) said : #4

Thanks Samuel Merritt, that solved my question.

sujay (sujay-m17) said : #5

Thanks Samuel. Could you please check the URL and let me know where exactly i can find the file on the hard disk.

There are 4 containers given in the URL 1,2,3,4
But when i do
swift -A -U test:tester -K testing list

I get this output. So i think there is a problem in the container names. Please help me out why i am getting this instead of 1 2 3 4. I have followed the URL in the question

Samuel Merritt (torgomatic) said : #6

If you want to know where something is on the disk, run "swift-get-nodes /etc/swift/object.ring <account> <container> <object>".

I can't tell you where things are on your disks since I don't have your rings.

As for your container names, did you create them with names "1", "2", "3", and "4"? What commands did you use to upload the objects?

sujay (sujay-m17) said : #7

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 ᠄᠂᠃鐌鐌鐋툎嘇蔈툏댌툎

using the given solution
root@ubuntu:/# /usr/local/bin/swift-get-nodes /etc/swift/object.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 such file or directory
root@ubuntu:/# ls -lah /srv/2/node/sdb2/containers/166850/699/a2f0b58577e532298c10a13675c77699/
ls: cannot access /srv/2/node/sdb2/containers/166850/699/a2f0b58577e532298c10a13675c77699/: No such file or directory

There is no directory 166850 inside the below file hierarchy

This is my folder structure


How to create containers? I thought that when you do swift upload containerY file, if containerY is not present then it'll create containerY.

Best Samuel Merritt (torgomatic) said : #8

If you're looking up where a container is on the filesystem, use /etc/swift/container.ring.gz. Objects, use object.ring.gz, and similarly for accounts.

sujay (sujay-m17) said : #9

Thanks Samuel Merritt, that solved my question.