传奇牛仔官网:Openstack?Keystone?dashboard?swift?AllInOne

来源:百度文库 编辑:中财网 时间:2024/04/27 15:53:35
Openstack Keystone dashboard swift AllInOne
(2011-09-14 10:48:55)转载▼
标签:it
分类:swift
本文目的在于swift+Keystone+dashboard 安装
对swift的安装本文就先行忽略,keystone安装在swift的proxy节点处,为实验简单性,所使用的环境的ESXi上的一台ubuntu11.04 的32bit 虚拟机
一) 源码安装
Git clonehttps://github.com/openstack/keystone.git ~/keystone
主要安装步骤可以参考keystone源码包中的README.md
依赖项
# Showdependencies
$ cattools/pip-requires
# You may need to installdevelopment files before using 'pip install'
# For example:
#   sudo apt-get installpython-dev libxml2-dev libxslt1-dev libsasl2-dev libldap2-devlibsqlite3-dev libssl-dev
因此先要安装
apt-get install python-devlibxml2-dev libxslt1-dev libsasl2-dev libldap2-dev libsqlite3-devlibssl-dev
# Install dependencies (forproduction, testing, and development)
$ pip install -rtools/pip-requires
pip install passlib
这个过程需要花一定的时间
# Optional: Install Memcache(if enabled as a backend)
Refer#(http://memcached.org/)
安装Memcache(可选)
运行 Keystone
配置文件在 etc/keystone.conf 包括各服务的绑定端口和ip修改,可将该文件拷贝到/etc目录下
与swift集成,在proxy节点处
$ swift-init allstop
$ cd ~/keystone/bin&& ./keystone
Starting the RAX-KEYextension
Starting the LegacyAuthentication component
Service API listening on0.0.0.0:5000
Admin API listening on0.0.0.0:35357
开启另一个控制台终端
editthe ~/keystone/keystone/test/sampledata.py file,这个脚本是keystone-manage向keystone添加user,token及服务等,根据实际情况作相应修改
Inanother window, edit the ~/keystone/keystone/test/sampledata.py file,find the swift.publicinternets.com textand replace it with the URL to your Swift cluster using thefollowing format (note that we're going to change Swift to run onport 8888 later):http://127.0.0.1:8888/v1/AUTH_%tenant_id%
Create the sample dataentries:
$ cd ~/keystone/bin&& ./sampledata
这一步是调用执行上面的sampledata.py文件,在keystone中进行注册。
$ 多次运行sampledata会报错,那是因为数据库已经有先运行保留的数据原因,你应该删除数据库的记录,默认是sqlite3的话,你可以直接删除keystone.db这个文件
如果是mysql,可以
mysql -uroot -p123456 -e'DROP DATABASE IF EXISTS keystone;'
mysql -uroot -p123456 -e 'CREATE DATABASE keystone;'
Reconfigure Swift's proxy server to use Keystone instead ofTempAuth. Here's an example /etc/swift/proxy-server.conf:
[DEFAULT]
bind_port = 8888
user = root
[pipeline:main]
pipeline = catch_errorscache keystone proxy-server
[app:proxy-server]
use =egg:swift#proxy
account_autocreate =true
[filter:keystone]
use =egg:keystone#tokenauth
auth_protocol =http
auth_host =127.0.0.1
auth_port = 35357
admin_token =999888777666
delay_auth_decision =0
service_protocol =http
service_host =127.0.0.1
service_port =5000
service_pass =dTpw
[filter:cache]
use =egg:swift#memcache
set log_name =cache
[filter:catch_errors]
use =egg:swift#catch_errors
$ swift-init mainstart
Joeuser用户已经在运行./sampledata 时生成
$ swift -Ahttp://127.0.0.1:5000/v1.0 -U joeuser -K secrete postcontainer
$ swift -Ahttp://127.0.0.1:5000/v1.0 -U joeuser -K secrete stat -v
StorageURL:http://127.0.0.1:8888/v1/AUTH_1234
Auth Token:74ce1b05-e839-43b7-bd76-85ef178726c3
Account:AUTH_1234
Containers: 1
Objects: 0
Bytes: 0
Accept-Ranges:bytes
X-Trans-Id:tx25c1a6969d8f4372b63912f411de3c3b
想手动添加用户,可以使用keystone-manage命令,具体参考
http://keystone.openstack.org/man/keystone-manage.html
OpenStack Dashboard 安装
git clone https://github.com/openstack/horizon
cdopenstack-dashboard/openstack-dashboard
cplocal/local_settings.py.example local/local_settings.py
vimlocal/local_settings.py
# FIXME: This needs to be changed to allow for multi-nodesetup.
OPENSTACK_KEYSTONE_URL = "http://localhost:5000/v2.0/"
OPENSTACK_KEYSTONE_ADMIN_URL = "http://localhost:35357/v2.0"
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
# NOTE(tres): Available services should come from theservice
#            catalog inKeystone.
SWIFT_ENABLED = True
Install Horizon
$ apt-get install -y python-setuptools $ sudo easy_install virtualenv$ python tools/install_venv.pyInstalling the virtual environment will take some time depending ondownload speeds.
Run Horizon
启动dashboard的web服务
tools/with_venv.shdashboard/manage.py runserver 0.0.0.0:8000
成功后可以在浏览器输入:http://dashboardhost:8000/进入登入界面
可选如果出现dashboard登入不了的情况,则可以选择数据同步
tools/with_venv.shdashboard/manage.py syncdb
分享分享到新浪Qing
0

阅读(502)┊评论 (0)┊收藏(0) ┊转载(2) ┊顶▼ ┊打印┊举报
已投稿到:排行榜圈子
前一篇:swift 多节点安装 (openstack swift install Multinode)
后一篇:python ubuntu下eclipse 及vim 完美配置