openstack swift and local path filename

Clay Gerrard clay.gerrard at gmail.com
Thu Feb 3 18:58:28 UTC 2022


If you're just curious how swift works, the CLI tool `swift-get-nodes`
wraps up that translation/calculation pretty nicely

vagrant at saio:~$ swift stat -v test test | egrep -i "(timestamp|url)"
                   URL: http://saio:8080/v1/AUTH_test/test/test
           X-Timestamp: 1643914310.47773
vagrant at saio:~$ tail /var/log/syslog | grep "object-"
Feb  3 18:54:37 saio object-6020: STDERR: (6752) accepted ('127.0.0.1',
56050)
Feb  3 18:54:37 saio object-6020: 127.0.0.1 - - [03/Feb/2022:18:54:37
+0000] "HEAD /sdb2/40/AUTH_test/test/test" 200 8 "HEAD
http://saio:8080/v1/AUTH_test/test/test"
"tx1cc84ff96e4b40d18bdb0-0061fc24ed" "proxy-server 6480" 0.0006 "-" 6752 0
Feb  3 18:54:37 saio object-6020: STDERR: 127.0.0.1 - - [03/Feb/2022
18:54:37] "HEAD /sdb2/40/AUTH_test/test/test HTTP/1.1" 200 423 0.001149
(txn: tx1cc84ff96e4b40d18bdb0-0061fc24ed)
vagrant at saio:~$ swift-get-nodes /etc/swift/object.ring.gz AUTH_test test
test | grep /srv/node
such as "export DEVICE=/srv/node"
ssh 127.0.0.2 "ls -lah
${DEVICE:-/srv/node*}/sdb2/objects/40/35a/a161102fba1710ef912af194b8d4635a"
ssh 127.0.0.3 "ls -lah
${DEVICE:-/srv/node*}/sdb3/objects/40/35a/a161102fba1710ef912af194b8d4635a"
ssh 127.0.0.4 "ls -lah
${DEVICE:-/srv/node*}/sdb4/objects/40/35a/a161102fba1710ef912af194b8d4635a"
ssh 127.0.0.1 "ls -lah
${DEVICE:-/srv/node*}/sdb1/objects/40/35a/a161102fba1710ef912af194b8d4635a"
# [Handoff]
note: `/srv/node*` is used as default value of `devices`, the real value is
set in the config file on each storage node.
vagrant at saio:~$ ls
/srv/node2/sdb2/objects/40/35a/a161102fba1710ef912af194b8d4635a/
1643914310.47773.data

...  so you could look at how that does it:

https://github.com/openstack/swift/blob/master/swift/cli/info.py#L105

If you're doing something more sophisticated (maybe in the HPC space with
direct/non-proxy access) - checkout the "ListEndpoints" middleware:

https://docs.openstack.org/swift/latest/middleware.html#module-swift.common.middleware.list_endpoints

If you have some more questions, come say Hi in #openstack-swift on OFTC

On Thu, Feb 3, 2022 at 12:45 PM admin at gibdev.ru <admin at gibdev.ru> wrote:

> I have installed openstack swift 2.25.2
>
> object-server writes and serves local files from disk
>
> It receives http requests from a proxy-server, for example:
>
>
> http get:
> /sdb4/525/AUTH_xxxxxxxxxxxxxxxxxxxxxxxx/panda/2c34a941f581d848e2799e7a0956ea14f3cb27b0e516aef99a438fdaebbd7592
>
>
> reads a file from disk:
>
>
>
> /srv/node/sdb4/objects/525/346/835ee70dce07217d8e33147e0864f346/1643910916.71556.data
>
>
> how can I calculate the path by which the file will be read by
> object-server?
>
>
> thanks
>
>
>
>
>
>

-- 
Clay Gerrard
210 788 9431
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20220203/035fcdf0/attachment-0001.htm>


More information about the openstack-discuss mailing list