CentOS 7部署OpenStack(1)-—準備基礎環境

來源:互聯網
上載者:User

標籤: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

[[email protected] ~]# 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

[[email protected] ~]# 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、配置時間同步

[[email protected] ~]# yum install -y ntp

[[email protected] ~]# 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

[[email protected] ~]# systemctl enable ntpd

[[email protected] ~]# systemctl start ntpd

在控制節點可計算節點配置定時任務

[[email protected] ~]# 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、安裝基礎包

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

[[email protected] ~]# yum install -y centos-release-openstack-liberty

[[email protected] ~]# yum install -y python-openstackclient

3.6、安裝mysql

[[email protected] ~]# yum install -y mariadb mariadb-server MySQL-python

[[email protected] ~]# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

[[email protected] ~]# 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

[[email protected] ~]# systemctl enable mariadb.service

[[email protected] ~]# systemctl start mariadb.service

[[email protected] ~]# mysql_secure_installation //設定root密碼,具體步驟就不列出了

3.7、安裝rabbitmq

[[email protected] ~]# yum install -y rabbitmq-server

[[email protected] ~]# systemctl enable rabbitmq-server.service

[[email protected] ~]# systemctl start rabbitmq-server.service

[[email protected] ~]# rabbitmqctl add_user openstack openstack

Creating user "openstack" ...

...done.

[[email protected] ~]# rabbitmqctl set_permissions openstack ".*"".*" ".*"

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

...done.

[[email protected] ~]# rabbitmq-plugins enable rabbitmq_management

[[email protected] ~]# systemctl restart rabbitmq-server.service

在瀏覽器中輸入http://192.168.1.11:15672,預設賬戶和密碼為guest

登入後將前面建立的openstack使用者加入到admin中,結果如:

650) this.width=650;" src="http://s5.51cto.com/wyfs02/M02/78/86/wKioL1Z_WxmgqV4BAAAWZHwHLSA329.png" title="1.png" alt="wKioL1Z_WxmgqV4BAAAWZHwHLSA329.png" />



本文出自 “黑夜路人” 部落格,請務必保留此出處http://kevinhao.blog.51cto.com/5204735/1728731

CentOS 7部署OpenStack(1)-—準備基礎環境

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.