码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS 7部署OpenStack(1)-—准备基础环境

时间:2015-12-27 16:26:03      阅读:506      评论:0      收藏:0      [点我收藏+]

标签:openstack   centos7   

       本文主要安装最新版L版openstack,采用yum安装方式,编译安装后面后跟上。

操作指导:

       只有“#”的命令行表示在所有的节点均进行操作;命令行有主机名的表示仅在该主机上进行操作。

       另外,官方文档时间同步采用的是chrony,本文仍采用ntp服务。

1、系统环境

# uname -r

3.10.0-229.el7.x86_64

# cat /etc/redhat-release

CentOS Linux release 7.1.1503 (Core)

2、服务器部署

IP

主机名

角色

配置

192.168.1.11

controller

控制节点

M:4G;C:2C;50G

192.168.1.12

compute

计算节点

M:2G;C:2C;50G

3、基础环境准备

3.1、配置hosts

# cat /etc/hosts

192.168.1.11 controller

192.168.1.12 compute

[root@controller ~]# ping -c1 compute

PING compute (192.168.1.12) 56(84) bytes of data.

64 bytes from compute (192.168.1.12): icmp_seq=1 ttl=64 time=0.370 ms

 

--- compute ping statistics ---

1 packets transmitted, 1 received, 0% packet loss, time 0ms

rtt min/avg/max/mdev = 0.370/0.370/0.370/0.000 ms

[root@compute ~]# ping -c1 controller

PING controller (192.168.1.11) 56(84) bytes of data.

64 bytes from controller (192.168.1.11): icmp_seq=1 ttl=64 time=1.00 ms

 

--- controller ping statistics ---

1 packets transmitted, 1 received, 0% packet loss, time 1ms

rtt min/avg/max/mdev = 1.005/1.005/1.005/0.000 ms

3.2、配置时间同步

[root@controller ~]# yum install -y ntp

[root@controller ~]# vim /etc/ntp.conf

15 restrict -6 ::1

16 restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

27 restrict 0.centos.pool.ntp.org nomodify notrap noquery

28 restrict 1.centos.pool.ntp.org nomodify notrap noquery

29 restrict 2.centos.pool.ntp.org nomodify notrap noquery

30 restrict 3.centos.pool.ntp.org nomodify notrap noquery

31 server 127.127.1.0

32 fudge 127.127.1.0 stratum 10

[root@controller ~]# systemctl enable ntpd

[root@controller ~]# systemctl start ntpd

在控制节点可计算节点配置定时任务

[root@compute ~]# crontab -l

*/5 * * * * /usr/sbin/ntpdate 192.168.1.11 >/dev/null 2>&1

3.3、关闭防火墙

# systemctl stop firewalld

3.4、关闭selinux

# sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g‘ /etc/selinux/config  //需要重启

3.5、安装基础包

[root@controller ~]# yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

[root@controller ~]# yum install -y centos-release-openstack-liberty

[root@controller ~]# yum install -y python-openstackclient

3.6、安装mysql

[root@controller ~]# yum install -y mariadb mariadb-server MySQL-python

[root@controller ~]# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

[root@controller ~]# vim /etc/my.cnf

mysqld模块添加如下几行:

default-storage-engine = innodb

innodb_file_per_table

collation-server = utf8_general_ci  

init-connect = ‘SET NAMES utf8‘

character-set-server = utf8

[root@controller ~]# systemctl enable mariadb.service

[root@controller ~]# systemctl start mariadb.service

[root@controller ~]# mysql_secure_installation //设置root密码,具体步骤就不列出了

3.7、安装rabbitmq

[root@controller ~]# yum install -y rabbitmq-server

[root@controller ~]# systemctl enable rabbitmq-server.service

[root@controller ~]# systemctl start rabbitmq-server.service

[root@controller ~]# rabbitmqctl add_user openstack openstack

Creating user "openstack" ...

...done.

[root@controller ~]# rabbitmqctl set_permissions openstack ".*"".*" ".*"

Setting permissions for user "openstack" in vhost "/"...

...done.

[root@controller ~]# rabbitmq-plugins enable rabbitmq_management

[root@controller ~]# systemctl restart rabbitmq-server.service

在浏览器中输入http://192.168.1.11:15672,默认账户和密码为guest

登录后将前面创建的openstack用户加入到admin中,结果如下图:

技术分享



本文出自 “黑夜路人” 博客,请务必保留此出处http://kevinhao.blog.51cto.com/5204735/1728731

CentOS 7部署OpenStack(1)-—准备基础环境

标签:openstack   centos7   

原文地址:http://kevinhao.blog.51cto.com/5204735/1728731

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!