[连载教程二]CentOS 6.3上通过源码安装Openstack Folsom之Keystone安装

[连载教程二]CentOS 6.3上通过源码安装Openstack Folsom之Keystone安装

原文 http://www.openstack.org.cn/blog/blog.php?do=showone&uid=15150&type=blog&itemid=77
作者 董权毅
 
 
系统环境
 
操作系统:CentOS 6.3 x86_64    
服务器网络:    
        eth0:172.16.24.138    
        eth1:quantum使用    
        quantum使用FlatDHCP模式




OpenStack软件版本

OpenStack组件名称 组件版本号
Nova 2012.2.2 [Folsom Releae第二次修正版]
Glance 2012.2.1 [Folsom Releae第一次修正版]
Keystone 2012.2.1 [Folsom Releae第一次修正版]
Cinder 2012.2.1 [Folsom Releae第一次修正版]
Quantum 2012.2.1 [Folsom Releae第一次修正版]
Horizon 2012.2.1 [Folsom Releae第一次修正版]

OpenStack组件名称 组件版本号
NoVNC GitHub
python-novaclient GitHub
python-glanceclient GitHub
python-keystoneclient GitHub
python-cinderclient GitHub
python-quantumclient GitHub
python-swiftclient GitHub




1. Keystone依赖库安装
yum install -y python-devel libxslt-devel openssl-devel MySQL-python


2. Keystone安装
 
wget https://launchpad.net/keystone/folsom/2012.2.1/+download/keystone-2012.2.1.tar.gz    
tar xf keystone-2012.2.1.tar.gz    
cd keystone-2012.2.1/tools    
pip-python install -r pip-requires    
cd ..    
python setup.py install


3. python-keystoneclient安装
 
git clone https://github.com/openstack/python-keystoneclient.git    
cd python-keystoneclient/tools/    
pip-python install -r pip-requires    
pip-python install hgtools    
pip-python install keyring    
cd ..    
python setup.py install    

4. 创建Keystone服务启动用户
useradd -c 'OpenStack Keystone Daemons' -s /sbin/nologin -d /var/lib/keystone keystone -M



4.1  创建Keystone配置文件目录及拷贝配置文件 (具体路径根据你解压keystone的路径来定)
 
mkdir /etc/keystone    
mkdir /var/log/keystone    
mkdir /var/lib/keystone    
mkdir /var/run/keystone    
cp /opt/keystone-2012.2.1/etc/default_catalog.templates /etc/keystone/    
cp /opt/keystone-2012.2.1/etc/keystone.conf.sample /etc/keystone/keystone.conf    
cp /opt/keystone-2012.2.1/etc/logging.conf.sample /etc/keystone/logging.conf    
cp /opt/keystone-2012.2.1/etc/policy.json /etc/keystone/    

4.2 创建及配置Keystone所使用MySQL数据库 ,如果报错 注意mysql服务是否启动
mysql -uroot -popenstack -e 'create database keystone'    
mysql -uroot -popenstack -e "grant select,insert,update,delete,create,alter,drop,index on keystone.* to keystone@localhost identified by 'keystone'"    


4.3 替换/etc/keystone/default_catalog.templates文件
  #示例配置文件中的ip地址请自行修改
wget http://www.xiaoyinzei.com/files/openstack/folsom/keystone/etc/default_catalog.templates    -O /etc/keystone/default_catalog.templates

 
4.4 下载keystone初始化数据脚本

  # 默认dashboard登陆密码secrete
  # 默认服务密码secrete
  # 默认服务tenant为tenant
wget http://www.xiaoyinzei.com/files/openstack/folsom/keystone/etc/keystone_data.sh -O /etc/keystone/keystone_data.sh


4.5 更改/etc/keystone/keystone.conf文件的如下一些选项
 
sed -i 's/# admin_token = ADMIN/admin_token = ADMIN/g' /etc/keystone/keystone.conf    
sed -i 's/# bind_host = 0.0.0.0/bind_host = 0.0.0.0/g' /etc/keystone/keystone.conf    
sed -i 's/# public_port = 5000/public_port = 5000/g' /etc/keystone/keystone.conf    
sed -i 's/# admin_port = 35357/admin_port = 35357/g' /etc/keystone/keystone.conf    
sed -i 's/# compute_port = 8774/compute_port = 8774/g' /etc/keystone/keystone.conf    
sed -i 's/# verbose = False/verbose = True/g' /etc/keystone/keystone.conf    
sed -i 's/# debug = False/debug = True/g' /etc/keystone/keystone.conf    
sed -i 's/# log_file = keystone.log/log_file = keystone.log/g' /etc/keystone/keystone.conf    
sed -i 's/# log_dir = \/var\/log\/keystone/log_dir = \/var\/log\/keystone/g' /etc/keystone/keystone.conf    
sed -i 's/# use_syslog = False/use_syslog = False/g' /etc/keystone/keystone.conf    
sed -i 's/# connection = sqlite:\/\/\/keystone.db/connection = mysql:\/\/keystone:keystone@localhost\/keystone/g' /etc/keystone/keystone.conf    
sed -i 's/# driver = keystone.identity.backends.sql.Identity/driver = keystone.identity.backends.sql.Identity/g' /etc/keystone/keystone.conf    
sed -i 's/# driver = keystone.catalog.backends.templated.TemplatedCatalog/driver = keystone.catalog.backends.templated.TemplatedCatalog/g' /etc/keystone/keystone.conf    
sed -i 's/# template_file = default_catalog.templates/template_file = \/etc\/keystone\/default_catalog.templates/g' /etc/keystone/keystone.conf    
sed -i 's/# driver = keystone.token.backends.kvs.Token/driver = keystone.token.backends.kvs.Token/g' /etc/keystone/keystone.conf    
sed -i 's/# expiration = 86400/expiration = 86400/g' /etc/keystone/keystone.conf    
sed -i 's/# driver = keystone.policy.backends.rules.Policy/driver = keystone.policy.backends.rules.Policy/g' /etc/keystone/keystone.conf    
sed -i 's/# driver = keystone.contrib.ec2.backends.kvs.Ec2/driver = keystone.contrib.ec2.backends.kvs.Ec2/g' /etc/keystone/keystone.conf    
 
 
 
 
4.6 配置Keystone日志备份机制
 
wget http://www.xiaoyinzei.com/files/openstack/folsom/keystone/logrotate/openstack-keystone.logrotate -O /etc/logrotate.d/openstack-keystone


4.7 创建Keystone服务管理脚本
wget http://www.xiaoyinzei.com/files/openstack/folsom/keystone/init/openstack-keystone.init -O /etc/rc.d/init.d/openstack-keystone


4.8 设置相关目录及文件权限

chown -R keystone:keystone /var/log/keystone    
chown -R keystone:keystone /var/lib/keystone    
chown -R keystone:keystone /var/run/keystone    
chmod 755 /etc/rc.d/init.d/openstack-keystone
 
4.9 初始化keystone数据库表结构
 
keystone-manage db_sync
 
4.10 启动keystone服务
 
/etc/init.d/openstack-keystone start


4.11 初始化keystone数据
bash /etc/keystone/keystone_data.sh



4.12 设置Keystone服务为系统服务并使服务开机自启
 
chkconfig --add openstack-keystone    
chkconfig --level 3 openstack-keystone on    

 

你可能感兴趣的:(openstack,keystone,folsom)