. 檢測 swift 命令是否工作正常 (輸出應為 zero containers, zero objects, 和 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
查看賬戶相關資訊
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
上傳檔案到myfiles容器中:
swift -A https://localhost:8089/auth/v1.0 -U buy360:root -K testpass upload myfiles 123.txt
建立容器:
swift -A https://localhost:8089/auth/v1.0 -U buy360:root -K testpass post myfiles
下載myfiles容器中的所有檔案
swift -A https://10.28.1.97:8089/auth/v1.0 -U buy360:root -K testpass download myfiles *
下載某個賬戶下面的所有內容
swift -A https://localhost:8089/auth/v1.0 -U system:root -K testpass download --all
將對象下載到指定檔案
swift -A https://localhost:8089/auth/v1.0 -U system:root -K testpass download myfiles swift.conf -o liu.test
列出所有容器
swift -A https://localhost:8089/auth/v1.0 -U buy360:root -K testpass list
列出首碼為my的容器
swift -A https://localhost:8089/auth/v1.0 -U buy360:root -K testpass list -p my
查看容器myfiles中的對象
swift -A https://localhost:8089/auth/v1.0 -U buy360:root -K testpass list myfiles
將對象分段上傳
swift -A https://localhost:443/auth/v1.0 -U system:root -K testpass upload largeobject -S 1024000 account.builder
定位賬戶,容器,Object Storage Service的位置:swift-get-nodes
必須將檔案夾組跟使用者佈建為swift,不然報錯
chown swift:swift /mnt/sdb1/*
當試著上傳一個大於5G的對象,就會報錯
-bash-4.1# swift -A https://localhost:8089/auth/v1.0 -U system:root -K testpass upload largeobject /tmp/swiftdev1
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:將代碼重新安裝一次
sqlite資料庫
.h on 查詢的時候顯示表欄位
查詢當前資料庫的表結構
select * from sqlite_master WHERE type = "table";
glance add name="test-1" is_public=true < /home/images/euca-centos-5.3-x86_64.tar.gz
/usr/bin/glance-control api restart