Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

OpenStack basic environment [1]

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

OpenStack basic environment [1]

OpenStack basic environment [1]

Openstack

Time: November 22, 2016

Openstack introduction

Openstack is a project managed by a cloud platform, it is not a software. In other words, we can use openstack to manage a large pool of resources in one of our data centers. It contains many sub-projects.

Openstack contains three major items: computing network storage

The main goal of openstack is to simplify the management and allocation of resources and to store computing on the network. The three items are virtualized into three resource pools. For example, I can provide computing resources here, network resources and storage resources here, provide api externally, and interact with each other through api.

Openstack is basically set up according to Amazon, and we can think of openstack as an open source version of aws. Because it operates with reference to Amazon in many places, and many of openstack's api are similar to Amazon.

First of all, the reason why openstack is popular is the open source software owned by apache, and secondly, it is written by python.

(because python is relatively simple and popular with technicians.)

Openstack official website: http://www.openstack.org

Introduction to openstack version

The openstack version is released every 6 months, and each version is sorted according to Amurz.

So how should we choose the version?

When we choose a version, we can choose a new version except for those features that have to be used in the new version. In fact, we can choose a version that lags slightly behind. The above picture is not accurate enough and has now reached the N version. Domestic openstack began to be popular in Class E. Because the E version was relatively perfect at that time, the most popular domestic openstack was in the G version. At present, both traditional industries and Internet industries are using openstack in China.

Openstack architecture

Service name Project name description DasgviardHorizon based on Openstack API interface Web management ComputeNova developed by diango provides a computing resource pool NetworkingNeutron through virtualization technology to realize the network resource management of virtual machines.

Storage (Storage)

Object StorageSwift object storage for "write once, read multiple" Block StorageCinder block storage, providing storage resource pool

ShareServices (shared Services)

Identify ServiceKeystone Certification Management Image ServiceGlance provides registration and storage management of virtual images TelemetryCeilometer provides monitoring and data acquisition and measurement services

Higher-level Services (High level Services)

OrchestrationHeat Automation deployment component Database ServiceTrove provides database application services

Explanation: all the services here are provided around VM. We will provide whatever resources the virtual machine needs.

We can divide services into two categories, one is the provider of the service, the other is the consumer of the service. The provider is that I can provide a service, and the consumer is that I can use this service.

By default, openstack does not have the function to create a virtual machine, but can also call esxi to create a virtual machine by calling KVM. In short, the function of openstack without creating a virtual machine is operated by calling other services. Openstack is a framework that can call other services, so openstack is a management platform.

Introduction to Openstack Service

MySQL: provides data storage for various services

RabbitMq: provides authentication and service registration for communication between services

Keystone: provides authentication and service registration for communication between servers

Glance: provides mirror management for virtual machines

Nova: provide computing resources for virtual machines

Neutron: provide network resources for virtual machines

Openstack environment preparation-MySQL, RabbirMQ

Chinese document: http://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/

Tip: this Chinese document is translated directly, so there will be a lot of irregularities.

Special hint: please keep the same environment with me! Keep it together! Keep it together! Keep it together!

This time we install Openstack M version, which was released in 2016-April.

Environment

[root@linux-node1 ~] # cat / etc/redhat-release CentOS Linux release 7.2.1511 (Core) [root@linux-node1 ~] # uname-r3.10.0-327.36.2.el7.x86_64 [root@linux-node1 ~] # cat / etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.56.11 linux-node1.abcdocker.com192.168.56.12 linux-node2.abcdocker.com

Installation time synchronization

[root@linux-node1 ~] # yum install ntpdate-y [root@linux-node1 ~] # ntpdate time1.aliyun.com [root@linux-node1 ~] # timedatectl set-timezone Asia/Shanghai # another method of setting the time zone [root@linux-node1 ~] # cp / usr/share/zoneinfo/Asia/Shanghai / etc/localtime

Tip: the time synchronization of openstack nodes must be guaranteed in the production environment. If the time is not synchronized, a virtual machine cannot be created.

Openstack basic package installation

The basic software package needs to be installed on all Openstack nodes, including control nodes and compute nodes

1. Install EPEL warehouse

[root@linux-node1 ~] # rpm-ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm

2. Install Openstack warehouse

[root@linux-node1 ~] # yum install-y centos-release-openstack-mitaka# will generate CentOS-OpenStack-mitaka.repo under / etc/yum.repos.d/ after installation is completed

3. Install the Openstack client

[root@linux-node1 ~] # yum install-y python-openstackclient hint: all the clients commonly used in openstack will be installed

4. Install the openstack SELinux management package

Yum install-y openstack-selinux

If we don't turn it off, selinux openstack-selinux will automatically set it up for us.

Several uses of RabbitMq in openstack

1. To serve as a tool for communication between services

two。 Information synchronization (asynchronous execution)

Without RabbitMq services, communication will not be possible.

Tip: if it is a production environment, the database needs to be backed up, otherwise the data linked to the database will be lost and openstack will not be able to provide services

Installation database [root@linux-node1 ~] # yum install-y mariadb mariadb-server python2-PyMySQLcentos7 default installation mysql will be in / etc/my.cnf includedir / etc/my.cnf.d/, so we need to put the configuration file in this directory to take effect [root@linux-node1 ~] # cd / etc/my.cnf.d/ [root@linux-node1 my.cnf.d] # vim openstack.cnf [mysqld] bind-address = 192.168 .56.11 # listening IP address (can also write 0.0.0.0) default-storage-engine = innodb # default storage engine [innodb] innodb_file_per_table # using exclusive tablespace max_connections = 4096 # maximum number of connections is 4096 (default is 1024) collation-server = utf8_general_ci # Database default proofreading rule character-set-server = utf8 # default character set enabled Dynamic database [root@linux-node1 ~] # systemctl start mariadb [root@linux-node1 ~] # systemctl enable mariadbCreated symlink from / etc/systemd/system/multi-user.target.wants/mariadb.service to / usr/lib/systemd/system/mariadb.service.

We need to check after startup.

To ensure the security of the database service, run the mysql_secure_installation script. In particular, set an appropriate password for the root user of the database.

[root@linux-node1 ~] # mysql_secure_installation# it will help us delete the test database, etc.

After the database installation is complete, we need to create users and authorize the services we will use later.

Create a database of authentication services and authorize them

[root@linux-node1 ~] # mysql-uroot-p123456 create keystone database create database keystone;grant all on keystone.* to 'keystone'@'localhost' identified by' keystone';grant all on keystone.* to 'keystone'@'%' identified by' keystone'

Create a mirror database and authorize it

Create glance database create database glance;grant all on glance.* to 'glance'@'%' identified by' glance';grant all on glance.* to 'glance'@'localhost' identified by' glance'

Create virtualized database and authorize it

Create a nova database create database nova;grant all on nova.* to 'nova'@'localhost' identified by' nova';grant all on nova.* to 'nova'@'%' identified by' nova'

Because Nova has two projects, we need to create two databases

Create a nova-api database

Create database nova_api;rant all on nova_api.* to 'nova_api'@'localhost' identified by' nova_api';grant all on nova_api.* to 'nova_api'@'%' identified by' nova_api'

Hint: nova_api is only available in the new version.

Create a network resource management database

Create database neutron;grant all on neutron.* to 'neutron'@'%' identified by' neutron';grant all on neutron.* to 'neutron'@'localhost' identified by' neutron'

Refresh

Flush privileges

Install message queuing rabbitmq

The port of [root@linux-node1 ~] # yum install rabbitmq-server-y message queue is 5672

Start the message queuing service and configure it to start with the system:

[root@linux-node1 ~] # systemctl enable rabbitmq-server.service [root@linux-node1 ~] # systemctl start rabbitmq-server.service

Since we are going to use openstack later, we create an openstack user on rabbitmq

[root@linux-node1 ~] # rabbitmqctl add_user openstack openstack [root@linux-node1 ~] # rabbitmqctl add_user user password

Give openstack users read and write permissions

[root@linux-node1 ~] # rabbitmqctl set_permissions openstack ". *". * represents configuration, write, and read, respectively.

Tip: if rabbitmq does not start, the hostname is not resolved.

Open the rabbitmq monitoring plug-in

Rabbitmq has many plug-ins, and we can use rabbitmq-plugins list to view the available plug-ins

The rabbitmq_management plug-in provides a web interface, so we need to turn it on

[root@linux-node1 ~] # rabbitmq-plugins enable rabbitmq_managementrabbitmq will listen for 15672 when it starts.

Access path: http://ip:15672

Default Username:guest

Default Password:guest

Sample diagram

Tip: openstack users cannot be used to log in here, because we need authorization on the web page if we want to use openstack users to log in

Now we're going to have the rabbitmq management interface.

Rabbitmq has an api of http by default. If we want to monitor, we can use the api of http to monitor. There are basically all the things you want to monitor, which can be obtained through scripts and judged by url, etc.

Zabbix related articles: http://www.abcdocker.com/zabbix

The basic introduction is over!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report