OpenStack's Swift Operations Guide

Source: Internet
Author: User
Tags auth curl ranges sqlite database rsync
Swift-ring-builder Account.builder Create 18 3 1
Swift-ring-builder Container.builder Create 18 3 1
Swift-ring-builder Object.builder Create 18 3 1


Swift-ring-builder account.builder Add z1-127.0.0.1:6002/sda1 100
Swift-ring-builder container.builder Add z1-127.0.0.1:6001/sda1 100
Swift-ring-builder object.builder Add z1-127.0.0.1:6000/sda1 100


Swift-ring-builder Account.builder
Swift-ring-builder Container.builder
Swift-ring-builder Object.builder


Swift-ring-builder Account.builder Rebalance
Swift-ring-builder Container.builder Rebalance
Swift-ring-builder Object.builder Rebalance


Swift-ring-builder Account.builder Search Z1
Swift-ring-builder Account.builder set_min_part_hours 2
Swift-ring-builder Account.builder remove:6012
Swift-ring-builder Account.builder set_info:6022 10.28.1.216:6022/sdb2_account2
Verifying configuration
Swauth-prep-k swauthkey-a https://localhost:8089/auth/
Add user
Swauth-add-user-k swauthkey-a https://localhost:8089/auth/-a system root Testpass
Swauth-list-k swauthkey-a https://localhost:8089/auth/
Query for information under an account:
Swauth-list-k swauthkey-a Https://localhost:8089/auth/system
View information for a user under an account
Swauth-list-k swauthkey-a Https://10.28.1.97:8089/auth/system Root
Swauth-delete-user-k swauthkey-a Https://localhost:8089/auth/system Root


Swauth-delete-account-k swauthkey-a Https://localhost:8089/auth/sys
Curl-k-v-h ' x-storage-user:buy360:root '-h ' x-storage-pass:testpass ' https://localhost:8089/auth/v1.0
Swauth-add-account-k swauthkey-a Https://localhost:8089/auth/system
/var/log/messages
/etc/init.d/memcached
DD If=/dev/zero Of=/srv/swift-disk bs=1g count=20
Mkfs.xfs/srv/swift-disk (file system must be XFS)
echo "Mount/srv/swift-disk/mnt/sdb1-o loop" >>/etc/rc.local
Mount Mount/srv/swift-disk/mnt/sdb1-o Loop
Start the Sync service/usr/bin/rsync--daemon--config=/etc/rsyncd.conf
Add sync command to boot echo "/usr/bin/rsync--daemon--config=/etc/rsyncd.conf" >>/etc/rc.local




Get X-storage-url and X-auth-token
Curl-k-v-h ' x-storage-user:system:root '-h ' x-storage-pass:testpass ' https://localhost:443/auth/v1.0
Verifying X-auth-token
Curl-k-v-h ' x-auth-token:auth_tk8f5cbb6c6f3d41d98172c10fc59ad1d3 ' https://10.28.1.216:8089/v1/AUTH_ Aa002b51-24e5-4385-806f-1087ec9c2fa8






. Detect if the SWIFT command is working properly (output should be zero containers, zero objects, and zero bytes):
Swift-a Https://localhost:8089/auth/v1.0-U system:root-k testpass Stat
account:auth_cfc10b95-6033-4fd2-b4c5-c6a7c73a4478
containers:0
objects:0
bytes:0
Accept-ranges:bytes
View account related Information
Swift-a Https://localhost:8089/auth/v1.0-U system:root-k Testpass stat-v
storageurl:https://localhost:8089/v1/auth_cfc10b95-6033-4fd2-b4c5-c6a7c73a4478
Auth token:auth_tk70a2e31982bb4a68881d563a19da6883
account:auth_cfc10b95-6033-4fd2-b4c5-c6a7c73a4478
Containers:2
objects:38
bytes:12562615
Accept-ranges:bytes


Upload files to the Myfiles container:
Swift-a https://localhost:8089/auth/v1.0-U buy360:root-k testpass upload myfiles 123.txt
To create a container:
Swift-a Https://localhost:8089/auth/v1.0-U buy360:root-k Testpass Post myfiles
Download all files in the Myfiles container
swift-a https://10.28.1.97:8089/auth/v1.0-U buy360:root-k testpass Download Myfiles *
Download all content under an account
swift-a https://localhost:8089/auth/v1.0-U system:root-k testpass Download--all
Downloading an object to a specified file
swift-a https://localhost:8089/auth/v1.0-U system:root-k testpass download myfiles swift.conf-o liu.test
List all containers
Swift-a Https://localhost:8089/auth/v1.0-U buy360:root-k testpass List
List the containers prefixed with my
Swift-a Https://localhost:8089/auth/v1.0-U buy360:root-k Testpass list-p my
To view objects in a container myfiles
Swift-a Https://localhost:8089/auth/v1.0-U buy360:root-k testpass list myfiles
To upload objects in segments
Swift-a https://localhost:443/auth/v1.0-U system:root-k testpass upload largeobject-s 1024000 account.builder




Location of account, container, object storage: Swift-get-nodes










The folder group and user must be set to Swift or the error will be
Chown swift:swift/mnt/sdb1/*
When you try to upload an object larger than 5G, you will get an error.
-bash-4.1# swift-a https://localhost:8089/auth/v1.0-U system:root-k testpass upload
Object put failed:https://10.28.1.216:8089/v1/auth_72d3e323-b8e3-47ce-af21-95e96690436b/largeobject//tmp/ SWIFTDEV1 413 Request Entity Too Large
Swauth-prep-k swauthkey-a https://localhost:8089/auth/


Swift could not create the main auth account: Reinstall code Once


SQLite database
Display table fields when. h on query


Querying the table structure of the current database
SELECT * from sqlite_master WHERE type = "Table";








Glance add Name= "Test-1" Is_public=true /usr/bin/glance-control API Restart




The disadvantages of Swift design:
1 when uploading, should not upload more points, but should upload a copy, and then let it copy their own many points
2 each time joins a node, carries on the rebalance operation, will again carry on the partition area code the allocation, may involve the massive object movement
/usr/bin/glance-control Registry Restart
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.