Openstack (basic theory of cloud computing-Openstack one-click deployment actual combat)

Openstack cloud computing basic theory ------Openstack one-click deployment actual combat

1. Cloud computing overview

1. What is cloud computing

Cloud computing is a pay-per-use model that provides usable, convenient, and on-demand network access and enters a configurable computing resource shared pool (resources include: network, server, storage, application software, and service ), these resources can be provided quickly with little management work or little interaction with service providers.

Insert picture description here

2. Features of cloud computing

(1) Super large scale

"Cloud" has a considerable scale, and enterprise private clouds generally have hundreds or thousands of servers, which can give users unprecedented computing power.

(2) Virtualization

Cloud computing supports users to obtain application services at any location and using various terminals.

(3) High reliability

"Cloud" uses measures such as fault tolerance of multiple copies of data and interchangeability of computing nodes to ensure high reliability of services. Cloud computing is more reliable than using local computers.

(4), versatility

Cloud computing is not aimed at specific applications. The same "cloud" can support the operation of different applications at the same time.

(5) High scalability

The scale of "cloud" can be dynamically scaled to meet the needs of application and user scale growth.

(6) On-demand service

"Cloud" is a huge resource pool that you can buy on demand; Cloud can be billed like tap water, electricity, and gas.

(7), extremely cheap

Because the "cloud" special fault tolerance measures can use extremely cheap nodes to form the cloud, the automatic centralized management of the "cloud" frees a large number of enterprises from burdening the increasingly high data center management costs, and the versatility of the "cloud" enables the utilization of resources Compared with the traditional system, users can fully enjoy the low-cost advantages of the "cloud", and often only spend a few hundred dollars in a few days to complete tasks that previously required tens of thousands of dollars and months.

3. Three ways to use cloud computing: public cloud, private cloud, and hybrid cloud

(1) Public cloud: It means that the infrastructure is not built by itself, and only cares about how to use it

Public clouds are divided into the following categories:

1. Traditional telecom infrastructure operators, such as public cloud services provided by China Mobile, China Unicom, China Telecom, etc.
2. The first type is a local government-led cloud computing platform, which is often referred to as government cloud
3. Internet giants Public cloud platform
4, some IDC operators
5, and some foreign cloud computing companies

(2) Private cloud: build a cloud environment by yourself, and the facilities and equipment need to be maintained by yourself or by a third party

The private cloud is built for a user to use alone, so it can effectively control the data security and service quality. The foundation of the private cloud is that you must first have the infrastructure and control the way to deploy applications on this facility. , Private cloud can be deployed in the firewall of enterprise data center. The core attribute is proprietary resources. For example, we often use and more typical private clouds are VmWare, openstack

(3) Hybrid cloud: the combination of public cloud and private cloud is the way many enterprises use it

Generally, the core business is placed on its own private cloud, and the secondary is placed on the public cloud.
But there are also some problems:
security, data redundancy, law, service quality, etc.

4. Cloud computing service model

(1), laaS (Infrastructure as a Service)

Provide underlying IT infrastructure services, including processing capacity, storage space, network resources, etc.
Object-oriented generally IT managers

(2) PaaS (Platform as a Service)

The system platform installed with the development environment is provided as a service to users through the Internet. The
object-oriented is generally the developer

(3) SaaS (software as a service)

Provide users with services such as software and applications directly through the Internet.
Object-oriented-generally ordinary users

Insert picture description here

Second, OpenStack

(1) Overview of Openstack

  • Co-sponsored by NASA (National Aeronautics and Space Administration) and Rackspace
  • Free software and open source projects licensed under the Apache license
  • An open source project that provides software for the construction and management of public and private clouds
  • Covers all aspects of networking, virtualization, operating systems, servers, etc.

(2) Eight core components of OpenStack

Insert picture description here

(3) Advantages of OpenStack

1. Controllability

Fully open source platform, providing API interface, easy to integrate with third-party technology
2. Compatibility

OpenStack is compatible with other public clouds, which is convenient for users to perform data migration.
3. Scalability

Modular design, you can increase nodes and resources through horizontal expansion
4. Flexibility

Establish corresponding infrastructure and increase the scale of clusters according to their own needs
5. Industry standards

Many leading IT companies have joined the OpenStack project

Three, Openstack one-click deployment steps

1. Environmental requirements

CentOS 7.6 系统
CPU:双核双线程/开启虚拟化功能
内存:4G
硬盘:30G+300G
网卡:NAT模式
选做:(装机界面按Tab键进入界面编辑,输入后面的内容)net.ifnames=0 biosdevname=0 (创建时可修改为eth0网卡)

Insert picture description here

2. Environment configuration

(1) Configure static address and host name

vi /etc/sysconfig/network-scripts/ifcfg-eth0
......
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.246.10
NETMASK=255.255.255.0
GATEWAY=192.168.246.2
DNS1=192.168.246.2
DNS2=8.8.8.8

#在/etc/resolv.conf中添加:
vi /etc/resolv.conf
nameserver 114.114.114.114
#重启网卡
systmectl restart network

(2) Turn off (set not to start after booting) firewall, core protection, NetworkManager

systemctl stop firewalld
systemctl disable firewalld
systemctl stop NetworkManager
setenforce 0

(3) Install time synchronization service, synchronize Alibaba Cloud clock server (ntp1, ntp2...), set periodic tasks and set self-start after booting

yum install -y ntpdate
ntpdate ntp.aliyun.com >>/var/log/ntpdate.log
crontab -e
*/30 * * * * /usr/sbin/ntpdate ntp.aliyun.com
....

(4) Configure yum source

[root@openstack ~]# cd /etc/yum.repos.d/
[root@openstack yum.repos.d]# mkdir bak
[root@openstack yum.repos.d]# mv C* bak/
[root@openstack yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@openstack yum.repos.d]# yum -y install centos-release-openstack-train
[root@openstack yum.repos.d]# yum clean all
[root@openstack yum.repos.d]# yum makecache (fast)		#()部分可选择添加

(5) Restart and check service status

reboot

(6) Download the OpenStack management toolkit and deploy OpenStack online

yum -y install openstack-packstack
packstack --allinone

 **** Installation completed successfully ******

Additional information:
 * Parameter CONFIG_NEUTRON_L2_AGENT: You have chosen OVN Neutron backend. Note that this backend does not support the VPNaaS or FWaaS services. Geneve will be used as the encapsulation method for tenant networks
 * A new answerfile was created in: /root/packstack-answers-20201018-191715.txt
 * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
 * File /root/keystonerc_admin has been created on OpenStack client host 192.168.226.150. To use the command line tools you need to source the file.
 * To access the OpenStack Dashboard browse to http://192.168.246.10/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
 * The installation log file is available at: /var/tmp/packstack/20201018-191715-BH2Wcy/openstack-setup.log
 * The generated manifests are available at: /var/tmp/packstack/20201018-191715-BH2Wcy/manifests

#创建br-ex网卡配置文件

cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-br-ex
sed -i "100d" ifcfg-br-ex
cat <<EOF >> ifcfg-br-ex
TYPE=Ethernet
BOOTPROTO=none
NAME=br-ex
DEVICE=br-ex
ONBOOT=yes
IPADDR=172.24.4.1
PREFIX=24
EOF

systemctl restart network

#ifconfig 查看

(7) View user information

cd /root && cat keystonerc_admin

(8) Web login

块设备映射—> 孵化 —>

#上传镜像,两种方式
第一种——命令行

Guess you like

Origin blog.csdn.net/weixin_51431591/article/details/114531402