Openstack 环境准备篇
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Openstack 环境准备篇相关的知识,希望对你有一定的参考价值。
一、环境准备
1.配置controller节点
1)修改hostname
hostnamectlset-hostname controller
2)配置网络
vi /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=no
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=10.0.0.11
NETMASK=255.255.255.0
vi /etc/sysconfig/network-scripts/ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=none
NAME=eth1
DEVICE=eth1
ONBOOT=yes
3)配置hosts解析
vi/etc/hosts
10.0.0.11 controller
10.0.0.31 compute1
10.0.0.41 block1
10.0.0.51 object1
10.0.0.52 object2
:wq
reboot
2.配置compute节点
1)修改hostname
hostnamectl set-hostname compute1
2)配置网络
vi /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=no
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=10.0.0.31
NETMASK=255.255.255.0
:wq
vi /etc/sysconfig/network-scripts/ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=none
NAME=eth1
DEVICE=eth1
ONBOOT=yes
:wq
3)配置hosts解析
scp [email protected]:/etc/hosts /etc
reboot
剩下节点操作同上,配置完成之后ping通各个节点
3.安装时间服务器
1)安装控制节点
yum -y install chrony
vi /etc/chrony.conf
server controller iburst
server compute1 iburst
server block1 iburst
server object1 iburst
server object2 iburst
:wq
systemctl enable chronyd.service
systemctl start chronyd.service
2)安装compute节点
yum -y install chrony
vi /etc/chrony.conf
server controller iburst
systemctl enable chronyd.service
systemctl start chronyd.service
其他节点同compute节点相同
3)验证,在控制节点执行下面命令
chronyc sources
4.配置openstack软件安装源,我这里用的是centos7
yum install centos-release-openstack-mitaka
yum upgrade
在所有节点执行上面两步操作,重启服务器
1)安装openstack client
yum install python-openstackclient
yum install openstack-selinux
5.安装配置数据库服务
1)安装软件包
yum install mariadb mariadb-server python2-Pymysql
2)创建并编辑/etc/my.cnf.d/openstack.cnf
vi /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 10.0.0.11
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
3)启动服务,并加入开机启动
systemctl enable mariadb.service
systemctl start mariadb.service
4)数据库安全设置,配置数据密码,其他全部yes
mysql_secure_installation
6.安装nosql数据库
1)安装MongDB包
yum install mongodb-server mongodb
2)编辑文件/etc/mongod.conf
vi /etc/mongod.conf
bind_ip = 10.0.0.11
smallfiles = true
3)启动服务,并加入开机启动
systemctl enable mongod.service
systemctl start mongod.service
7.安装消息队列服务
1)安装包
yum install rabbitmq-server
2)启动消息队列服务并将其配置为随系统启动
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
3)添加openstack用户
rabbitmqctl add_user openstack 123123
4)给openstack用户配置和读写权限
rabbitmqctl set_permissions openstack “.*”“.*” “.*”
8.安装Memcached
1)安装软件包
yum install memcached python-memcached
2)启动服务,并加入开机启动
systemctl enable memcached.service
systemctl start memcached.service
本文出自 “19941212” 博客,请务必保留此出处http://19941212.blog.51cto.com/11630936/1900229
以上是关于Openstack 环境准备篇的主要内容,如果未能解决你的问题,请参考以下文章
openstack 入门 准备篇二:基础环境的搭建和配置centos M版本
准备 KVM 实验环境 - 每天5分钟玩转 OpenStack