先电云计算IAAS

先电云计算IAAS

系统配置

controller&compute#

vi /etc/sysconfig/network-scripts/ifcfg-eng

网卡1(内网):

BOOTPROTO=static

IPADDR=192.168.100.10 //B:192.168.100.20

PREFIX=24 //NETMASK=255.255.255.0

GATEWAY=192.168.100.1

网卡2(外网):

BOOTPROTO=static

IPADDR=192.168.200.20 //B:192.168.200.20

PREFIX=24 //NETMASK=255.255.255.0

service network restart


controller#

hostnamectl set-hostname controller


compute#

hostnamectl set-hostname compute


controller&compute#

logout //Ctr+d 重新登录


controller#

mv /etc/yum.repo.d/* /home

vi /etc/yum.repos.d/iaas.repo

[centos]

name=centos

baseurl=file:///opt/centos

enabled=1

gpgcheck=0

[iaas]

name=iaas

baseurl=file:///opt/iaas/iaas-repo

enabled=1

gpgcheck=0

mkdir /opt/{centos,iaas}

mount CentOS-7-x86_64-DVD-1511.iso /mnt

cp -rfv /mnt/* /opt/centos

umout XianDian-IaaS-v2.2.iso /mnt

cp -rfv /mnt/* /opt/iaas

yum clean all

yum list

yum -y install vsftpd

systemctl stop firewalld

systemctl disable firewalld

vi /etc/selinux/config

SELINUX=enforcing => SELINUX=permissive

setenforce 0

vi /vsftpd/vsftpd.conf

anon_root=/opt

systemctl enable vsftpd

systemctl start vsftpd


compute#

mv /etc/yum.repos.d/* /home

vi /etc/yum.repos.d/iaas.repo

[centos]

name=centos

baseurl=ftp://192.168.100.10/opt/centos

enabled=1

gpgcheck=0

[iaas]

name=iaas

baseurl=ftp://192.168.100.10/opt/iaas/iaas-repo

enabled=1

gpgcheck=0

yum clean all

yum list

//创建两个分区做准备,记下分区号

parted /dev/md126 //进入磁盘管理,IDE硬盘为hdx(x为从a—d)因为IDE硬盘最多四个,SCSI,SATA,USB硬盘为sdx(x为a—z),做了磁盘阵列的是md

(parted)p

(parted)mkpart 名字 分区起点 分区终点 //上一个的分区的终点为下一个分区的终点,由起终点决定大小*

(parted)p

(parted)quit

mkfs.xfs /dev/md126p4 //格式化分区,注意区号

mkfs.xfs /dev/md126p5


通过脚本安装相关服务

controller&compute#

yum -y install iaas-xiandian //安装xiandian包并配置环境变量

vi /etc/xiandain/openrc.sh

HOST_IP=192.168.100.10 //控制节点内网

HOST_NAME=controller

HOST_IP_NODE=192.168.100.20 //计算节点内网

HOST_NAME_NODE=compute

RABBIT_USER=openstack

RABBIT_PASS=000000

DB_PASS=000000

DOMAIN_NAME=demo //(自定义)

ADMIN_PASS=000000

DEMO_PASS=000000

KEYSTONE_DBPASS=000000

GLANCE_DBPASS=000000

GLANCE_PASS=000000

NOVA_DBPASS=000000

NOVA_PASS=000000

NEUTRON_DBPASS=000000

NEUTRON_PASS=000000

METADATA_SECRET=000000

INTERFACE_NAME=enp9s0 //(外网网卡名)

CINDER_DBPASS=000000

CINDER_PASS=000000

TROVE_DBPASS=000000

TROVE_PASS=000000

BLOCK_DISK=md126p4 //(空白分区名)在计算节点上创建

SWIFT_PASS=000000

OBJECT_DISK=md126p5 //(空白分区名)在计算节点上创建

STORAGE_LOCAL_NET_IP=192.168.100.20 //计算节点内网

HEAT_DBPASS=000000

HEAT_PASS=000000

CEILOMETER_DBPASS=000000

CEILOMETER_PASS=000000

AODH_DBPASS=000000

AODH_PASS=000000

//过滤语句:cat /etc/xiandian/openrc.sh |grep -v ^# |grep -v ^$ //history 查看历史命令

iaas-pre-host.sh //基础配置

yum -y install openstack-utils openstack-selinux python-openstackclient

yum upgrade

yum -y remove NetworkManager firewalld

yum -y install iptables

yum -y install ntp

yum -y install openstack-utils //脚本内可能未安装,自己补上


controller#

iaas-install-mysql.sh //安装数据库相关服务

yum -y install mysql mysql-server MySQL-python

yum -y install mongodb-server mongodb

yum -y install rabbitmq-server

yum -y install memcached python-memcached


compute#

yum -y install MySQL-python


controller#

iaas-install-keystone.sh //安装Keystone认证服务

yum -y install openstack-keystone httpd mod_wsgi

iaas-install-glance.sh //安装Glance镜像服务

yum -y install openstack-glance

上传镜像:
source /etc/keystone/admin-opemrc.sh //加载上传镜像需要用到的变量

glance image-create --name "CentOS7.0" --disk-format qcow2 --container-format bare --progress < /opt/iaas/images/Centos_7-x86_64_XD.qcow2

iaas-install-nova-controller.sh //安装nova计算服务

yum install -y openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler


compute#

iaas-install-nova-compute.sh

yum -y install lvm2

yum -y install openstack-nova-compute


controller#

iaas-install-neutron-controller.sh //安装Neutron网络服务

yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables openstack-neutron-openvswitch openstack-neutron-lbaas python-neutron-lbaas haproxy openstack-neutron-fwaas


compute#

iaas-install-neutron-compute.sh

yum install -y openstack-neutron-linuxbridge ebtables ipset openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch


controller#

iaas-install-neutron-controller-gre.sh //创建gre网络


compute#

iaas-install-neutron-compute-gre.sh


controller#

iaas-install-dashboard.sh //安装Dadhboard仪表盘服务

yum -y install openstack-dashboard

http://192.168.100.10/dashboard


controller#

iaas-install-cinder-controller.sh //安装Cinder块存储服务

yum install -y openstack-cinder

cinder create --display-name myVolume 1 //使用cinder create 创建一个新的卷

cinder list //通过cinder list 命令查看是否正确创建


compute#

iaas-install-cinder-compute.sh

yum -y install lvm2 targetcli python-keystone openstack-cinder


controller#

iaas-install-swift-controller.sh //安装Swift对象存储服务

yum install -y openstack-swift-proxy python-swiftclient python-keystoneclient python-keystonemiddleware memcached


compute#

iaas-install-swift-compute.sh //面向对象数据存贮

yum install -y xfsprogs rsync openstack-swift-account openstack-swift-container openstack-swift-object

执行过程中需要确认登录controller节点和输入controller节点root用户密码


controller#

iaas-install-trove.sh //安装Trove数据库服务

//需注意安装Trove服务之前需要配置好网络(flat或gre),创建好子网,并确认系统已经安装swift和cinder两个服务,否则安装会失败

yum install –y openstack-trove-guestagent openstack-trove python-troveclient openstack-trove-ui

iaas-install-heat.sh //安装heat集群服务

yum install -y openstack-heat-api openstack-heat-api-cfn openstack-heat-engine

iaas-install-ceilometer-controller.sh //安装Ceilometer架空服务

yum install -y openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-notification openstack-ceilometer-central python-ceilometerclient python-ceilometermiddleware


compute#

iaas-install-ceilometer-compute.sh

yum install -y openstack-ceilometer-compute python-ceilometerclient python-pecan


controller#

iaas-install-alarm.sh //安装alarm监控服务

yum install -y openstack-aodh-api openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener openstack-aodh-expirer python-ceilometerclient


资源聚合

/etc/xiandian/openrc.sh里把compute节点的IP和主机名改为controller节点的IP和主机名

在控制节点运行 iaas-install-nova-compute.sh

controller#

iaas-install-nova-compute.sh