Ask Your Question
0

How to enable xattr for xfs on ubuntu?

asked 2011-05-17 18:53:46 -0500

ghuang gravatar image

When I tried to execute 'swauth-add-account -K mypassword test', I got the following error in /var/log/swift/all.log:

File "/usr/lib/pymodules/python2.6/xattr/__init__.py", line 16, in _func#012 return func(first, *args)#012IOError: [Errno 95] Operation not supported

From another question (#121011), gholt answered: This error: ...xattr/__init__.py", line 16, in _func#012 return func(first, *args)#012IOError: [Errno 95] Operation not supported...

This is the code trying to write xattrs to a file system that does not support xattrs. Swift data drives, the ones pointed to by the 'devices' configuration variable, require xattr support. It has been tested with xfs, but other file systems also support xattrs (see http://en.wikipedia.org/wiki/Extended_file_attributes (http://en.wikipedia.org/wiki/Extended...) ) but often have to have it explicitly turned on with 'user_xattr' in /etc/fstab.

I tried to add user_xattr in /etc/fstab, but got 'invalid mount option'. Here's my xfs line entry in /etc/fstab:

/srv/swift-disk /mnt/sdb1 xfs loop,noatime,nodiratime,nobarrier,user_xattr,logbufs=8 0 0

I also tried attr2 instead of user_xattr,

/srv/swift-disk /mnt/sdb1 xfs loop,noatime,nodiratime,nobarrier,attr2,logbufs=8 0 0

This time mount is OK, but got the same error when trying swauth-add-account. Here's my uname -a result:

Linux ubuntu 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 23:42:43 UTC 2011 x86_64 GNU/Linux

Does anyone know how to explicitly enable xattr for xfs on my ubuntu? Or how to resolve 'Operation not supported... error on xattr/__init__.py line 16 '?

Thanks in advance.

edit retag flag offensive close merge delete

17 answers

Sort by ยป oldest newest most voted
0

answered 2011-11-07 23:05:32 -0500

This is the section I'm referring to in the SAIO instructions: http://swift.openstack.org/development_saio.html#setting-up-scripts-for-running-swift (http://swift.openstack.org/developmen...)

edit flag offensive delete link more
0

answered 2011-11-07 23:04:30 -0500

I ran into this issue (thanks for the resolution, it worked great!) and I found out why I had it that way. The initial setup instructions of SAIO create symbolic links, but the resetswift script has mkdir instead of ln:

mkdir -p /srv/1/node/sdb1 /srv/2/node/sdb2 /srv/3/node/sdb3 /srv/4/node/sdb4

edit flag offensive delete link more
0

answered 2011-05-18 20:20:14 -0500

ghuang gravatar image

Thanks gholt, that solved my question.

edit flag offensive delete link more
0

answered 2011-05-18 20:20:06 -0500

ghuang gravatar image

That's it. I was wondering about why they are not symbolic links. I must have screwed up when executing the 'ln -s' command. I removed /srv/1, /srv/2, /srv/3, /srv/4 and re-created the symbolic links. And it worked. Thank you so much for your time and help.

edit flag offensive delete link more
0

answered 2011-05-18 17:54:57 -0500

gholt gravatar image

Okay! Your ls -la /srv/ shows that those 1 2 3 4 items are directories not links, so that seems to be the problem.

On my system:

$ ls -la /srv/ total 8 drwxr-xr-x 3 root root 4096 2011-03-12 03:14 . drwxr-xr-x 23 root root 4096 2011-05-09 20:36 .. lrwxrwxrwx 1 root root 11 2011-02-25 23:45 1 -> /mnt/sdb1/1 lrwxrwxrwx 1 root root 11 2011-02-25 23:45 2 -> /mnt/sdb1/2 lrwxrwxrwx 1 root root 11 2011-02-25 23:45 3 -> /mnt/sdb1/3 lrwxrwxrwx 1 root root 11 2011-02-25 23:45 4 -> /mnt/sdb1/4

edit flag offensive delete link more
0

answered 2011-05-17 22:56:51 -0500

gholt gravatar image

Ah okay, you're using the loopback method. If the accounts and containers are working, that's odd that the objects aren't.

Can you run the following:

touch /srv/1/node/testing; xattr /srv/1/node/testing user.test test ; xattr /srv/1/node/testing user.test

You should get the output of just the word test.

edit flag offensive delete link more
0

answered 2011-05-17 22:31:42 -0500

ghuang gravatar image

I was following the instructions on ( http://swift.openstack.org/development_saio.html (http://swift.openstack.org/developmen...) ) using a loopback device for storage. According to the instructions, /srv/swift-disk was created by

mkfs.xfs -i size=1024 /srv/swift-disk

and mounted as the following entry in /etc/fstab:

/srv/swift-disk /mnt/sdb1 xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0

ghuang@ubuntu:~$ ls -la /srv total 5388 drwxr-xr-x 6 root root 4096 2011-05-16 08:23 . drwxr-xr-x 22 root root 4096 2011-05-16 08:41 .. drwxr-xr-x 3 ghuang ghuang 4096 2011-05-16 08:23 1 drwxr-xr-x 3 ghuang ghuang 4096 2011-05-16 08:23 2 drwxr-xr-x 3 ghuang ghuang 4096 2011-05-16 08:23 3 drwxr-xr-x 3 ghuang ghuang 4096 2011-05-16 08:23 4 -rw-r--r-- 1 root root 1024000000 2011-05-17 11:17 swift-disk

ghuang@ubuntu:/srv/1/node/sdb1$ ls -la total 20 drwxr-xr-x 5 ghuang ghuang 4096 2011-05-16 10:06 . drwxr-xr-x 3 ghuang ghuang 4096 2011-05-16 08:23 .. drwxrwxrwx 33 ghuang ghuang 4096 2011-05-17 11:22 accounts drwxrwxrwx 22 ghuang ghuang 4096 2011-05-16 11:30 containers drwxrwxrwx 2 ghuang ghuang 4096 2011-05-17 11:22 tmp

I am not sure if this list is expected. I see accounts and containers, but not objects. Is it supposed to have objects directory listed, too? Is there any other information I can provide to help resolve this issue?

Thanks.

edit flag offensive delete link more
0

answered 2011-05-17 19:55:50 -0500

gholt gravatar image

Okay, so you're mounting at

/srv/swift-disk

And your object server is set to write to:

/srv/1/node

Do those end up the same device? Via symlinks or something?

edit flag offensive delete link more
0

answered 2011-05-17 19:31:36 -0500

ghuang gravatar image

Here's my /etc/swift/object-server/1.conf:

[DEFAULT] devices = /srv/1/node mount_check = false bind_port = 6010 user = ghuang log_facility = LOG_LOCAL2

[pipeline:main] pipeline = object-server

[app:object-server] use = egg:swift#object

[object-replicator] vm_test_mode = yes

[object-updater]

[object-auditor]

edit flag offensive delete link more
0

answered 2011-05-17 19:18:26 -0500

gholt gravatar image

xattrs are supported automatically by xfs as far as I know. My /etc/fstab line reads:

/dev/sdb1 /mnt/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0

It could be the problem is that your object server is not configured to write on the xfs drive but somewhere else. Can you post your /etc/swift/object-server.conf? (Or /etc/swift/object-server/1.conf depending on how you have things set up).

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: 2011-05-17 18:53:46 -0500

Seen: 848 times

Last updated: Nov 07 '11