Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenStack: Operators

Swift account listing

 

 

OpenStack operators RSS feed   Index | Next | Previous | View Threaded


zaitcev at redhat

Jul 18, 2012, 3:52 PM

Post #1 of 3 (486 views)
Permalink
Swift account listing

Guys, a simple question hopefuly:

How do I list all Swift accounts?

Specifically, I have a test installation that I used to experiemnt
with various upgrades and migrations. I probably lost a few testing
accounts in it. Now it sits there and uses up space. How do I find
and eliminate orphan accounts?

Once I have a list of accounts, I can match them up with the output
of "keystone user-list", and I can run swift-account-audit on them.

I'm thinking "ls /srv/node/partitions/accounts/" on all storage nodes
and then building a union set. Seems kind of too ad-hoc though.

Greetings,
-- Pete

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


zaitcev at redhat

Aug 2, 2012, 12:45 PM

Post #2 of 3 (435 views)
Permalink
Re: Swift account listing [In reply to]

On Thu, 19 Jul 2012 16:10:06 +0100
"Juan J. Martinez" <juan [at] memset> wrote:

> I guess you can use the list of current accounts from Keystone and
> translate that into the account ring hash.

> swift-get-nodes /etc/swift/account.ring.gz myKeyStoneAcct | grep Hash |
> cut -f2 5819de5a52d5813f5ce95c9121b97652
>
> Then you can look for hashes that are not in that list of hashes. Per
> storage node you should check:
>
> /srv/node/$0/accounts/$1/*/$2/

The point is to use Swift itself _and_ Keystone, in order to find
discrepancies or "orphan" accounts. I ended using listdir for now,
since our installation is very small, so directories fit in memory.
Code is here:
https://github.com/zaitcev/swift-report

Output looks like this:

15051/4a7/3acbbe2ab55b81269ff88490a1b574a7 SK zaitcev
60690/f22/ed125debcbadbac11ef93c40dede0f22 SK glance
5497/6ee/1579e4404e54e5edb53c00f1206696ee SK shared
52389/69e/cca50f1c92b3b7f2a15d6b8e2aaee69e S- -
3066/787/0bfa11e194ee8889ff1c797a718cf787 SK admin
56328/3d8/dc088209ed71d08a00493c95888583d8 SK testuser

"S" is for accounts found in Swift, "K" is for accounts found in Keystone.

I have a feeling though that I must be reinventing the bicycle here.
Surely someone, somewhere, have written a Swift consistency checker
before.

-- Pete

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


z-launchpad at brim

Aug 2, 2012, 2:07 PM

Post #3 of 3 (438 views)
Permalink
Re: [Openstack] Swift account listing [In reply to]

On Aug 2, 2012, at 2:45 PM, Pete Zaitcev <zaitcev [at] redhat> wrote:

> The point is to use Swift itself _and_ Keystone, in order to find
> discrepancies or "orphan" accounts. I ended using listdir for now,
> since our installation is very small, so directories fit in memory.
> [.......]
> I have a feeling though that I must be reinventing the bicycle here.
> Surely someone, somewhere, have written a Swift consistency checker
> before.
>
> -- Pete
>

We do something pretty similar with Rackspace Cloud Files, though we don't use Keystone but Rackspace's Auth. Same basic principle though. Collect account "stats" from all the storage boxes and upload them as csv files into the cluster itself. External jobs grab the csvs and process them however they see fit (double-checking against auth, etc.)

Part of it (John Dickinson's Slogging Project):
https://github.com/notmyname/slogging/blob/master/slogging/db_stats_collector.py


_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators

OpenStack operators RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.