设为首页 收藏本站
查看: 2697|回复: 0

[经验分享] centos 7.0 安装openstack

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-1-28 08:59:13 | 显示全部楼层 |阅读模式
参考官方文档:http://docs.openstack.org/juno/i ... stall/yum/content/#
三个节点ip信息
controller:192.168.100.10
network:192.168.100.20
compute1:192.168.100.30
修改各节点的/etc/hosts 文件
wKiom1TAajKDLYKYAAFNPfW8_pQ981.jpg
测试各节点到openstack.org的连通性
wKioL1TAa3CAf-HNAAFyCTMUKaE477.jpg

controller node
配置NTP服务
yum install -y ntp
vi /etc/ntp.conf 修改文件如下:
server NTP_SERVER iburst  #此处未做修改,采用默认
restrict -4 default kod notrap nomodify
restrict -6 default kod notrap nomodify

systemctl  enable ntpd.service    #开机启动
systemctl  start ntpd.service
wKioL1TAbdKimEJtAAE2WVcZd3o129.jpg

其他节点同样安装
yum install ntp
修改/etc/ntp.conf文件如下:
server controller iburst

开机启动服务:

systemctl enable ntpd.service
systemctl start ntpd.service
wKiom1TAbUyyX5xmAAD20DMN83A012.jpg

OpenStack packages

Install the yum-plugin-priorities package to enable assignment of relative priorities within repositories:
# yum install -y yum-plugin-priorities

Install the epel-release package to enable the EPEL repository:
# yum install http://dl.fedoraproject.org/pub/ ... ease-7-5.noarch.rpm

Install the rdo-release-juno package to enable the RDO repository:

# yum install http://rdo.fedorapeople.org/openstack-juno/rdo-release-juno.rpm

Upgrade the packages on your system:
# yum upgrade
# reboot

RHEL and CentOS enable SELinux by default. Install the openstack-selinux package to automatically manage security policies for OpenStack services:
# yum install openstack-selinux
安装如果报错,可通过下面安装:
#yum install http://repos.fedorapeople.org/re ... 2.el7ost.noarch.rpm

To install and configure the database server
# yum install mariadb mariadb-server MySQL-python
修改/etc/my.cnf
bind-address = 127.0.0.1
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

wKiom1TBpdvDPwcvAAKeZyrVL4M022.jpg
# systemctl enable mariadb.service

# systemctl start mariadb.service


To install the RabbitMQ message broker service
# yum install rabbitmq-server
# systemctl enable rabbitmq-server.service
# systemctl start rabbitmq-server.service
启动服务时出现如下错误:
wKioL1TBwPDjOUxwAAZjs0aYY4Q166.jpg

# rabbitmqctl change_password guest 123456
执行时如果有报错
wKioL1TBwG-SD5LGAAFgfoAKfhQ164.jpg


Identity service Install and configure
# mysql
> create database keystone;
> grant all privileges on keystone.* to 'keystone'@'localhost' identified by 'test01';
> grant all privileges on keystone.* to 'keystone'@'%' identified by 'test01';

# openssl rand -hex 10
02456f17dc198d827a90         #值不一样
wKiom1THA_CRFeLeAABgs32zeGU103.jpg

# yum install openstack-keystone python-keystoneclient

修改 /etc/keystone/keystone.conf
[DEFAULT]
...
admin_token= 02456f17dc198d827a90
verbose = True
  [database]
...
connection=mysql://keystone:test01@localhost/keystone
[token]
...
provider = keystone.token.providers.uuid.Provider
driver =keystone.token.persistence.backends.sql.Token

# keystone-manage pki_setup --keystone-user keystone --keystone-group keystone
# chown -R keystone:keystone /var/log/keystone
# chown -R keystone:keystone /etc/keystone/ssl
# chmod -R o-rwx /etc/keystone/ssl
# su -s /bin/sh -c "keystone-manage db_sync" keystone 或者 keystone-manage db_sync
# systemctl enable openstack-keystone
# systemctl start openstack-keystone

Create tenants, users, and roles
# export OS_SERVICE_TIOEN=02456f17dc198d827a90
# export OS_SERVICE_ENDPOINT=http://controller:35357/v2.0
Create the admin tenant:
# keystone tenant-create --name admin --description "Admin Tenant"
wKiom1TFpMWTXxUTAADO5ufVCS4796.jpg
Create the admin user:

# keystone user-create --name admin --pass test01 --email admin@test.com
wKiom1TFpabBRiPjAAD8HIL1IGg246.jpg
Create the admin role:
# keystone role-create --name admin wKiom1TFplLz1w34AACyP8sbYi4342.jpg
Add the admin role to the admin tenant and user:
# keystone user-role-add --user admin --tenant admin --role admin

Create a demo tenant and user for typical operations in your environment:
Create the demo tenant:
# keystone tenant-create --name demo --description "Demo Tenant"
wKioL1TFqCfy5UNKAAD2Z2lusIE327.jpg
Create the demo user under the demo tenant:
# keystone user-create --name demo --tenant demo --pass test01 --email admin@test.com
wKioL1TFqLiAmsVsAAEm7Jp4OQw549.jpg
Create the service tenant:
# keystone tenant-create --name service --description "Service Tenant"
wKioL1TFqWfh9gWTAADyPvLvGRA341.jpg
Create the service entity for the Identity service:
# keystone service-create --name keystone --type identity --description "Openstack Identity"
wKiom1TFs0uhcTQhAAEJKQpRJD4453.jpg
Create the Identity service API endpoints:
# keystone endpoint-create --service-id $(keystone service-list | awk '/ identity / {print $2}') --publicurl http://controller:5000/v2.0 --internalurl http://controller:5000/v2.0 --adminurl http://controller:35357/v2.0 --region regionOne
wKioL1TFtzvBlhKgAAGVS8Qrr_A136.jpg


# unset OS_SERVICE_TOKEN OS_SERVICE_ENDPOINT
# keystone --os-tenant-name admin --os-username admin --os-password test01 --os-auth-url http://controller:35357/v2.0 token-get
wKiom1TFuIexQQLtAAFIFT0B9k8887.jpg
# keystone --os-tenant-name admin --os-username admin --os-password test01 --os-auth-url http://controller:35357/v2.0 tenant-list
wKioL1TF0ErxQdXjAAE1ivJjzPo216.jpg
# keystone --os-tenant-name admin --os-username admin --os-password test01 --os-auth-url http://controller:35357/v2.0 user-list
wKioL1TF0YqALpOxAAFQ-YV8Bpo356.jpg
# keystone --os-tenant-name admin --os-username admin --os-password test01 --os-auth-url http://controller:35357/v2.0 role-list
wKioL1TF0jSAG1Y4AADY-quljww342.jpg
# keystone --os-tenant-name demo --os-username demo --os-password test01 --os-auth-url http://controller:35357/v2.0 token-get
wKiom1TF0lOww_HlAAFJv90uOEo046.jpg
# keystone --os-tenant-name demo --os-username demo --os-password test01 --os-auth-url http://controller:35357/v2.0 user-list




Add the Image Service(in controller node)
To configure prerequisites
#mysql -u root
> create database glance;
> grant all privileges on glance.* to 'glance'@'localhost' identified by 'test01';
> grant all privileges on glance.* to 'glance'@'%' identified by 'test01';
>quit

# source admin-openrc.sh
# keystone user-create --name glance --pass test01 --email admin@test.com
wKioL1TG8lWxrB13AADyVagx0VE874.jpg
# keystone user-role-add --user glance --tenant service --role admin

# keystone service-create --name glance --type image --description "Openstack Image Service"
wKioL1TF4WfwpfLlAAEDeK__INM407.jpg

# keystone endpoint-create --service-id $(keystone service-list | awk '/ image / {print $2}') --publicurl http://controller:9292 --internalurl http://controller:9292 --adminurl http://controller:9292 --region regionOne
wKioL1TF4gmx9QsdAAFr4tw_xx0044.jpg


To install and configure the Image Service components
# yum install openstack-glance python-glanceclient
# vi /etc/glance/glance-api.conf
[DEFAULT]
verbose=True

[database]
connection=mysql://glance:test01@controller/glance


[keystone_authtoken]
auth_uri = http://controller:5000/v2.0
identity_uri=http://controller:35357
admin_tenant_name=service
admin_user=glance
admin_password=test02

[paste_deploy]
flavor=keystone
filesystem_store_datadirs=/var/lib/glance/images/

[glance_store]
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

# vi /etc/glance/glance-registry.conf
[DEFAULT]
verbose=True

[paste_deploy]
flavor = keystone


[database]
connection=mysql://glance:test01@controller/glance

[keystone_authtoken]
auth_uri=http://controller:5000/v2.0
identity_uri=http://controller:35357
admin_tenant_name=service
admin_user=glance
admin_password=test02

# su -s /bin/sh -c "glance-manage db_sync" glance
# systemctl enable openstack-glance-api.service openstack-glance-registry.service
# systemctl start openstack-glance-api.service openstack-glance-registry.service

#mkdir /tmp/images
#cd /tmp/images
# wget http://cdn.download.cirros-cloud ... 3.3-x86_64-disk.img
#source admin-openrc.sh     (要先进入admin-openrc.sh的目录下才有效,本次默认在/root/下)
#cd /tmp/images
# glance image-create --name "cirros-0.3.3-x86_64" --file cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-41609-1-1.html 上篇帖子: openstack icehouse 安装消息队列模块rabbitmq 下篇帖子: Openstack-Cinder multi backend
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表