Centos7 Openstack

 

Centos7 install Openstack - (第一节)基本环境配置

我的blog地址:http://www.cnblogs.com/caoguo

根据openstack官方文档配置

官方文档地址: http://docs.openstack.org/juno/install-guide/install/yum/content/#

0x01.网络配置

#准备服务器
192.168.88.133  controller
192.168.88.134  network
192.168.88.135  compute1


#配置所有节点的hosts
cat >/etc/hosts <<EOF
192.168.88.133  controller
192.168.88.134  network
192.168.88.135  compute1
EOF


#测试所有hosts添加是否生效
ping -c 4 controller;ping -c 4 network;ping -c 4 compute1

#关闭防火墙和selinux
systemctl stop firewalld;setenforce 0

0x02.NTP网络时间服务器

a)主节点配置
    [root@controller ~]# yum install -y ntp
    [root@controller ~]# vi /etc/ntp.conf
    #server NTP_SERVER iburst
    restrict 192.168.88.0 mask 255.255.255.0 nomodify notrap
    restrict -4 default kod notrap nomodify
    restrict -6 default kod notrap nomodify

    [root@controller ~]# systemctl enable ntpd.service
    [root@controller ~]# systemctl start ntpd.service

b)其他节点
    [root@network ~]# yum install -y ntp
    [root@network ~]# echo "server controller iburst" >/etc/ntp.conf
    [root@network ~]# systemctl enable ntpd.service
    [root@network ~]# systemctl start ntpd

    [root@compute1 ~]# yum install -y ntp
    [root@compute1 ~]# echo "server controller iburst" >/etc/ntp.conf
    [root@compute1 ~]# systemctl enable ntpd.service
    [root@compute1 ~]# systemctl start ntpd


c)确认以上操作是否成功(所有节点)
ntpq -c peers; ntpq -c assoc

0x03.OpenStack packages(所有节点)

    yum install -y yum-plugin-priorities
    yum install -y http://mirrors.opencas.cn/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
    yum install -y http://rdo.fedorapeople.org/openstack-juno/rdo-release-juno.rpm
    yum install -y openstack-selinux

0x04.数据库(控制节点)

[root@controller ~]# yum install -y mariadb mariadb-server MySQL-python
[root@controller ~]# vi /etc/my.cnf
[mysqld]
bind-address = 192.168.88.133
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 
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] n
 ... skipping.

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

0x05.消息服务(控制节点)

[root@controller ~]# yum install -y rabbitmq-server
[root@controller ~]# systemctl enable rabbitmq-server.service
[root@controller ~]# systemctl start rabbitmq-server.service
[root@controller ~]# rabbitmqctl change_password guest RABBIT_PASS
Changing password for user "guest" ...
...done.

[root@controller ~]# rabbitmqctl status | grep rabbit
Status of node rabbit@controller ...
 {running_applications,[{rabbit,"RabbitMQ","3.3.5"},

[root@controller ~]# echo '[{rabbit, [{loopback_users, []}]}].' >/etc/rabbitmq/rabbitmq.config
[root@controller ~]# systemctl restart rabbitmq-server.service
原文地址:https://www.cnblogs.com/caoguo/p/4927824.html