Performing Basic Configuration
Configuring DNS Settings
Perform the following operations on all nodes.
- Modify the /etc/hosts file.
- Open the hosts file.
1vim /etc/hosts - Press i in the blank area and add the following content:
1 2 3
<NIC IP address of the Management node > controller <NIC IP address of the compute node> compute <NIC IP address of the object storage node> object1
- Press Esc to exit the insert mode and input :wq to save the settings and exit.
The following figure shows an example of the hosts file after modification. Modify the hosts files of all nodes.

- Open the hosts file.
- Run the following command to change the node name to controller (change the names of other nodes to the corresponding names):
1hostnamectl set-hostname controller
Run the hostname command to check whether the hostnames are correct. Example:

After this command is successfully executed, the node name is changed. However, the new node name takes effect only after a new session is established.
Configuring NTP Settings
Perform the following operations on the controller node.
- Install chrony.
1yum -y install chrony
- Set a unified time zone for all nodes, for example, set the time zone to Asia.
1timedatectl set-timezone Asia/Shanghai
- Configure the controller node as the internal NTP server.
Add allow 172.168.201.0/24 to the /etc/chrony.conf file.
1vim /etc/chrony.conf1 2
allow 172.168.201.0/24 local stratum 10

- Enable the chrony service and configure it to start as the system boots.
1 2
systemctl enable chronyd.service systemctl start chronyd.service
- Enable NTP time synchronization.
1timedatectl set-ntp yes
Perform the following operations on compute nodes and storage nodes.
- Install chrony.
1yum -y install chrony
- Open the /etc/chrony.conf file, add server controller iburst, and delete or comment out other server options.
1 2
vim /etc/chrony.conf server controller iburst

- Enable the chrony service and configure it to start as the system boots.
1 2
systemctl enable chronyd.service systemctl restart chronyd.service
- Verify time synchronization.
1chronyc sources
Installing the OpenStack Client
Perform the following operation on all nodes.
Install the OpenStack client.
1
|
yum -y install python2-openstackclient |
Installing and Configuring the Database
Perform the following operations on the controller node.
- Install the database.
1yum -y install mariadb mariadb-server python2-PyMySQL

- Configure the database.
- Create and edit the /etc/my.cnf.d/openstack.cnf file.
1vim /etc/my.cnf.d/openstack.cnf - Add the following to the file:
1 2 3 4 5 6 7
[mysqld] bind-address = 172.168.201.11 default-storage-engine = innodb innodb_file_per_table = on max_connections = 4096 collation-server = utf8_general_ci character-set-server = utf8
bind-address indicates the management IP address of the controller node.
- Create and edit the /etc/my.cnf.d/openstack.cnf file.
- Enable the database service and configure it to start as the system boots.
1 2
systemctl enable mariadb.service systemctl start mariadb.service
- Configure the database.
1mysql_secure_installation
The default password of the root user for MariaDB is empty. During the initial installation of MariaDB, press Enter when you are prompted to enter the password. Then, you can set a password, for example 123456, for the root user. Perform other operations as shown in the following figure:

- Add the following to the [Service] section in the /usr/lib/systemd/system/mariadb.service file:
1 2
LimitNOFILE=65535 LimitNPROC=65535

- Add the following to the /etc/security/limits.conf file:
1 2
* soft nofile 65536 * hard nofile 65536

- Add the following to the /etc/pam.d/login file:
1session required /lib64/security/pam_limits.so

- Add the following to the /etc/sysctl.conf file:
1fs.file-max = 65536

Run the following command:
1sysctl -p
- Restart the database service.
1 2
systemctl daemon-reload systemctl restart mariadb.service
- Check whether the modification takes effect.
- Connect to the MySQL database.
1mysql -u root -p
Enter the database password.

- Query the maximum number of MySQL connections.
1show variables like 'max_connections';

- Query the number of current connections of the server.
1show global status like 'Max_used_connections';

- Run exit to exit the database.
- Connect to the MySQL database.
Installing Message Queue
Perform the following operations on the controller node.
- Install rabbitmq-server.
1yum -y install rabbitmq-server

- Enable and start the rabbitmq-server service.
1 2
systemctl enable rabbitmq-server.service systemctl start rabbitmq-server.service

- Add and configure the openstack user.
1 2
rabbitmqctl add_user openstack <PASSWORD> rabbitmqctl set_permissions openstack ".*" ".*" ".*"

PASSWORD indicates the password set by the RabbitMQ service for the openstack user. The password cannot contain a number sign (#).
- Start the rabbitmq-manager plugin.
1rabbitmq-plugins enable rabbitmq_management
After the plugin is started, you can access the RabbitMQ service using a browser. Enter http://<controller_IP>:15672 in the address box and enter guest as the user name and password.
- In the /usr/lib/systemd/system/rabbitmq-server.service file, add the following parameters to the [Service] section to modify RabbitMQ parameters:
1 2
[Service] LimitNOFILE=16384
- Restart the message queue service.
1 2
systemctl daemon-reload systemctl restart rabbitmq-server
Installing Memcached
Perform the following operations on the controller node.
- Install Memcached.
1yum -y install memcached python-memcached
- Open the /etc/sysconfig/memcached file.
1vim /etc/sysconfig/memcached - Add controller and configure the service to use the management IP address of the controller node. This setting enables access to other nodes through the management network.

- Enable the Memcached service and configure it to start as the system boots.
1 2
systemctl enable memcached.service systemctl start memcached.service
Installing etcd
Perform the following operations on the controller node.
- Install etcd.
1yum -y install etcd
- Modify the following nine parameters in the /etc/etcd/etcd.conf file and comment out other parameters:
1 2 3 4 5 6 7 8 9 10 11
#[Member] ETCD_DATA_DIR="/var/lib/etcd/default.etcd" ETCD_LISTEN_PEER_URLS="http://172.168.201.11:2380" ETCD_LISTEN_CLIENT_URLS="http://172.168.201.11:2379" ETCD_NAME="controller" #[Clustering] ETCD_INITIAL_ADVERTISE_PEER_URLS="http://172.168.201.11:2380" ETCD_ADVERTISE_CLIENT_URLS="http://172.168.201.11:2379" ETCD_INITIAL_CLUSTER="controller=http://172.168.201.11:2380" ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01" ETCD_INITIAL_CLUSTER_STATE="new"
Ensure that all the IP addresses are the management IP addresses of the controller node.
- Start the etcd service.
1 2
systemctl enable etcd systemctl start etcd
Disabling SELinux
The SELinux security mechanism enabled by default on Linux intercepts OpenStack-related services. As a result, OpenStack components cannot be deployed. This is the behavior of Linux itself, and Kunpeng BoostKit for Virtualization does not provide a solution to this issue. If you want to use SELinux in your own system, please find a solution by yourself.
We provide a method for quickly disabling SELinux. The SELinux configuration method provided in Kunpeng BoostKit for Virtualization is for reference only. You need to evaluate the method and bear related risks.
Disabling SELinux may cause security issues. If you do not plan to enable SELinux, it is recommended that an end-to-end solution be used to eliminate the risks caused by disabling SELinux. You shall bear the security risks by yourself. If you need to enable SELinux, configure fine-grained security rules based on actual SELinux issues to ensure system security.
Perform the following operation on all nodes.
- To disable SELinux temporarily, run the following command:
1setenforce 0
- To disable SELinux permanently, run the following command and restart the system for the setting to take effect:
1sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
Enabling Firewall Ports
Perform the following operations on all nodes.
- Enable the TCP ports.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
firewall-cmd --zone=public --add-port=8082/tcp --permanent firewall-cmd --zone=public --add-port=8773-8778/tcp --permanent firewall-cmd --zone=public --add-port=6080-6082/tcp --permanent firewall-cmd --zone=public --add-port=8386/tcp --permanent firewall-cmd --zone=public --add-port=5000/tcp --permanent firewall-cmd --zone=public --add-port=9292/tcp --permanent firewall-cmd --zone=public --add-port=9191/tcp --permanent firewall-cmd --zone=public --add-port=9696/tcp --permanent firewall-cmd --zone=public --add-port=6000-6002/tcp --permanent firewall-cmd --zone=public --add-port=6200-6202/tcp --permanent firewall-cmd --zone=public --add-port=8000-8004/tcp --permanent firewall-cmd --zone=public --add-port=8999/tcp --permanent firewall-cmd --zone=public --add-port=8777/tcp --permanent firewall-cmd --zone=public --add-port=8989/tcp --permanent firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --zone=public --add-port=8080/tcp --permanent firewall-cmd --zone=public --add-port=443/tcp --permanent firewall-cmd --zone=public --add-port=873/tcp --permanent firewall-cmd --zone=public --add-port=3260/tcp --permanent firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --zone=public --add-port=5672/tcp --permanent firewall-cmd --zone=public --add-port=6088/tcp --permanent firewall-cmd --zone=public --add-port=6080/tcp --permanent firewall-cmd --zone=public --add-port=15672/tcp --permanent firewall-cmd --zone=public --add-port=323/tcp --permanent firewall-cmd --zone=public --add-port=11211/tcp --permanent firewall-cmd --zone=public --add-port=123/tcp --permanent firewall-cmd --zone=public --add-port=69/tcp --permanent firewall-cmd --zone=public --add-port=5900-5999/tcp --permanent firewall-cmd --zone=public --add-port=2379-2380/tcp --permanent firewall-cmd --zone=public --add-port=6640/tcp --permanent firewall-cmd --zone=public --add-port=22/tcp --permanent
- Enable the UDP ports.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
firewall-cmd --zone=public --add-port=6640/udp --permanent firewall-cmd --zone=public --add-port=8082/udp --permanent firewall-cmd --zone=public --add-port=8773-8778/udp --permanent firewall-cmd --zone=public --add-port=6080-6082/udp --permanent firewall-cmd --zone=public --add-port=8386/udp --permanent firewall-cmd --zone=public --add-port=5000/udp --permanent firewall-cmd --zone=public --add-port=9292/udp --permanent firewall-cmd --zone=public --add-port=9191/udp --permanent firewall-cmd --zone=public --add-port=9696/udp --permanent firewall-cmd --zone=public --add-port=6000-6002/udp --permanent firewall-cmd --zone=public --add-port=6200-6202/udp --permanent firewall-cmd --zone=public --add-port=8000-8004/udp --permanent firewall-cmd --zone=public --add-port=8999/udp --permanent firewall-cmd --zone=public --add-port=8777/udp --permanent firewall-cmd --zone=public --add-port=8989/udp --permanent firewall-cmd --zone=public --add-port=80/udp --permanent firewall-cmd --zone=public --add-port=8080/udp --permanent firewall-cmd --zone=public --add-port=443/udp --permanent firewall-cmd --zone=public --add-port=873/udp --permanent firewall-cmd --zone=public --add-port=3260/udp --permanent firewall-cmd --zone=public --add-port=3306/udp --permanent firewall-cmd --zone=public --add-port=5672/udp --permanent firewall-cmd --zone=public --add-port=6088/udp --permanent firewall-cmd --zone=public --add-port=6080/udp --permanent firewall-cmd --zone=public --add-port=15672/udp --permanent firewall-cmd --zone=public --add-port=323/udp --permanent firewall-cmd --zone=public --add-port=11211/udp --permanent firewall-cmd --zone=public --add-port=123/udp --permanent firewall-cmd --zone=public --add-port=69/udp --permanent firewall-cmd --zone=public --add-port=5900-5999/udp --permanent firewall-cmd --zone=public --add-port=2379-2380/udp --permanent firewall-cmd --zone=public --add-port=22/udp --permanent
- Reload the firewall configuration for the settings to take effect.
1firewall-cmd --reload

