赞
踩
vi /etc/sysconfig/network-scripts/ifcfg-ens33 (进入网卡ens33配置文件)
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.100.10 (ip地址)
PREFIX=24 (子网掩码)
GATEWAY=192.168.100.1 (网关)
配置完成后,重启network服务
systemctl restart network
重启过后输入ip a 查看网卡配置信息
vi /etc/sysconfig/network-scripts/ifcfg-ens33 (进入网卡ens33配置文件)
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.100.20 (ip地址)
PREFIX=24 (子网掩码)
GATEWAY=192.168.100.1 (网关)
配置完成后,重启network服务
systemctl restart network
重启过后输入 ip a 命令查看网卡配置信息
配置好IP地址后,将controller节点下,/etc/hosts 中添加 两个节点的host 如下图
之后通过scp命令将该文件传到compute节点上
scp /etc/hosts root@192.168.100.20:/etc/hosts
之后进入root下,隐藏目录.ssh 下如有know_host文件请删除,如果没有 输入
ssh-keygen
创建公钥,如下图(期间回车按默认创建)
之后选择使用ssh-copy-id 192.168.100.20命令将改公钥添加给compute节点。
之后进入compute节点重复以上操作。
首先将/etc下的/yum.repos.d的所有文件先备份到/opt下 或者其他目录下,之后在/yum.repos.d 下创建 centos.repo 文件 进行编辑
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=file:///opt/iaas-repo
gpgcheck=0
enabled=1
[centos]
name=centos
baseurl=ftp://192.168.100.10/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=ftp://192.168.100.10/iaas-repo
gpgcheck=0
enabled=1
首先通过 CRT 将 centos 和iaas 镜像传到controller虚拟机中
传输过后,进入/root目录下,进行镜像挂载
mount -o loop chinaskills_cloud_iaas_v2.0.3.iso /mnt (挂载iaas镜像)
cp -rvf /mnt/* /opt/ (复制到opt目录下)
umount (解除挂载)
mount -o loop CentOS-7-x86_64-DVD-2009.iso /mnt (挂载Centos镜像)
mkdir /opt/centos (在opt目录下创建centos目录)
cp -rvf /mnt/* /opt/centos/ (复制到opt/centos/目录下)
umount (解除挂载)
配置过后使用 yum clean all 清理yum源缓存 和 yum list 加载yum源
关闭防火墙并设置开机不自启
systemctl stop firewalld(关闭防火墙)
systemctl disable firewalld(设置开机不自启)
yum remove -y NetworkManager firewalld (卸载 NetworkManager firewalld 服务)
yum -y install iptables-services (安装iptables服务)
systemctl start iptables (启动iptables服务)
systemctl enable iptables (设置开机自启动)
iptables -Z
iptables -X
iptables -F
service iptables save (检测iptables服务是否正常运行)
设置严格访问模式
setenforce 0 (临时修改)
以下为永久修改 vi /etc/selinux/config 将SELINUX=enforcing改为SELINUX=disabled(或permissive)
computer同样需要操作该步骤
在controller中下载vsftpd服务使comput能够连接到controller中的镜像源
yum -y install vsftpd
systemctl start vsftpd (启动vsftpd服务)
systemctl enable vsftpd (设置开机自启)
vi /etc/vsftpd/vsftpd.conf
在配置文件中添加
anon_root=/opt/ 保存即可 (添加过后需要重新启动vsftpd服务)
(若出现进入comput使用yum命令报错 可进入contorller中重新启动vsftpd)
首先使用yum命令安装openstack基础服务(compute、controller)
yun -y install openstack-iaas
然后进入openstack配置文件,进行安装配置
vi /etc/openstack/openrc.sh
进入之后使用ctrl+v进入视块模式,然后shift+g 到最底行,最后点击x键删除首行字母
接着输入: 进入命令模式,输入以下命令进行字符替换
:% s/PASS=/PASS=000000/g
[root@controller ~]# vi /etc/openstack/openrc.sh
#--------------------system Config--------------------##
#Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.100.10
#Controller HOST Password. example:000000
HOST_PASS=000000
#Controller Server hostname. example:controller
HOST_NAME=controller
#Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.100.20
#Compute HOST Password. example:000000
HOST_PASS_NODE=000000
#Compute Node hostname. example:compute
HOST_NAME_NODE=compute
#--------------------Chrony Config-------------------##
#Controller network segment IP. example:x.x.0.0/16(x.x.x.0/24)
network_segment_IP=192.168.100.0/24
#--------------------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
#--------------------Placement Config----------------------##
#Password for Mysql placement user. exmaple:000000
PLACEMENT_DBPASS=000000
#Password for Keystore placement user. exmaple:000000
PLACEMENT_PASS=000000
#--------------------Nova Config----------------------##
#Password for Mysql nova user. exmaple:000000
NOVA_DBPASS=000000
#Password for Keystore nova user. exmaple:000000
NOVA_PASS=000000
#--------------------Neutron 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=ens34
#External Network The Physical Adapter. example:provider
Physical_NAME=provider
#First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
minvlan=1
#Last Vlan ID in VLAN RANGE for VLAN Network. example:200
maxvlan=1000
#--------------------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=sdb1
#--------------------Swift Config---------------------##
#Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000
#The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=sdb2
#The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=192.168.100.20
#--------------------Trove Config----------------------##
#Password for Mysql trove user. exmaple:000000
TROVE_DBPASS=000000
#Password for Keystore trove user. exmaple:000000
TROVE_PASS=000000
#--------------------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 Gnocchi 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
#--------------------ZUN Config----------------##
#Password for Mysql ZUN user. exmaple:000000
ZUN_DBPASS=000000
#Password for Keystore ZUN user. exmaple:000000
ZUN_PASS=000000
#Password for Keystore KURYR user. exmaple:000000
KURYR_PASS=000000
#--------------------OCTAVIA Config----------------##
#Password for Mysql OCTAVIA user. exmaple:000000
OCTAVIA_DBPASS=000000
#Password for Keystore OCTAVIA user. exmaple:000000
OCTAVIA_PASS=000000
#--------------------Manila Config----------------##
#Password for Mysql Manila user. exmaple:000000
MANILA_DBPASS=000000
#Password for Keystore Manila user. exmaple:000000
MANILA_PASS=000000
#The NODE Object Disk for Manila. example:md126p5.
SHARE_DISK=sdb3
#--------------------Cloudkitty Config----------------##
#Password for Mysql Cloudkitty user. exmaple:000000
CLOUDKITTY_DBPASS=000000
#Password for Keystore Cloudkitty user. exmaple:000000
CLOUDKITTY_PASS=000000
#--------------------Barbican Config----------------##
#Password for Mysql Barbican user. exmaple:000000
BARBICAN_DBPASS=000000
#Password for Keystore Barbican user. exmaple:000000
BARBICAN_PASS=000000
配置过后保存退出,使用scp命令将该配置文件传输到compute上
scp /etc/openstack/openrc.sh root@compute:/etc/openstack/openrc.sh
传输过后检查配置文件是否有问题无问题就可以安装openstack所需的服务了
controller
iaas-pre-host.sh (初始化服务)
compute
iaas-pre-host.sh (初始化服务)
初始化之后根据要求重启两台服务器(使用reboot命令)
controller
iaas-install-mysql.sh (安装mysql数据库服务)
iaas-install-keystone.sh (安装keystone服务)
iaas-install-glance.sh (安装glance服务)
iaas-install-placement.sh (安装placement服务)
安装nove服务(controller、compute)
controller
iaas-install-nova-controller.sh
compute
iaas-install-nova-compute.sh
安装neutron服务 (controller、compute)
controller
iaas-install-neutron-controller.sh
compute
iaas-install-neutron-compute.sh
最后安装dashboard服务
iaas-install-dashboard.sh (controller)
根据提示进入网址 输入账户密码测试是否安装成功
placement服务)
安装nove服务(controller、compute)
controller
iaas-install-nova-controller.sh
compute
iaas-install-nova-compute.sh
安装neutron服务 (controller、compute)
controller
iaas-install-neutron-controller.sh
compute
iaas-install-neutron-compute.sh
最后安装dashboard服务
iaas-install-dashboard.sh (controller)
根据提示进入网址 输入账户密码测试是否安装成功
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。