Bootstrap

安装先电OpenStack

安装先电OPENSTACK

一、安装环境准备

1、CentOS-7-x86_64-DVD-1511.iso

2、XianDian-IaaS-v2.2.iso

二、虚拟机安装

1、安装controller

(安装过程也踩了很多坑,其中也向王大佬请教了很多问题,在此衷心感谢。ip地址可以根据自己的习惯设置,我的是由于之前安装hadoop分配到102,这里为了方便记就从103开始)
(1)文件下面选择:新建虚拟机按照下图所示创建

在这里插入图片描述

(2)下一步

在这里插入图片描述

(3)选择合适版本

在这里插入图片描述

(4)设置名称和位置

在这里插入图片描述

(5)根据电脑选择

在这里插入图片描述

(6)我这里分配了5G

在这里插入图片描述

(7)下一步
由于校园网分配Ip可能不一样,我这里是设置了一台NAT一台主机,注意顺序,后面配置过程有网卡分区,要记住自己的

在这里插入图片描述

(8)默认

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

(9)注意选择虚拟化引擎项

在这里插入图片描述

(10)两个CD第一个选择Centos,第二个选择XianDian

在这里插入图片描述
在这里插入图片描述在这里插入图片描述

在这里插入图片描述

(11)启动虚拟机

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-qB8aqFCS-1618399623418)(picture/18.png)]

稍等一会就好了~~~~
在这里插入图片描述

(12)设置语言为英语

在这里插入图片描述

(13)选择时区上海

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-9VJ3Fqlr-1618399623421)(picture/21.png)]

(14)该项选择disable,关闭dump

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ufhTdW9T-1618399623422)(picture/22.png)]

(15)DESTINATION项进去选择第一块硬盘

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-qHC9ebgE-1618399623423)(picture/23.png)]

(16)选择我要配置分区,之后Done

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lJ2bDXg4-1618399623424)(picture/24.png)]

(17)选择自动分配分区,由于开始设置了60G,这里我选择将home删除,将余下得全部分配给/

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Ad7UW1is-1618399623425)(picture/25.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-IGSbMvM2-1618399623426)(picture/26.png)]

(18)配置网络
第一块的网卡和第二块需要注意,对应到后面配置文件,一定要看好!!!

在这里插入图片描述

根据自己情况配置

在这里插入图片描述
在这里插入图片描述

第二块

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

到此controller安装完毕

2、安装compute

(1)前面部分和controller一样,详细见上面部分
(2)compute有三个磁盘均分配50G,两个CD/DVD和两个网络

在这里插入图片描述

CD/DVD一个也OK

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-6nrVLCMk-1618399623436)(picture/35.png)]

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Fe5yk9fI-1618399623437)(picture/36.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-DIbpKIPw-1618399623438)(picture/37.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-98kK924V-1618399623439)(picture/38.png)]

(3)选择第一个磁盘进行自动分配

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-xlRJsvVP-1618399623440)(picture/39.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-RgLvSnb6-1618399623441)(picture/40.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nzafsXza-1618399623443)(picture/41.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-TS1PYSrJ-1618399623444)(picture/42.png)]

(4)配置网络

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-zqcBFdYw-1618399623445)(picture/43.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-5j7WJOSD-1618399623446)(picture/44.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-K7SK30bB-1618399623447)(picture/45.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ft1dmSn2-1618399623448)(picture/46.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-XDOBlKwt-1618399623449)(picture/47.png)]

三、环境准备

1、配置controller的网络环境

(1)代码部分
[root@controller ~]# mkdir repo
mkdir: cannot create directory ‘repo’: File exists
[root@controller ~]# rmdir repo
[root@controller ~]# mkdir repo
[root@controller ~]# cd /etc/sysconfig/network-scripts/
[root@controller network-scripts]# ll
[root@controller network-scripts]# vi ifcfg-eno16777736 

TYPE="Ethernet"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eno16777736"
UUID="d69efd99-2f19-457e-8bfc-139bf23d5b9c"
DEVICE="eno16777736"
ONBOOT="yes"
IPADDR="192.168.1.103"
PREFIX="24"
GATEWAY="192.168.1.2"
DNS1="114.114.114.114"
DNS2="192.168.1.2"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_PRIVACY="no"

[root@controller network-scripts]# vi ifcfg-eno33554960 

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eno33554960
UUID=b2890c42-6766-4d91-9a29-8fd0b6a65dbb
DEVICE=eno33554960
ONBOOT=yes
IPADDR=192.168.100.103
PREFIX=24
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no
~                                                            
[root@controller ~]# cp /etc/sysconfig/network-scripts/ifcfg-eno* /root/repo
[root@controller ~]# ls repo
ifcfg-eno1  ifcfg-eno16777736  ifcfg-eno33554960
[root@controller ~]# 


[root@controller ~]# ip a
[root@controller ~]# ping www.baidu.com
[root@controller ~]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.103  controller
192.168.1.104  compute


[root@controller ~]# ping controller
PING controller (192.168.1.103) 56(84) bytes of data.
64 bytes from controller (192.168.1.103): icmp_seq=1 ttl=64 time=0.028 ms
64 bytes from controller (192.168.1.103): icmp_seq=2 ttl=64 time=0.059 ms
64 bytes from controller (192.168.1.103): icmp_seq=3 ttl=64 time=0.047 ms
64 bytes from controller (192.168.1.103): icmp_seq=4 ttl=64 time=0.092 ms
^C
--- controller ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.028/0.056/0.092/0.024 ms
[root@controller ~]# reboot


[root@controller ~]# iptables -F
[root@controller ~]# iptables -X
[root@controller ~]# iptables -Z
[root@controller ~]# iptables-save

# Generated by iptables-save v1.4.21 on Tue Apr 13 14:58:55 2021
*nat
:PREROUTING ACCEPT [1:52]
:INPUT ACCEPT [1:52]
:OUTPUT ACCEPT [1:70]
:POSTROUTING ACCEPT [1:70]
:OUTPUT_direct - [0:0]
:POSTROUTING_ZONES - [0:0]
:POSTROUTING_ZONES_SOURCE - [0:0]
:POSTROUTING_direct - [0:0]
:POST_public - [0:0]
:POST_public_allow - [0:0]
:POST_public_deny - [0:0]
:POST_public_log - [0:0]
:PREROUTING_ZONES - [0:0]
:PREROUTING_ZONES_SOURCE - [0:0]
:PREROUTING_direct - [0:0]
:PRE_public - [0:0]
:PRE_public_allow - [0:0]
:PRE_public_deny - [0:0]
:PRE_public_log - [0:0]
-A PREROUTING -j PREROUTING_direct
-A PREROUTING -j PREROUTING_ZONES_SOURCE
-A PREROUTING -j PREROUTING_ZONES
-A OUTPUT -j OUTPUT_direct
-A POSTROUTING -j POSTROUTING_direct
-A POSTROUTING -j POSTROUTING_ZONES_SOURCE
-A POSTROUTING -j POSTROUTING_ZONES
-A POSTROUTING_ZONES -o eno33554960 -g POST_public
-A POSTROUTING_ZONES -o eno16777736 -g POST_public
-A POSTROUTING_ZONES -g POST_public
-A POST_public -j POST_public_log
-A POST_public -j POST_public_deny
-A POST_public -j POST_public_allow
-A PREROUTING_ZONES -i eno33554960 -g PRE_public
-A PREROUTING_ZONES -i eno16777736 -g PRE_public
-A PREROUTING_ZONES -g PRE_public
-A PRE_public -j PRE_public_log
-A PRE_public -j PRE_public_deny
-A PRE_public -j PRE_public_allow
COMMIT
# Completed on Tue Apr 13 14:58:55 2021
# Generated by iptables-save v1.4.21 on Tue Apr 13 14:58:55 2021
*mangle
:PREROUTING ACCEPT [77:6923]
:INPUT ACCEPT [77:6923]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [55:6489]
:POSTROUTING ACCEPT [55:6489]
:FORWARD_direct - [0:0]
:INPUT_direct - [0:0]
:OUTPUT_direct - [0:0]
:POSTROUTING_direct - [0:0]
:PREROUTING_ZONES - [0:0]
:PREROUTING_ZONES_SOURCE - [0:0]
:PREROUTING_direct - [0:0]
:PRE_public - [0:0]
:PRE_public_allow - [0:0]
:PRE_public_deny - [0:0]
:PRE_public_log - [0:0]
-A PREROUTING -j PREROUTING_direct
-A PREROUTING -j PREROUTING_ZONES_SOURCE
-A PREROUTING -j PREROUTING_ZONES
-A INPUT -j INPUT_direct
-A FORWARD -j FORWARD_direct
-A OUTPUT -j OUTPUT_direct
-A POSTROUTING -j POSTROUTING_direct
-A PREROUTING_ZONES -i eno33554960 -g PRE_public
-A PREROUTING_ZONES -i eno16777736 -g PRE_public
-A PREROUTING_ZONES -g PRE_public
-A PRE_public -j PRE_public_log
-A PRE_public -j PRE_public_deny
-A PRE_public -j PRE_public_allow
COMMIT
# Completed on Tue Apr 13 14:58:55 2021
# Generated by iptables-save v1.4.21 on Tue Apr 13 14:58:55 2021
*security
:INPUT ACCEPT [77:6923]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [55:6489]
:FORWARD_direct - [0:0]
:INPUT_direct - [0:0]
:OUTPUT_direct - [0:0]
-A INPUT -j INPUT_direct
-A FORWARD -j FORWARD_direct
-A OUTPUT -j OUTPUT_direct
COMMIT
# Completed on Tue Apr 13 14:58:55 2021
# Generated by iptables-save v1.4.21 on Tue Apr 13 14:58:55 2021
*raw
:PREROUTING ACCEPT [77:6923]
:OUTPUT ACCEPT [55:6489]
:OUTPUT_direct - [0:0]
:PREROUTING_direct - [0:0]
-A PREROUTING -j PREROUTING_direct
-A OUTPUT -j OUTPUT_direct
COMMIT
# Completed on Tue Apr 13 14:58:55 2021
# Generated by iptables-save v1.4.21 on Tue Apr 13 14:58:55 2021
*filter
:INPUT ACCEPT [24:1400]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [13:1084]
COMMIT
# Completed on Tue Apr 13 14:58:55 2021



[root@controller ~]# systemctl stop firewalld
[root@controller ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@controller ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

Apr 13 14:57:09 controller systemd[1]: Starting firewalld - dynamic firewall daemon...
Apr 13 14:57:10 controller systemd[1]: Started firewalld - dynamic firewall daemon.
Apr 13 15:03:03 controller systemd[1]: Stopping firewalld - dynamic firewall daemon...
Apr 13 15:03:04 controller systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@controller ~]# 

[root@controller ~]# vi /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

[root@controller ~]# reboot

[root@controller ~]# getenforce
Permissive
[root@controller ~]# yum install -y vsftpd
[root@controller ~]# vi /etc/vsftpd/vsftpd.conf
# Make sure, that one of the listen options is commented !!
listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
anon_root=/opt   #将根目录/opt座位缺省

[root@controller ~]# mkdir /opt/centos /opt/iaas /opt/mydr
[root@controller ~]# systemctl restart vsftpd
[root@controller ~]# systemctl enable vsftpd
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.


[root@controller ~]# mount /dev/sr0 /opt/centos
mount: /dev/sr0 is write-protected, mounting read-only
[root@controller ~]# mount /dev/sr1 /opt/iaas
mount: /dev/sr1 is write-protected, mounting read-only
[root@controller ~]# vi /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue Apr 13 11:30:42 2021
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=e90c662d-bb17-4d9f-9269-9bb595312fb6 /boot                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0
/dev/sr0              /opt/centos        iso9660  defaults       0           0
/dev/sr1              /opt/iaas          iso9660  defaults       0           0

(2)过程记录
网络配置

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7cUxf7AQ-1618399623451)(picture/48.png)]

修改如下

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-hIr9yZkK-1618399623452)(picture/49.png)]

static,yes项

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-MbGb4KYs-1618399623453)(picture/50.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ELDbDfIA-1618399623454)(picture/51.png)]

检查下

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-qSNmuZAp-1618399623455)(picture/52.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-IhLp5whW-1618399623456)(picture/53.png)]

配置域名解析如下

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-zcAltl3B-1618399623457)(picture/54.png)]

ping下外网百度

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-64eZlyb7-1618399623458)(picture/55.png)]

controller

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-T3qAwm2T-1618399623460)(picture/56.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-mfsFICnA-1618399623461)(picture/57.png)]

防火墙关闭

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-z6WRRrrz-1618399623462)(picture/58.png)]

配置selinux

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-PyllgkBI-1618399623463)(picture/59.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-o6ytl5Rf-1618399623465)(picture/60.png)]

安装vsftpd

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-pp2JRVYi-1618399623466)(picture/61.png)]

过程记录

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-eSumefAY-1618399623469)(picture/62.png)]

搭建ftp服务器,开启设置自启动,添加匿名访问目录

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-xvkT2rOP-1618399623470)(picture/63.png)]

资源管理器里面查看光驱挂载,浏览器查看不了的话去我的电脑windows资源管理器下查看

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-IShF3q9o-1618399623481)(picture/64.png)]

挂载iso文件

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-dWyWrNL9-1618399623487)(picture/65.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-0lkqlzEQ-1618399623489)(picture/66.png)]

查看centos和iaas的索引

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-odWKKobP-1618399623490)(picture/67.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-uroTrETJ-1618399623491)(picture/68.png)]

2、配置compute

(1)代码部分
[root@compute ~]# ip a
[root@compute ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736 
[root@compute ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno33554960 
[root@compute ~]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.103  controller
192.168.1.104  compute
[root@compute ~]# systemctl restart network
[root@compute ~]# ip a
    
[root@compute ~]# sftp controller   
The authenticity of host 'controller (192.168.1.103)' can't be established.
ECDSA key fingerprint is 0c:85:da:39:b1:41:76:0d:c9:7a:a3:aa:18:aa:ab:da.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'controller,192.168.1.103' (ECDSA) to the list of known hosts.
root@controller's password: 
Connected to controller.
sftp> ls
anaconda-ks.cfg    repo               
sftp> cd /opt
sftp> ls
centos  iaas    mydr    
sftp> 

[root@compute ~]# vi /etc/selinux/config 


# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

[root@compute ~]# mkdir repo
[root@compute ~]# cp /etc/sysconfig/network-scripts/ifcfg-eno* repo
[root@compute ~]# ls repo
ifcfg-eno16777736  ifcfg-eno33554960
[root@compute ~]# iptables -F
[root@compute ~]# iptables -X
[root@compute ~]# iptables -Z
[root@compute ~]# iptables-save
[root@compute ~]# systemctl stop firewalld
[root@compute ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@compute ~]# 
(2)过程记录
配置网络

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JAGewdwd-1618399623492)(picture/69.png)]

60的网络

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-SOYqVS3O-1618399623493)(picture/70.png)]

配置域名解析

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-UNYR1a2p-1618399623495)(picture/71.png)]

设置主机名

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZIkRa7Xl-1618399623496)(picture/72.png)]

查看下配置好没

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-TYZRyA0L-1618399623498)(picture/73.png)]

配置selinux[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-QIadAyxw-1618399623499)(picture/74.png)]

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Tuwf1j3q-1618399623500)(picture/75.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-5FY7HoVn-1618399623501)(picture/76.png)]

防火墙设置

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lzjOx5lF-1618399623502)(picture/77.png)]

四、准备yum源

1、配置controller代码部分

[root@controller ~]# mv /etc/yum.repos.d/* repo
[root@controller ~]# ls repo
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo    CentOS-Vault.repo  ifcfg-eno16777736
CentOS-CR.repo    CentOS-fasttrack.repo  CentOS-Sources.repo  ifcfg-eno1         ifcfg-eno33554960
[root@controller ~]# ls /etc/yum.repos.d/
[root@controller ~]# 

[root@controller ~]# vi /etc/yum.repos.d/local.repo
[root@controller ~]# cat /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1

[iaas]
name=iaas
baseurl=file:///opt/iaas/iaas-repo
gpgcheck=0
enabled=1
[root@controller ~]# 

[root@controller ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: centos iaas
Cleaning up everything
Cleaning up list of fastest mirrors
[root@controller ~]# 

[root@controller ~]# yum list

[root@controller ~]# yum install -y iaas-xiandian

2、过程记录

删除yum配置文件

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-3e8EXuiR-1618399623504)(picture/78.png)]

创建repo文件,清除缓存,验证yum源

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-f1juGypy-1618399623505)(picture/79.png)]

查看下yum的list

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-IYKglXkZ-1618399623506)(picture/80.png)]

安装Xiandian

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-mWiAcXz0-1618399623507)(picture/81.png)]

五、安装先电iaas

1、controller的配置

[root@controller ~]# rm /etc/xiandian/openrc.sh 
rm: remove regular file ‘/etc/xiandian/openrc.sh’? y
[root@controller ~]# ls /etc/xiandian/
lb-server.yaml  nginx_flat.yaml  nginx.yaml
[root@controller ~]# vi /etc/xiandian/openrc.sh

[root@controller ~]# iaas-pre-host.sh

[root@controller ~]# fdisk -l

Disk /dev/sda: 64.4 GB, 64424509440 bytes, 125829120 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000850e7

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   125829119    62401536   8e  Linux LVM

Disk /dev/mapper/centos-root: 58.7 GB, 58657341440 bytes, 114565120 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-swap: 5234 MB, 5234491392 bytes, 10223616 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@controller ~]# 


##--------------------system Config--------------------##
##Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.1.103

##Controller Server hostname. example:controller
HOST_NAME=controller

##Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.1.104

##Compute Node hostname. example:compute
HOST_NAME_NODE=compute

##--------------------Rabbit Config ------------------##
##user for rabbit. example:openstack
RABBIT_USER=openstack

##Password for rabbit user .example:000000
RABBIT_PASS=000000

##--------------------MySQL Config---------------------##
##Password for MySQL root user . exmaple:000000
DB_PASS=000000

##--------------------Keystone Config------------------##
##Password for Keystore admin user. exmaple:000000
DOMAIN_NAME=demo
ADMIN_PASS=000000
DEMO_PASS=000000

##Password for Mysql keystore user. exmaple:000000
KEYSTONE_DBPASS=000000

##--------------------Glance Config--------------------##
##Password for Mysql glance user. exmaple:000000
GLANCE_DBPASS=000000

##Password for Keystore glance user. exmaple:000000
GLANCE_PASS=000000

##--------------------Nova Config----------------------##
##Password for Mysql nova user. exmaple:000000
NOVA_DBPASS=000000

##Password for Keystore nova user. exmaple:000000
NOVA_PASS=000000

##--------------------Neturon Config-------------------##
##Password for Mysql neutron user. exmaple:000000
NEUTRON_DBPASS=000000

##Password for Keystore neutron user. exmaple:000000
NEUTRON_PASS=000000

##metadata secret for neutron. exmaple:000000
METADATA_SECRET=000000

##External Network Interface. example:eth1
INTERFACE_NAME=eno33554960

##First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
#minvlan=

##Last Vlan ID in VLAN RANGE for VLAN Network. example:200
#maxvlan=

##--------------------Cinder Config--------------------##
##Password for Mysql cinder user. exmaple:000000
CINDER_DBPASS=000000

##Password for Keystore cinder user. exmaple:000000
CINDER_PASS=000000

##Cinder Block Disk. example:md126p3
BLOCK_DISK=sda1

##--------------------Trove Config--------------------##
##Password for Mysql Trove User. exmaple:000000
TROVE_DBPASS=000000

##Password for Keystore Trove User. exmaple:000000
TROVE_PASS=000000

##--------------------Swift Config---------------------##
##Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000

##The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=sda2

##The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=192.168.1.104

##--------------------Heat Config----------------------##
##Password for Mysql heat user. exmaple:000000
HEAT_DBPASS=000000

##Password for Keystore heat user. exmaple:000000
HEAT_PASS=000000

##--------------------Ceilometer Config----------------##
##Password for Mysql ceilometer user. exmaple:000000
CEILOMETER_DBPASS=000000

##Password for Keystore ceilometer user. exmaple:000000
CEILOMETER_PASS=000000

##--------------------AODH Config----------------##
##Password for Mysql AODH user. exmaple:000000
AODH_DBPASS=000000

##Password for Keystore AODH user. exmaple:000000
AODH_PASS=000000
[root@controller ~]# iaas-install-mysql.sh
    
[root@controller ~]# iaas-install-keystone.sh

[root@controller ~]# iaas-install-glance.sh

[root@controller ~]# iaas-install-nova-controller.sh
    
[root@controller ~]# iaas-install-neutron-controller.sh
    
[root@controller ~]# iaas-install-neutron-controller-gre.sh


2、controller过程记录

编辑环境变量

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-bFvmg7bf-1618399623508)(picture/82.png)]

根据实际情况配置!!!!,内外网注意下,还有空白分区名也是根据自己的实际分区情况

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-DSMGqIpP-1618399623510)(picture/83.png)]

iaas-pre-host.sh

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JRGL4mdG-1618399623511)(picture/84.png)]

iaas-install-mysql.sh

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-F2dIudou-1618399623512)(picture/85.png)]

iaas-install-keystone.sh

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-a6wRfFgc-1618399623513)(picture/86.png)]

iaas-install-glance.sh

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-mP18dA5p-1618399623514)(picture/87.png)]

iaas-install-nova-controller.sh

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-fYWFbU53-1618399623515)(picture/88.png)]

iaas-install-neutron-controller.sh

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7daLX4s2-1618399623516)(picture/89.png)]

iaas-install-neutron-controller-gre.sh

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8bIDfjeb-1618399623517)(picture/90.png)]

3、compute的配置
[root@compute ~]# mv /etc/yum.repos.d/* repo
[root@compute ~]# ls repo
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo    CentOS-Vault.repo  ifcfg-eno33554960
CentOS-CR.repo    CentOS-fasttrack.repo  CentOS-Sources.repo  ifcfg-eno16777736
[root@compute ~]# ls /etc/yum.repos.d/
[root@compute ~]# 
[root@compute ~]# vi /etc/yum.repos.d/local.repo
[root@compute ~]# cat /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=ftp://controller/centos
gpgcheck=0
enabled=1

[iaas]
name=iaas
baseurl=ftp://controller/iaas/iaas-repo
gpgcheck=0
enabled=1
[root@compute ~]# 
[centos]
name=centos
baseurl=ftp://controller/centos
gpgcheck=0
enabled=1

[iaas]
name=iaas
baseurl=ftp://controller/iaas/iaas-repo
gpgcheck=0
enabled=1                    
[root@compute ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: centos iaas
Cleaning up everything
[root@compute ~]# yum list

[root@compute ~]# yum install -y iaas-xiandian

分区
[root@compute ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xd0c0dec9.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-104857599, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599): 
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set

[root@compute ~]# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xad5d3294.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-104857599, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599): 
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set

[root@compute ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   50G  0 disk 
├─sda1            8:1    0  500M  0 part /boot
└─sda2            8:2    0 49.5G  0 part 
  ├─centos-root 253:0    0 44.6G  0 lvm  /
  └─centos-swap 253:1    0  4.9G  0 lvm  [SWAP]
sdb               8:16   0   50G  0 disk 
sdc               8:32   0   50G  0 disk 
sr0              11:0    1    4G  0 rom  
sr1              11:1    1  2.7G  0 rom  
[root@compute ~]# 
各项参数配置
[root@compute ~]# rm /etc/xiandian/openrc.sh 
rm: remove regular file ‘/etc/xiandian/openrc.sh’? y
[root@compute ~]# ls /etc/xiandian/
lb-server.yaml  nginx_flat.yaml  nginx.yaml
[root@compute ~]# vi /etc/xiandian/openrc.sh
##--------------------system Config--------------------##
##Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.1.103

##Controller Server hostname. example:controller
HOST_NAME=controller

##Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.1.104

##Compute Node hostname. example:compute
HOST_NAME_NODE=compute

##--------------------Rabbit Config ------------------##
##user for rabbit. example:openstack
RABBIT_USER=openstack

##Password for rabbit user .example:000000
RABBIT_PASS=000000

##--------------------MySQL Config---------------------##
##Password for MySQL root user . exmaple:000000
DB_PASS=000000

##--------------------Keystone Config------------------##
##Password for Keystore admin user. exmaple:000000
DOMAIN_NAME=demo
ADMIN_PASS=000000
DEMO_PASS=000000

##Password for Mysql keystore user. exmaple:000000
KEYSTONE_DBPASS=000000

##--------------------Glance Config--------------------##
##Password for Mysql glance user. exmaple:000000
GLANCE_DBPASS=000000

##Password for Keystore glance user. exmaple:000000
GLANCE_PASS=000000

##--------------------Nova Config----------------------##
##Password for Mysql nova user. exmaple:000000
NOVA_DBPASS=000000

##Password for Keystore nova user. exmaple:000000
NOVA_PASS=000000

##--------------------Neturon Config-------------------##
##Password for Mysql neutron user. exmaple:000000
NEUTRON_DBPASS=000000

##Password for Keystore neutron user. exmaple:000000
NEUTRON_PASS=000000

##metadata secret for neutron. exmaple:000000
METADATA_SECRET=000000

##External Network Interface. example:eth1
INTERFACE_NAME=eno33554960

##First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
#minvlan=

##Last Vlan ID in VLAN RANGE for VLAN Network. example:200
#maxvlan=

##--------------------Cinder Config--------------------##
##Password for Mysql cinder user. exmaple:000000
CINDER_DBPASS=000000

##Password for Keystore cinder user. exmaple:000000
CINDER_PASS=000000

##Cinder Block Disk. example:md126p3
BLOCK_DISK=sdb   ##我的空分区sdb

##--------------------Trove Config--------------------##
##Password for Mysql Trove User. exmaple:000000
TROVE_DBPASS=000000

##Password for Keystore Trove User. exmaple:000000
TROVE_PASS=000000

##--------------------Swift Config---------------------##
##Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000

##The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=sdc  ##我的空分区sdc

##The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=192.168.1.104

##--------------------Heat Config----------------------##
##Password for Mysql heat user. exmaple:000000
HEAT_DBPASS=000000

##Password for Keystore heat user. exmaple:000000
HEAT_PASS=000000

##--------------------Ceilometer Config----------------##
##Password for Mysql ceilometer user. exmaple:000000
CEILOMETER_DBPASS=000000

##Password for Keystore ceilometer user. exmaple:000000
CEILOMETER_PASS=000000

##--------------------AODH Config----------------##
##Password for Mysql AODH user. exmaple:000000
AODH_DBPASS=000000

##Password for Keystore AODH user. exmaple:000000
AODH_PASS=000000

[root@compute ~]# iaas-pre-host.sh
[root@compute ~]# iaas-install-nova-compute.sh
[root@compute ~]# iaas-install-neutron-compute.sh
[root@compute ~]# iaas-install-neutron-compute-gre.sh
[root@compute ~]# 
4、compute过程记录
删除yum源配置文件,创建repo文件

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-N1iShIun-1618399623519)(picture/91.png)]

清除缓存,验证yum源

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-iLAzbgFI-1618399623520)(picture/92.png)]

安装xiandian

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-PKXaF5L1-1618399623521)(picture/93.png)]

分区

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-S2ASTZed-1618399623522)(picture/94.png)]

创建分区

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-NI519VTq-1618399623523)(picture/95.png)]

显示分区情况

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-6AQxMVjo-1618399623524)(picture/96.png)]

各项参数

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-57GiXHeK-1618399623525)(picture/97.png)]

iaas-pre-host.sh

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-IYTZ6REc-1618399623527)(picture/98.png)]

iaas-install-nova-compute.sh

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-bE7dv7nq-1618399623527)(picture/99.png)]

iaas-install-neutron-compute.sh

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-kN8vlPFk-1618399623529)(picture/100.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nm1hCE3J-1618399623530)(picture/101.png)]

六、问题处理

1、报错systemctl

vim /etc/vsftpd/vsftpd.conf #修改配置文件
[root@controller ~]# rpm -aq vsftpd  
vsftpd-3.0.2-28.el7.x86_64
[root@controller ~]# rpm -e vsftpd-3.0.2-28.el7.x86_64
warning: /etc/vsftpd/vsftpd.conf saved as /etc/vsftpd/vsftpd.conf.rpmsave
[root@controller ~]# /bin/systemctl stop  vsftpd.service
[root@controller ~]# rpm -aq vsftpd  

2、访问不了

[root@controller ~]#  iaas-install-dashboard.sh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package 1:openstack-dashboard-9.0.1-1.el7.centos.noarch already installed and latest version
Nothing to do
[root@controller ~]# 

七、验证

1、登录(注:域demo, 用户名admin , 密码000000)

http://192.168.1.103/dashboard/auth/login/

检查防火墙规则,确保允许http服务相关端口通行,或者关闭防火墙。

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-HdNqjdSN-1618399623531)(picture/102.png)]

(img-57GiXHeK-1618399623525)]

欢迎交流~~~~~

;