云存储-swift 读写实验(云存储)


mnq10_0@126.com
2019-12-29 08:27:27 (5年前)
云存储 swift 读写实验

time curl -d '{"auth":{"tenantName": "service", "passwordCredentials":{"username": "swift", "password": "swiftwxjxy"}}}' -H "Content-type: application/json" http://s1:5000/v2.0/tokens | python -mjson.tool



time curl -d ‘{“auth”:{“tenantName”: “service”, “passwordCredentials”:{“username”: “swift”, “password”: “swiftwxjxy”}}}’ -H “Content-type: application/json” http://s1:5000/v2.0/tokens | python -mjson.tool


% Total % Received % Xferd Average Speed Time Time Time Current


Dload Upload Total Spent Left Speed


117 1189 108 1189 0 105 3973 350 —:—:— —:—:— —:—:— 3625


{


“access”: {


“metadata”: {


“is_admin”: 0,


“roles”: [


“9dec73a7c15f42acac4732bd0e2c625c”


]


},


“serviceCatalog”: [


{


“endpoints”: [


{


“adminURL”: “http://172.28.19.249:8080“,


“id”: “10e9ff63a0d84723bdf1551b8a0fa3ea”,


“internalURL”: “http://172.28.19.249:8080/v1/AUTH_68c17b5d56aa49c9baad4d66d4e63681“,


“publicURL”: “http://172.28.19.249:8080/v1/AUTH_68c17b5d56aa49c9baad4d66d4e63681“,


“region”: “regionOne”


}


],


“endpoints_links”: [],


“name”: “swift”,


“type”: “object-store”


},


{


“endpoints”: [


{


“adminURL”: “http://172.28.19.249:35357/v2.0“,


“id”: “0d7d073354a4413eb4bf4fab00552177”,


“internalURL”: “http://172.28.19.249:5000/v2.0“,


“publicURL”: “http://172.28.19.249:5000/v2.0“,


“region”: “regionOne”


}


],


“endpoints_links”: [],


“name”: “keystone”,


“type”: “identity”


}


],


“token”: {


“audit_ids”: [


“REG4kU0mQtC8OeN21_alCg”


],


“expires”: “2017-04-05T08:12:45Z”,


“id”: “7239a32f17d94696a6b8eb06bd3677fd”,


“issued_at”: “2017-04-05T07:12:45.155489”,


“tenant”: {


“description”: “Service Tenant”,


“enabled”: true,


“id”: “68c17b5d56aa49c9baad4d66d4e63681”,


“name”: “service”


}


},


“user”: {


“id”: “7b09c8d4d05046afb75c5f31860ceadf”,


“name”: “swift”,


“roles”: [


{


“name”: “admin”


}


],


“roles_links”: [],


“username”: “swift”


}


}


}




real 0m0.307s


user 0m0.021s


sys 0m0.007s


1.swift 上传




time swift upload bucket test.mp4


test.mp4




real 0m40.741s


user 0m1.184s


sys 0m1.286s




2.swift 下载


time swift download bucket test.mp4


test.mp4 [auth 0.346s, headers 0.641s, total 50.969s, 36.942 MB/s]




real 0m52.952s


user 0m1.836s


sys 0m3.156s




time curl -k -X GET -H ‘X-Auth-Token:0c5e7e28437646fab7772555d551c729’ http://172.28.19.249:8080/v1/AUTH_68c17b5d56aa49c9baad4d66d4e63681/test/test.mp4> t


% Total % Received % Xferd Average Speed Time Time Time Current


Dload Upload Total Spent Left Speed


5 1783M 5 106M 0 0 47.8M 0 0:00:37 0:00:02 0:00:35 47.9M


100 1783M 100 1783M 0 0 54.8M 0 0:00:32 0:00:32 —:—:— 54.0M


0.41user 3.13system 0:32.53elapsed 10%CPU (0avgtext+0avgdata 2108maxresident)k


0inputs+3652544outputs (0major+580minor)pagefaults 0swaps




real 0m33.720s


user 0m0.420s


sys 0m3.377s




3.删除


time swift delete bucket test.mp4


test.mp4




real 0m4.736s


user 0m0.357s


sys 0m0.099s




cd /usr/local/opt/hadoop-2.5.1/sbin


./hadoop-daemon.sh start datanode




**


3.hadoop上传


time hadoop fs -put test.mp4 /


SLF4J: Class path contains multiple SLF4J bindings.


SLF4J: Found binding in [jar:file:/usr/local/opt/hadoop-2.5.1/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]


SLF4J: Found binding in [jar:file:/usr/local/opt/hadoop-2.5.1/share/hadoop/mapreduce/MapReduceExample.jar!/org/slf4j/impl/StaticLoggerBinder.class]


SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.


SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]






real 0m40.245s


user 0m10.742s


sys 0m2.491s




ime curl -i -X PUT -T t “http://s1:50075/webhdfs/v1/tmp/webhdfs/1.ts?op=CREATE&user.name=root&namenoderpcaddress=s1:8020&overwrite=true


HTTP/1.1 100 Continue




HTTP/1.1 201 Created


Cache-Control: no-cache


Expires: Thu, 06 Apr 2017 05:39:21 GMT


Date: Thu, 06 Apr 2017 05:39:21 GMT


Pragma: no-cache


Expires: Thu, 06 Apr 2017 05:39:21 GMT


Date: Thu, 06 Apr 2017 05:39:21 GMT


Pragma: no-cache


Content-Type: application/octet-stream


Location: webhdfs://s1:8020/tmp/webhdfs/1.ts


Content-Length: 0


Server: Jetty(6.1.26)






real 0m37.702s


user 0m0.112s


sys 0m1.958s






time curl -i -X PUT


time curl -i -X PUT -T t “http://s1:50075/webhdfs/v1/tmp/webhdfs/3.ts?op=CREATE&user.name=root&namenoderpcaddress=s1:8020&overwrite=true


HTTP/1.1 100 Continue




HTTP/1.1 201 Created


Cache-Control: no-cache


Expires: Thu, 06 Apr 2017 03:00:19 GMT


Date: Thu, 06 Apr 2017 03:00:19 GMT


Pragma: no-cache


Expires: Thu, 06 Apr 2017 03:00:19 GMT


Date: Thu, 06 Apr 2017 03:00:19 GMT


Pragma: no-cache


Content-Type: application/octet-stream


Location: webhdfs://s1:8020/tmp/webhdfs/3.ts


Content-Length: 0


Server: Jetty(6.1.26)




real 0m25.828s


user 0m0.109s


sys 0m1.754s




5.hadoop 下载








time curl


time curl -k -X GET -o a -sSL ‘http://172.28.19.249:50070/webhdfs/v1/test.mp4?op=OPEN




real 0m27.937s


user 0m0.226s


sys 0m2.487s




time curl -k -X GET -o a -sSL ‘http://172.28.19.249:50070/webhdfs/v1/test.mp4?op=OPEN




real 0m18.457s


user 0m0.188s


sys 0m2.814s




time curl -k -X GET -o a -sSL ‘http://172.28.19.249:50070/webhdfs/v1/test.mp4?op=OPEN




real 0m12.920s


user 0m0.180s


sys 0m3.066s




6.hadoop rm


time hadoop fs -rm /test.mp4


SLF4J: Class path contains multiple SLF4J bindings.


SLF4J: Found binding in [jar:file:/usr/local/opt/hadoop-2.5.1/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]


SLF4J: Found binding in [jar:file:/usr/local/opt/hadoop-2.5.1/share/hadoop/mapreduce/MapReduceExample.jar!/org/slf4j/impl/StaticLoggerBinder.class]


SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.


SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]


17/04/05 10:56:05 INFO fs.TrashPolicyDefault: Namenode trash configuration: Deletion interval = 0 minutes, Emptier interval = 0 minutes.


Deleted /test.mp4




real 0m4.342s


user 0m2.734s


sys 0m0.142s



0 条回复
  1. 动动手指,沙发就是你的了!
登录 后才能参与评论