Cloud computing infrastructure platform construction and application based on centos6.5
(2) Environmental preparations for building Xiandian IaaS cloud platform
Simulation software SecureCRT resource download The
training involves the node
controller compute
training target
- Complete the modification of the hosts file;
- Complete the modification of selinux;
- Complete the configuration of yum source;
- Complete the installation of the NTP service;
- Complete the installation of Qpid service;
- Complete the installation of the OpenStack environment preparation package
1. Modify the hosts file (controller and compute)
[root@controller ~] # vi /etc/hosts
[root@compute ~] # vi /etc/hosts
The configuration is shown in the figure:
Purpose: host name resolution corresponding IP address
2. Modify selinux configuration file (controller and compute)
[root@controller ~] # vi /etc/selinux/config
[root@compute ~] # vi /etc/selinux/config
As shown in the figure: before
modification,
remember after modification : after modification, you have to restart to take effect
setenforce 0 temporarily take effect
getenforce View selinux rules
3.1 Configure yum source (controller) to
change CentOS-6.5-x86_64-bin-DVD1 in the software package in this training. The two image files iso and XianDian-iaas-v1.2.iso are uploaded to the opt directory of the controller node, and multiple terminal software can be selected to complete the operation of this step.
As shown in the figure:
After uploading, you can confirm:
[root@controller ~] # ll /opt/
Next, create centos and iaas directories in the opt directory, the command is as follows:
[root@controller ~] # mkdir /opt/centos /opt/iaas
This creates a directory according to your own habits. There are many ways to create a directory.
You can confirm:
[root@controller ~] # ll /opt/
Now you can mount the two image files.
[root@controller ~] # mount -o loop /opt/CentOS-6.5-x86_64-bin-DVD1.iso /opt/centos/
[root@controller ~] # mount -o loop /opt/ XianDian-iaas-v1.2.iso /opt/iaas/
Note: This mounting method will be cancelled after restarting.
Check whether the mount is successful through the command.
[root@controller ~] # ll /opt/centos
[root@controller ~] # ll /opt/iaas
Detailed explanation: The Packages directory in the figure is the CentOS system software package storage directory, and the repodata directory stores the yum index file. The baseurl specified directory in the yum source configuration file should be the parent directory of the index directory. iaas are similar.
In order to create a local yum source, so that all the software packages used by the controller node will be installed locally, you need to delete the original yum source configuration file or move to another directory. The delete command is as follows:
[root@controller ~] # rm -rfv /etc/yum.repos.d/*
To create a local yum source, the command is as follows:
[root@controller ~] # vi /etc/yum.repos.d/local.repo
Note: There must be a .repo suffix
. Write the following in 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
Yum source to confirm whether the configuration is successful, the command:
yum yum repolist List or
Next
install the vsftpd service. Purpose: to enable the compute node to access the controller node and build the yum source through ftp to install the software package.
[root@controller ~] # yum -y install vsftpd
Modify the configuration file
[root@controller ~] # vi /etc/vsftpd/vsftpd.conf
Add anon_root=/opt
:x save and exit
Start the vsftpd service, and set the boot to start automatically
[root@controller ~] # service vsftpd start
[root@controller ~] # chkconfig vsftpd on
In order to ensure that the compute and controller node cloud platform components can communicate normally through the IP network, and the compute cloud platform components can be installed via ftp, you need to turn off the firewalls of the above two nodes. The command is as follows:
[root@controller ~] # service iptables stop
[root@compute ~] # service iptables stop
Set the boot does not start automatically
[root@controller ~] # chkconfig iptables off
[root@compute ~] # chkconfig iptables off
3.2 Configure yum source (compute) to
delete the original yum source configuration file, the command is as follows:
[root@compute ~] # rm -rf /etc/yum.repos.d/*
Create ftp remote yum source, its path points to the ftp built under the controller node, the command is as follows:
[root@compute ~] # vi /etc/yum.repos.d/local.repo
Note: There must be a .repo suffix
. Write the following in local.repo:
[centos]
name=centos
baseurl=ftp://controller/opt/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=ftp://controller/opt/iaas/iaas-repo
gpgcheck=0
enabled=1
The above IP address can also be changed to controller. The host name is resolved due to the IP address.
:x Save and exit
Confirm whether the yum source is successfully configured, command:
yum list or yum repolist
4. Configure the NTP clock synchronization service. (Controller and compute)
Purpose: Two nodes need to be accessed by external hosts at the same time.
[root@controller ~] # yum -y install ntp
[root@compute ~] # yum -y install ntp
Using the controller as the server, modify the ntp.conf configuration file under the controller node, the command is as follows:
[root@controller ~] # vi /etc/ntp.conf
Comment out with #. Add again
server 127.127.1.0
fudge 127.127.1.0 stratum 10
:x save and exit
Start the NTP service on the controller node and set it to start automatically
[root@controller ~] # service ntpd start
[root@controller ~] # chkconfig ntpd on
On the compute node, use the ntpdate command to synchronize the clock of the controller node (make sure the firewall of the controller node is closed) and the command is as follows:
[root@compute ~] # ntpdate controller
Then set the NTP service of the compute node to start automatically after booting
[root@compute ~] # chkconfig ntpd on
5. Install Qpid service (controller and compute)
[root@controller ~] # yum -y install qpid-cpp-server
[root@compute ~] # yum -y install qpid-cpp-server
[root@controller ~] # vi /etc/qpidd.conf
[root@compute ~] # vi /etc/qpidd.conf
Modify the last line of the configuration file auth=yes to auth=no,
modify, save, and exit.
Start the Qpid service and set the startup to auto-start. The command is as follows:
[root@controller ~] # service qpidd start
[root@controller ~] # chkconfig qpidd on
[root@compute ~] # service qpidd start
[root@compute ~] # chkconfig qpidd on
6. Installation of the OpenStack environment preparation package (controller and compute)
[root@controller ~] # yum -y install yum-plugin-priorities openstack-utils openstack-selinux
[root@compute ~] # yum -y install yum-plugin-priorities openstack-utils openstack-selinux
Perhaps due to the different versions of CentOS6.5, some related RPM packages are not in the centos mirror. At this time, which package is missing, download the RPM package from the relevant website ( https://centos.pkgs.org ) and unzip it. Unzip the RPM package command: rpm -ivh <package.rpm>
After updating the system on both nodes, the command is as follows:
[root@controller ~] # yum -y upgrade
[root@compute ~] # yum -y upgrade
The above basic environment configuration is completed.