《1》CentOS7.0 OpenStack kvm雲平臺部署—基礎配置

NO IMAGE

感謝朋友支援本部落格,歡迎共同探討交流,由於能力和時間有限,錯誤之處在所難免,歡迎指正!
如果轉載,請保留作者資訊。
部落格地址:http://blog.csdn.net/qq_21398167

原博文地址:http://blog.csdn.net/qq_21398167/article/details/46385573

一.主機分配:

主機名        IP(Static)   
   系統配置                                      角色

openstack      192.168.1.2    CentOS-7.0-x86_64-desktop     4CPU,16G RAM,300G DISK,2網絡卡       管理節點/計算節點

node          192.168.1.3    CentOS-7.0-x86_64-desktop    4CPU,16G RAM,300G DISK,2網絡卡        計算節點

(首先確定本機是否已經設定支援虛擬化)

1、進入BIOS。開機時按F2或F12或DEL或ESC等鍵(各電腦有所不同)。 

2、進入BIOS後,找到Configuration選項,選擇Intel Virtual Technology並回車,將游標移至Enabled,然後再回車,最後按F10儲存並退出。  

如果找不到Configuration選項,可以試試下面的方法: 

(1)某些HP(惠普)電腦進入BIOS後,需要選擇SystemConfiguration(系統配置)選單,

然後選擇Device Configuration(裝置配置),找到Virtualization Technology,設定為Enabled。 

(2)某些聯想Thinkpad電腦進入BIOS後,需要選擇Security選單,然後選擇Virtualization,設定為Enabled。 

(3)某些DELL(戴爾)電腦進入BIOS後,需要選擇Processor Settings選單,然後選擇VirtualizationTechnology,設定為Enabled。
二、管理節點安裝(OpenStack)

1.基礎配置

作業系統使用CentOS-7.0-x86_64.iso,安裝過程省略,本文采用yum源安裝。

(1).匯入第三方安裝源

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

[[email protected] ~]# rpm -Uvhhttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

[[email protected] ~]# yum install
http://repos.fedorapeople.org/repos/openstack/openstack-havana/rdo-release-havana-9.noarch.rpm    (下載這個的時候  如果出現有pid
阻止,就用kill殺了)

把附帶的壓縮包源解壓放到/etc/yum.repo.d/目錄下面

修改rdo-release.repo配置檔案。將gpgcheck=1修改為=0

(如果後期yum安裝的時候出現無法找到源,嘗試用附帶的CentOS-Base.repo代替原來的)

(2).配置/etc/hosts檔案

[[email protected] ~]# vi /etc/hosts

127.0.0.1   localhostlocalhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomainlocalhost6 localhost6.localdomain6

192.168.1.2   openstack

192.168.1.3   node

 

(3).配置網路

如果你已經安裝完了,希望改成eth0這樣的名稱,那麼需要:

修改grub2啟動引數

vi /etc/sysconfig/grub

GRUB_CMDLINE_LINUX=”rd.lvm.lv=vg0/swapvconsole.keymap=us crashkernel=auto  vconsole.font=latarcyrheb-sun16net.ifnames=0 biosdevname=0 rd.lvm.lv=vg0/usr rhgb quiet”

grub2-mkconfig -o /boot/grub2/grub.cfg

重新對檔案進行命名:

/etc/sysconfig/network-scripts/ifcfg-*

然後執行:

# grub2-mkconfig -o /boot/grub2/grub.cfg

重新啟動電腦 就能看見名字已經改過來了

 

[[email protected] ~]# vi/etc/sysconfig/network-scripts/ifcfg-eth0 

DEVICE=”eth0″

BOOTPROTO=”static”

HWADDR=”E4:1F:13:45:AB:C8″

ONBOOT=”yes”

IPADDR=192.168.1.2(根據自己的IP而定)

NETMASK=255.255.255.0

GATEWAY=192.168.1.1

TYPE=”Ethernet”

[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=”eth1″

BOOTPROTO=”none”

HWADDR=”E4:1F:13:45:AB:CA”

ONBOOT=”yes”

TYPE=”Ethernet”

 

(4).關閉selinux:

[[email protected] ~]# more/etc/selinux/config 

# This file controls the state of SELinuxon the system.

# SELINUX= can take one of these threevalues:

#       enforcing – SELinuxsecurity policy is enforced.

#       permissive – SELinuxprints warnings instead of enforcing.

#       disabled – SELinuxis fully disabled.

SELINUX=disabled

# SELINUXTYPE= type of policy in use.Possible values are:

#       targeted – Onlytargeted network daemons are protected.

#       strict – FullSELinux protection.

SELINUXTYPE=targeted

[[email protected] ~]# setenforce 0

(5).修改/etc/sysctl.conf引數:

[[email protected] ~]# vi/etc/sysctl.conf

……………………

net.ipv4.ip_forward = 1

……………………
[[email protected] ~]#sysctl -p                   #使sysctl.conf配置生效

 

2.安裝配置NTP服務

(1).安裝NTP服務:

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

如果報錯 HTTP Error 404 –Not Fount

修改配置檔案 /etc/yum.repos.d/foreman.repo

改為:baseurl=http://yum.theforeman.org/releases/1.5/el6/x86_64

(把原來的el7改為el6)

 

(2).配置NTP服務:

[[email protected] ~]# vi /etc/ntp.conf

driftfile /var/lib/ntp/drift

restrict default ignore

restrict 127.0.0.1 

restrict 192.168.1.0 mask255.255.255.0 nomodify notrap

server ntp.api.bz

server  127.127.1.0     #local clock

fudge   127.127.1.0 stratum 10

keys /etc/ntp/keys

(3).啟動NTP服務,設定開機自啟動:

[[email protected] ~]# service ntpd start

[[email protected] ~]# chkconfig ntpd on

 

3.配置安裝MySQL:

(1).安裝MySQL服務:

[[email protected] ~]# yum -yinstall mariadb mariadb-galera-server MySQL-python

 

(2).啟動MqSQL服務,設定開機自啟動:

[[email protected] ~]# service mysqld start

[[email protected] ~]# chkconfig mysqld on

 

(3).修改MySQL密碼為passwd:

[[email protected] ~]# mysqladmin –uroot–p password passwd

後面的passwd是要設定的密碼,回車後出現Enter password  
輸入就密碼,如果沒有,直接回車

 

4.安裝配置qpid服務

(1).安裝qpid服務:

[[email protected]~]# yum -y install qpid-cpp-server memcached

 

(2).修改/etc/qpidd.conf配置檔案,將auth設定為no:

[[email protected] ~]# vi  /etc/qpid/qpidd.conf

……………………

auth=no

(3).啟動qpid服務,設定開機啟動:

[[email protected] ~]# service qpidd start

[[email protected] ~]# chkconfig qpidd on

(4).安裝OpenStack工具包:

[[email protected] ~]# yum install-y openstack-utils