立即注册
登录
About云-梭伦科技
返回首页
pig2的个人空间
https://www.aboutyun.com/?61
[收藏]
[复制]
[分享]
[RSS]
空间首页
动态
记录
日志
相册
主题
分享
留言板
个人资料
导读
淘贴
博客
群组
社区VIP
APP下载
今日排行
本周排行
本周热帖
本月排行
本月热帖
会员排行
首页
Portal
专题
BBS
面试
办公|编程助手
更多
我的空间
好友
帖子
收藏
道具
勋章
任务
动态
日志
相册
分享
记录
留言板
群组
导读
日志
openstack【juno】入门 【swift篇】二十五:验证安装(控制节点)
热度
1
已有 2835 次阅读
2015-2-26 18:07
http://www.aboutyun.com/thread-11702-1-1.html
问题导读
1.swift stat的作用是什么?
2.swift如何上传一个文件?
3.如何查看swift列表?
在
控制节点
执行下面命令:
1.环境变量生效
source demo-openrc.sh
2.显示服务状态
swift stat
输出下面信息
Account: AUTH_bfb31e69f05b44cd89e1336c09042e2f
Containers: 0
Objects: 0
Bytes: 0
Content-Type: text/plain; charset=utf-8
X-Timestamp: 1424577028.33577
X-Trans-Id: tx0163866e80294069b81d3-0054e95204
X-Put-Timestamp: 1424577028.33577
3.上传一个测试文件
这里创建了一个testSwift文件
swift upload demo-container1 testSwift
4.列出容器
swift list
5.下载文件
swift download demo-container1 testSwift
遇到问题
执行命令:
swift list
产生如下错误:
Traceback (most recent call last):
File "/usr/bin/swift", line 10, in <module>
sys.exit(main())
File "/usr/lib/python2.7/dist-packages/swiftclient/shell.py", line 1287, in main
globals()['st_%s' % args[0]](parser, argv[1:], output)
File "/usr/lib/python2.7/dist-packages/swiftclient/shell.py", line 492, in st_stat
stat_result = swift.stat()
File "/usr/lib/python2.7/dist-packages/swiftclient/service.py", line 427, in stat
raise SwiftError('Account not found', exc=err)
swiftclient.service.SwiftError: 'Account not found'
不能定位错误,使用--debug,如下命令
swift --debug stat
输出下面信息
DEBUG:keystoneclient.auth.identity.v2:Making authentication request to http://controller:5000/v2.0/tokens
INFO:urllib3.connectionpool:Starting new HTTP connection (1): controller
DEBUG:urllib3.connectionpool:Setting read timeout to None
DEBUG:urllib3.connectionpool:"POST /v2.0/tokens HTTP/1.1" 200 2799
DEBUG:iso8601.iso8601:Parsed 2015-02-20T05:52:16Z into {'tz_sign': None, 'second_fraction': None, 'hour': u'05', 'daydash': u'20', 'tz_hour': None, 'month': None, 'timezone': u'Z', 'second': u'16', 'tz_minute': None, 'year': u'2015', 'separator': u'T', 'monthdash': u'02', 'day': None, 'minute': u'52'} with default timezone <iso8601.iso8601.Utc object at 0x7f0ddb06ba10>
DEBUG:iso8601.iso8601:Got u'2015' for 'year' with default None
DEBUG:iso8601.iso8601:Got u'02' for 'monthdash' with default 1
DEBUG:iso8601.iso8601:Got 2 for 'month' with default 2
DEBUG:iso8601.iso8601:Got u'20' for 'daydash' with default 1
DEBUG:iso8601.iso8601:Got 20 for 'day' with default 20
DEBUG:iso8601.iso8601:Got u'05' for 'hour' with default None
DEBUG:iso8601.iso8601:Got u'52' for 'minute' with default None
DEBUG:iso8601.iso8601:Got u'16' for 'second' with default None
INFO:urllib3.connectionpool:Starting new HTTP connection (1): controller
DEBUG:urllib3.connectionpool:Setting read timeout to None
DEBUG:urllib3.connectionpool:"HEAD /v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f HTTP/1.1" 503 0
INFO:swiftclient:REQ: curl -i http://controller:8080/v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f -I -H "X-Auth-Token: e0712594a90d47d398dc3e435648b0f6"
INFO:swiftclient:RESP STATUS: 503 Internal Server Error
INFO:swiftclient:RESP HEADERS: [('date', 'Fri, 20 Feb 2015 04:52:16 GMT'), ('content-length', '0'), ('content-type', 'text/html; charset=UTF-8'), ('x-trans-id', 'txf9179cecb3f84d2d89515-0054e6bd80')]
DEBUG:urllib3.connectionpool:Setting read timeout to None
DEBUG:urllib3.connectionpool:"HEAD /v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f HTTP/1.1" 503 0
INFO:swiftclient:REQ: curl -i http://controller:8080/v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f -I -H "X-Auth-Token: e0712594a90d47d398dc3e435648b0f6"
INFO:swiftclient:RESP STATUS: 503 Internal Server Error
INFO:swiftclient:RESP HEADERS: [('date', 'Fri, 20 Feb 2015 04:52:17 GMT'), ('content-length', '0'), ('content-type', 'text/html; charset=UTF-8'), ('x-trans-id', 'tx564066dbdf9c479a80317-0054e6bd81')]
DEBUG:urllib3.connectionpool:Setting read timeout to None
DEBUG:urllib3.connectionpool:"HEAD /v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f HTTP/1.1" 503 0
INFO:swiftclient:REQ: curl -i http://controller:8080/v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f -I -H "X-Auth-Token: e0712594a90d47d398dc3e435648b0f6"
INFO:swiftclient:RESP STATUS: 503 Internal Server Error
INFO:swiftclient:RESP HEADERS: [('date', 'Fri, 20 Feb 2015 04:52:19 GMT'), ('content-length', '0'), ('content-type', 'text/html; charset=UTF-8'), ('x-trans-id', 'tx8026db12471043108f8aa-0054e6bd83')]
DEBUG:urllib3.connectionpool:Setting read timeout to None
DEBUG:urllib3.connectionpool:"HEAD /v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f HTTP/1.1" 503 0
INFO:swiftclient:REQ: curl -i http://controller:8080/v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f -I -H "X-Auth-Token: e0712594a90d47d398dc3e435648b0f6"
INFO:swiftclient:RESP STATUS: 503 Internal Server Error
INFO:swiftclient:RESP HEADERS: [('date', 'Fri, 20 Feb 2015 04:52:23 GMT'), ('content-length', '0'), ('content-type', 'text/html; charset=UTF-8'), ('x-trans-id', 'tx672d65e6e5cc4bcb81a99-0054e6bd87')]
DEBUG:urllib3.connectionpool:Setting read timeout to None
DEBUG:urllib3.connectionpool:"HEAD /v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f HTTP/1.1" 503 0
INFO:swiftclient:REQ: curl -i http://controller:8080/v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f -I -H "X-Auth-Token: e0712594a90d47d398dc3e435648b0f6"
INFO:swiftclient:RESP STATUS: 503 Internal Server Error
INFO:swiftclient:RESP HEADERS: [('date', 'Fri, 20 Feb 2015 04:52:31 GMT'), ('content-length', '0'), ('content-type', 'text/html; charset=UTF-8'), ('x-trans-id', 'tx3b40cb1889c7403494571-0054e6bd8f')]
DEBUG:urllib3.connectionpool:Setting read timeout to None
DEBUG:urllib3.connectionpool:"HEAD /v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f HTTP/1.1" 503 0
INFO:swiftclient:REQ: curl -i http://controller:8080/v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f -I -H "X-Auth-Token: e0712594a90d47d398dc3e435648b0f6"
INFO:swiftclient:RESP STATUS: 503 Internal Server Error
INFO:swiftclient:RESP HEADERS: [('date', 'Fri, 20 Feb 2015 04:52:47 GMT'), ('content-length', '0'), ('content-type', 'text/html; charset=UTF-8'), ('x-trans-id', 'tx38758acf7fe74c5cb1597-0054e6bd9f')]
ERROR:swiftclient:Account HEAD failed: http://controller:8080/v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f 503 Internal Server Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line 1236, in _retry
rv = func(self.url, self.token, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line 521, in head_account
http_response_content=body)
ClientException: Account HEAD failed: http://controller:8080/v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f 503 Internal Server Error
Traceback (most recent call last):
File "/usr/bin/swift", line 10, in <module>
sys.exit(main())
File "/usr/lib/python2.7/dist-packages/swiftclient/shell.py", line 1287, in main
globals()['st_%s' % args[0]](parser, argv[1:], output)
File "/usr/lib/python2.7/dist-packages/swiftclient/shell.py", line 492, in st_stat
stat_result = swift.stat()
File "/usr/lib/python2.7/dist-packages/swiftclient/service.py", line 427, in stat
raise SwiftError('Account not found', exc=err)
swiftclient.service.SwiftError: 'Account not found'
下面错误是核心
INFO:swiftclient:REQ: curl -i http://controller:8080/v1/AUTH_bfb31e69f05b44cd89e1336c09042e2f -I -H "X-Auth-Token: e0712594a90d47d398dc3e435648b0f6"
INFO:swiftclient:RESP STATUS: 503 Internal Server Error
意思是:请求服务器资源,不能从服务器获取。
这里面有两方面错误:
要么是
问题可能性
1.账户错误
2.服务器错误
验证:
1.账户错误,创建了另外一个swift 代理节点,结果还是一样。
2.服务器错误
这个有两个节点object1和object2
因此object1和object2是关键。但是并不知道到底是哪里的错误。
因此采用谷歌、百度。
答案如下:
1.配置文件错误,即授权错误
auth_host, auth_port, 和 auth_protocol错误。
auth_host不能访问,本文是10.0.0.11,这个都是相互通信的,如果使用的是私有ip,可能产生问题。
本系列使用下面url来代替上面,使用的是controller
auth_uri = http://controller:5000/v2.0,所以不会这里的问题。
2.object节点发生改变, 下面三个包则需要重新复制到其他节点
account.ring.gz
container.ring.gz
object.ring.gz
上面方案是从百度谷歌得到,但是都没有起作用。
########################################
问题的原因:
由于这里使用的是虚拟机,object1配置完毕,对于object2直接使用的克隆的方式。
所以对object2做了如下核实措施:
1.mac地址重新生成
2.hostname在控制节点、object1和object2节点都必须包含如下内容:
10.0.0.51 object1
10.0.0.52 object2
3.配置文件管理ip,都必须替换成10.0.0.52.
再次执行swift stat,问题得到解决。
路过
雷人
握手
鲜花
鸡蛋
收藏
分享
邀请
举报
全部
作者的其他最新日志
•
种用于单张图像大尺度人脸三维重建的VRN算法
•
基于 Openpose 实现人体动作识别
•
基于OpenCV使用OpenPose进行多个人体姿态估计
•
《DensePose: Dense Human Pose Estimation In The Wild》阅读笔记
•
Field types of query result and registered TableSink do not match
•
Clickhouse bug DB::Exception: PeekableReadBuffer: Memory limit exceed
发表评论
评论 (
2
个评论)
回复
cxt
2015-8-17 21:09
请问我和版主swift stat遇到了一模一样的问题,debug后出现的内容都一模一样,但是我没有克隆虚拟机,hosts也都配置了,请问这个问题怎么解决?
回复
pig2
2015-8-18 04:08
不了解你的环境,一个问题原因可能比较多
涂鸦板
您需要登录后才可以评论
登录
|
立即注册
评论
pig2
加为好友
给我留言
打个招呼
发送消息
关闭
推荐
/2
中文版ChatGPT
1.无需魔法 2.提高编程效率 3.提高文档能力
查看 »
新手帮助
新手帮助:注册遇到问题,领取资源,加入铁粉群,不会使用搜索,如何获取积分等
查看 »
意见
反馈