Detailed tutorial on OpenStack environment deployment based on CentOS (OpenStack installation)

Detailed tutorial on OpenStack environment deployment based on CentOS (OpenStack installation)

Effect display:

insert image description here
insert image description here

Environment preparation controller node:

6GB

4H

60GB/30GB/30GB

compute nodes

6GB

4H

60G/60G

Admin node (ceph admin management node)

2GB

4H

60GB/6GB

Introduction to OpenStack

OpenStack is an open source cloud platform management project that can be used to build public or private cloud platforms. It provides infrastructure and service (Iaas) solutions. OpenStack is a cloud operating system that can control computing, storage, network and other resource pools through data centers. OpenStack covers various aspects such as network, virtualization, operating system, and server. Through OpenStack, virtual machine resources can be started, allocated, and managed, and all management can be completed through the front-end interface.

OpenStack core component Nova

Computing management service manages the entire life cycle of virtual machine instances, and is responsible for operations such as virtual machine creation, startup, shutdown, suspension, pause, adjustment, migration, restart, destruction, resource allocation, etc. It provides services to the outside world through APIs, uses KeyStone for identity authentication, uses Horizon as its management interface, and uses Glance to provide its image, so that Nova can manage computing resources, networks, and authentication.

Neutron

Network management service provides an independent network environment for each tenant in a multi-tenant environment. Neutron provides network support for the entire OpenStack environment. It can define Network, Subent, Router, configure DHCP, DNS, load balancing, L3 services, and the network supports GRE, VLAN, etc. It also supports many popular network management plug-ins, such as OpenvSwitch.

Cinder

Block storage service supports different storage backends, including ceph, glusterfs, etc. It is the basis for storing virtual machines and the data used by virtual machines. Cinder provides access to and management of block storage devices. For OpenStack hosts, storage appears in the form of block devices, using ISCSI, NFS, ceph or other special protocols as backend connections; Cinder's interface specifies a series of independent functions, including basic functions such as creating volumes, deleting volumes, and mounting volumes, as well as some advanced functions such as extending volumes, snapshots, and cloning from VM images.

Swift

Object storage service provides a distributed large-scale object storage service across nodes for the OpenStack cluster. It stores and retrieves unstructured data objects through a RESTful interface. It is a highly fault-tolerant and scalable storage architecture. Object storage stores the corresponding data as binary objects rather than files. Generally, the entire object can be stored or retrieved through one instruction.

Keystone

The authentication management service is a module in the OpenStack framework that is responsible for managing identity authentication, service rules, and service token functions. It manages Domains, Projects, Users, Groups, and Roles, and uses MySQL as a unified database. Users need to verify their identities and permissions to access resources, and services also need to perform permission checks to perform operations. These all need to be processed through Keystone. OpenStack services use Keystone to register their Endpoints (URLs for service access). Any calls between services must first be authenticated by KeyStone, obtain the target Endpoint, and then call.

Glance

The image management service provides management of images that can be provided when a virtual machine is deployed, including image search, registration, retrieval, import, format, and creation of corresponding templates. It supports multiple virtual machine image formats and has the functions of creating images, deleting images, and editing basic image information. Glance provides a RESTful API to query the metadata of virtual machine images and obtain images. Glance can save images to a variety of backend storages, such as simple file storage or object storage.

Horizon

The user interface is the web management portal for various services in OpenStack, which is used to simplify user operations on services, such as starting instances, assigning IP addresses, configuring access control, etc.

Install CentOS

yum install vim

Enter the following command in the cmd window to view the network segment

ipconfig /all

Modify network card information

vim /etc/sysconfig/network-scripts/ifcfg-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.12.18
PREFIX=24
GATEWAY=192.168.12.1
DNS1=192.168.111.2

Restart network services

service network restart

controller

ens33 192.168.12.18 (provides floating IP, outbound address)

ens34 192.168.12.118 (communication between intranets)

compute

ens33 192.168.12.140 (provides floating IP, outbound address)

ens34 192.168.12.240 (communication between intranets)

# Restart immediately shutdown -r now

Initialize each node

yum -y install wget net-tools nfs-utils lrzsz gcc gcc-c++ make cmake libxml2-devel openssl-devel curl curl-devel unzip sudo ntp libaio-devel vim ncurses-devel autoconf automake zlib-devel python-devel epel-release lrzsz openssh-server

Disable firewall, networkmanager, iptables, selinux (operation on each node)

systemctl stop firewalld && systemctl disable firewalld && systemctl stop NetworkManager && systemctl disable NetworkManager
systemctl stop iptables && systemctl disable iptables

Modify selinux

vim /etc/sysconfig/selinux
SELINUX=disabled

Modify hosts

vim /etc/hosts
192.168.12.118 controller
192.168.12.240 compute

Modify the host name

hostnamectl set-hostname controller
hostnamectl set-hostname compute

Time Synchronization

ntpdate cn.pool.ntp.org

Configure password-free login and operations on each node

ssh-keygen -t rsa 
#Just keep pressing Enter ssh-copy-id -i .ssh/id_rsa.pub controller
ssh-copy-id -i .ssh/id_rsa.pub computer

Use xftp to upload the openstack offline software package to the root directory (operate on the controller and compute nodes)

Create a directory openstack under root, and then unzip the software package to this directory

mkdir /root/openstack && cd /root/openstack && tar zxvf /root/openstack_N.tar.gz

Move the entire openstack directory to / (controller and computer node operations)

mv openstack /

Reconfigure the yum source (both controller and computer nodes)

cd /etc/yum.repos.d/ 
mkdir bak 
mv CentOS-* bak/ 
mv epel* bak/
cp bak/CentOS-Base.repo ./

Generate a new openstack yum repository

cat <<EOF > /etc/yum.repos.d/openstack.repo 
[openstack]
enable=1
gpgcheck=0
baseurl=file:///openstack
EOF

Clear cache

yum makecache

Openstack response file installation (controller node operation)

yum install centos-release-openstack-newton -y
cd /etc/yum.repos.d 
mv *.repo bak/ 
cp bak/openstack.repo ./ 
cp bak/CentOS-Base.repo ./

Clear cache

yum makecache
yum install openstack-packstack -y
cd /root
packstack --gen-answer-file=openstack.txt

After the end, a response file openstack.txt will be generated

Modify the openstack.txt file

The modified contents are as follows

CONFIG_DEFAULT_PASSWORD=123456
CONFIG_SWIFT_INSTALL=n
CONFIG_NAGIOS_INSTALL=n
CONFIG_CINDER_VOLUMES_SIZE=10G
CONFIG_PROVISION_DEMO=n
CONFIG_LBAAS_INSTALL=y
CONFIG_NEUTRON_FWAAS=y
CONFIG_NEUTRON_VPNAAS=y
CONFIG_CONTROLLER_HOST=192.168.12.118
CONFIG_COMPUTE_HOSTS=192.168.12.240
CONFIG_NETWORK_HOSTS=192.168.12.240

Install components based on an answer file

packstack --answer-file=openstack.txt

During the installation process, you need to check the iptables status on the controller and computer nodes.

systemctl status iptables

If iptables is found to be in active state, it needs to be stopped

systemctl stop iptables

See the following instructions for successful installation

Installation completed successfully

Start the management interface of RabbitMQ (controller node operation)

rabbitmq-plugins enable rabbitmq_management

Access via browser

192.168.124.200:15672

Account: guest

Password: guest

Log in to the dashboad interface of openstack

Type in your browser:

192.168.124.200

Account: admin

password:

Get Password

cd /root
cat keystonerc_admin

KeyStone Configuration Optimization

Operation on the controller node

Modify keystone.conf

vim /etc/keystone/keystone.conf

Add the following line below the default field

memcache_servers = 192.168.12.118:11211

Restart the service

systemctl restart httpd

If OpenStack can be accessed normally, the configuration is successful.

Glance configuration optimization

Modify glance-api.conf

vim /etc/glance/glance-api.conf

Add at the top

memcache_servers = 192.168.12.118:11211

Modify glance-registry.conf

vim /etc/glance/glance-registry.conf

Add at the top

memcache_servers = 192.168.12.118:11211

Restart the service

systemctl restart openstack-glance-api
systemctl restart openstack-glance-registry

Nova configuration optimization is modified on the controller node

Modify nova.conf

vim /etc/nova/nova.conf

Add memcahce cache on top

memcache_servers = 192.168.12.118:11211

Originally there was only an address, but no http protocol. You need to add the http protocol

api_servers=http://192.168.12.118:9292

Add this line below the first line [DEFAULT]

transport_url=rabbit://guest:[email protected]

Change the original IP to this one and open the comment

my_ip=192.168.12.118

It was originally 0.0.0.0, now it is changed to this

vncserver_listen=192.168.12.118

It was originally the host name, change it to this host IP

vncserver_proxyclient_address=192.168.12.118

After modifying the above, restart the service

systemctl restart openstack-nova-api.service \
 openstack-nova-consoleauth.service openstack-nova-scheduler.service \
 openstack-nova-conductor.s:serve openstack-nova-novncproxy.service

Modify on the compute node

Modify the configuration file nova.conf

vim /etc/nova/nova.conf

Add the following line to the first line [DEFAULT] field

memcache_servers=192.168.12.118:11211

This line of comments is turned on and becomes this IP address

transport_url=rabbit://guest:[email protected]

This line comment is turned on, and the ip becomes the host ip

api_servers=http://192.168.12.118:9292

This line of comments is turned on and becomes this IP address

my_ip=192.168.12.240

This line of comments is turned on and becomes this IP address

vncserver_proxyclient_address=192.168.12.240

This line of comments is turned on and becomes this IP address

novncproxy_base_url=http://192.168.12.118:6080/vnc_auto.html

This line is commented out

virt_type=qemu

After the above is fixed, restart the service

systemctl enable libvirtd.service openstack-nova-compute.service
systemctl restart libvirtd.service openstack-nova-compute.service

Check the log, no error

cat /var/log/nova/nova-compute.log

After startup, view the log on the controller node

cat /var/log/nova/nova-api.log

If there is no error,

Neutron configuration optimization

Operation on the controller node

Modify the configuration file neutron.conf

vim /etc/neutron/neutron.conf

Add a new line

memcache_servers = 192.168.12.118:11211

Find transport_url and add a new line (the message queue rabbit address is on the controller node)

transport_url = rabbit://guest:[email protected]

Find lock_path and change it to an absolute path

lock_path=/var/lib/neutron/tmp

Modify ml2_conf.ini

vim /etc/neutron/plugins/ml2/ml2_conf.ini

Modify vni_ranges

vni_ranges = 10:10000

After modifying the above two files, restart the service

systemctl restart neutron-server

Open a new port to check the logs. If there is no error,

tail -f /var/log/neutron/server.log

Operation on the compute node

Create a bridged network card and bridge it to the network card that can access the external network, that is, ens33

cd /etc/sysconfig/network-scripts
mkdir bak
cp ifcfg-ens33 bak/
vim ifcfg-br-ex

Copy the contents to ifcfg-br-ex

DEVICE=br-ex
BOOTPROTO=static
ONBOOT=yes
TYPE=OVSBridge
DEVICETYPE=ovs
USERCTL=yes
PEERDNS=yes
IPV6INIT=no
IPADDR=192.168.12.140
NETMASK=255.255.255.0
DNS1=192.168.111.2
GATEWAY=192.168.12.1
vim ifcfg-ens33

Delete the original content and replace it with the following

#Device name DEVICE=ens33
# Whether to enable automatic startup ONBOOT=yes
TYPE=OVSPort
DEVICETYPE=ovs
# Which network card is bridged to? OVS_BRIDGE=br-ex

Restart the network card

service network restart

Modify the configuration file neutron.conf

vim /etc/neutron/neutron.conf

Add a new line to the configuration file

transport_url = rabbit://guest:[email protected]

Add a new line

memcached_servers=192.168.12.118:11211

The original path becomes this

lock_path=/var/lib/neutron/tmp

Modify the configuration files related to the third layer and floating IP

cd /etc/neutron
vim l3_agent.ini

Remove this line of comments

ovs_integration_bridge = br-int

This line is commented out

availability_zone = nova

Modify the configuration file metadata_agent.ini

vim metadata_agent.ini

This line is commented out

nova_metadata_port = 8775

This line is commented out

nova_metadata_protocol = http

Add a new line

memcached_servers=192.168.12.118:11211

Modify the configuration file dhcp_agent.ini

vim dhcp_agent.ini

This line is commented out

ovs_integration_bridge = br-int

It was originally False and needs to be changed to True

enable_metadata_network = True

Add a new line

dhcp_domain = test.localdomain

Open the original comment and change it to the external network's DNS address

dnsmasq_dns_servers = 192.168.111.2

This line is commented out

dnsmasq_lease_max = 16777216

This line is commented out

availability_zone = nova

After the above changes are made, restart the service

systemctl restart neutron-ovs-cleanup.service neutron-openvswitch-agent.service neutron-metering-agent.service neutron-metadata-agent.service neutron-lbaasv2-agent.service neutron-l3-agent.service neutron-dhcp-agent.service

This is the end of this article about CentOS-based OpenStack environment deployment (OpenStack installation). For more information about CentOS-based OpenStack environment deployment, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • OpenStack Cloud Computing Quick Start Tutorial (1) Introduction to OpenStack and its components
  • A brief introduction to the basic concepts of OpenStack Keystone
  • Detailed explanation of Openstack component deployment - Overview and preliminary environment preparation
  • Openstack cloud computing component glance deployment and operation steps

<<:  Vue realizes dynamic progress bar effect

>>:  How to write a MySQL backup script

Recommend

How to use mixins in Vue

Table of contents Preface How to use Summarize Pr...

The submit event of the form does not respond

1. Problem description <br />When JS is use...

Implementation of Docker private library

Installing and deploying a private Docker Registr...

How to use cutecom for serial communication in Ubuntu virtual machine

Using cutecom for serial communication in Ubuntu ...

js to achieve star flash effects

This article example shares the specific code of ...

Basic syntax of MySQL index

An index is a sorted data structure! The fields t...

CSS to achieve fast and cool shaking animation effect

1. Introduction to Animate.css Animate.css is a r...

An example of implementing a simple finger click animation with CSS3 Animation

This article mainly introduces an example of impl...

Solution to inconsistent display of cursor size in input box

The cursor size in the input box is inconsistent T...

Solve the problem of using linuxdeployqt to package Qt programs in Ubuntu

I wrote some Qt interface programs, but found it ...

Whitespace processing in HTML/CSS and how to preserve whitespace in the page

Whitespace rules in HTML In HTML, multiple spaces...

docker cp copy files and enter the container

Enter the running container # Enter the container...

Summary of MySql index, lock, and transaction knowledge points

This article summarizes the knowledge points of M...