主頁 > 作業系統 > 云計算管理平臺之OpenStack計算服務nova

云計算管理平臺之OpenStack計算服務nova

2020-10-30 22:51:14 作業系統

  一、nova簡介

  nova是openstack中的計算服務,其主要作用是幫助我們在計算節點上管理虛擬機的核心服務;這里的計算節點就是指用于提供運行虛擬機實體的主機,通常像這種計算節點有很多臺,那么虛擬機到底在哪個server上啟動?如何啟動?這就是nova需要做的;對于openstack用戶來講,底層到底在哪臺server上啟動虛擬機以及怎么啟動的,我們可以不關心;因為nova服務幫我們搞定;

  nova架構圖

  nova服務有很多組件,其中核心組件有nova-api、nova-scheduler、nova-conductor、nova-console、nova-novncproxy、nova-placement和nova-compute ;其中nava-api主要用來接收客戶端請求,并將請求資訊放到對應的訊息佇列中,同時將用戶的請求寫入到nova資料庫中,相當于服務的入口;nova-scheduler主要用于調度用戶的請求,比如創建虛擬機需要調度到哪臺物理server上創建都是由nova-scheduler來決策;它會將其調度結果放到對應的訊息佇列中同時它也會把調度資訊寫入nova資料庫中;nova-conductor主要用來幫助其他組件修改虛擬機后的資訊,將其寫入到nova 資料庫中的;所有佇列中有關寫資料庫的請求都會先丟給nova-conductor所訂閱的訊息佇列中,然后nova-conductor會按照一定的速度向資料庫中寫;這樣做主要是減少資料庫的壓力,避免資料庫壓力過大而出現例外;nova-console主要用來給虛擬機提供控制臺服務,并將其控制臺地址寫入到nova資料庫中;nova-novncproxy主要作用是代理用戶通過novnc訪問虛擬機控制臺;nova-placement主要作用是跟蹤每個資料節點的資源使用情況;nova-computer主要用來呼叫資料節點的hypervisor,來管理虛擬機;這些組件都是基于一個訊息佇列服務來相互呼叫的;從而實作各組件解耦;所以nova服務是嚴重依賴訊息佇列服務的;

  nova核心作業流程

  當nova-api接收到用戶的請求,比如創建一個虛擬機實體,nova-api會把這個請求放到訊息佇列中,并把用戶的請求資訊寫入到nova資料庫中,然后繼續接收其他用戶的請求;nova-api把用戶請求放到未調度的訊息佇列中,nova-scheduler會從未調度的訊息佇列中取出用戶的請求進行調度,把調度結果又回傳給對應計算節點所訂閱的訊息佇列中,同時它也會把調度結果寫到nova資料庫中,然后由對應的資料節點nova-computer取出調度后的訊息進行處理;nova-computer的處理就是呼叫本地的hypervisor來創建虛擬機,最后把創建成功的訊息,丟給訊息佇列,然后由nova-api到訊息佇列中取得虛擬機實體創建成功的訊息,nova-api再把訊息回傳給用戶;對于其他組件的作業原理也是類似,他們都是把處理的結果放到對應的訊息佇列中,然后由其他組件去訊息佇列中取結果,從而完成各組件間的互相呼叫;

  二、nova服務的安裝、配置、測驗

  1、創建資料庫、用戶、授權用戶

[root@node02 ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 10.1.20-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE nova_api;
Query OK, 1 row affected (0.01 sec)

MariaDB [(none)]> CREATE DATABASE nova;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE DATABASE nova_cell0;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE DATABASE placement;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%'  IDENTIFIED BY 'nova123';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%'  IDENTIFIED BY 'nova123';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%'  IDENTIFIED BY 'nova123';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%'  IDENTIFIED BY 'nova123';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| glance             |
| information_schema |
| keystone           |
| mysql              |
| nova               |
| nova_api           |
| nova_cell0         |
| performance_schema |
| placement          |
| test               |
+--------------------+
10 rows in set (0.05 sec)

MariaDB [(none)]>

  提示:以上主要創建了四個資料庫,分別是nova_api,nova,nova_cell0,placement;然后創建了兩個用戶,一個是nova用戶,并授權它能夠從任意主機連接到資料庫,并對nova_api,nova,nova_cell0這三個庫下的有所有表有增刪查改的權限;一個用戶是placement,并授權該用戶能夠從任意主機連接到placement資料庫對placment庫下的所有表增刪查改的權限;

  驗證:用其他主機使用nova用戶連接mariadb,看看是否能夠正常連接?是否能夠看到nova_api,nova,nova_cell0這三個庫?

[root@node01 ~]# mysql -unova -pnova123 -hnode02
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.20-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| nova               |
| nova_api           |
| nova_cell0         |
| test               |
+--------------------+
5 rows in set (0.00 sec)

MariaDB [(none)]> exit
Bye
[root@node01 ~]# 

  提示:使用nova用戶和nova用戶的密碼連接資料能夠看到我們之前授權的三個庫,說明我們創建nova用戶并授權的操作沒有問題;

  驗證:用其他主機使用placement用戶連接mariadb,看看是否可正常連接?是否能夠看到placement這個庫?

[root@node01 ~]# mysql -uplacement -pnova123 -hnode02
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.1.20-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| placement          |
| test               |
+--------------------+
3 rows in set (0.00 sec)

MariaDB [(none)]> exit
Bye
[root@node01 ~]# 

  說明:能夠看到placement庫就說明placement賬號沒有問題;

  2、在控制節點上安裝、配置nova服務

  匯出admin用戶的環境變數,創建nova用戶,設定其密碼為nova

[root@node01 ~]# source admin.sh 
[root@node01 ~]# openstack user create --domain default --password-prompt nova
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | 47c0915c914c49bb8670703e4315a80f |
| enabled             | True                             |
| id                  | 8e0ed287f92749e098a913a3edb90c74 |
| name                | nova                             |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
[root@node01 ~]# 

  將nova用戶授權為admin角色,并指明是一個service專案

[root@node01 ~]# openstack role add --project service --user nova admin
[root@node01 ~]# 

  創建nova服務,并將其型別設定為compute 

[root@node01 ~]# openstack service create --name nova \
>   --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Compute                |
| enabled     | True                             |
| id          | 8e002dd8e3ba4bd98a15b433dede19a3 |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+
[root@node01 ~]# 

  創建compute API endport (服務端點,注冊服務)

  創建公共端點

[root@node01 ~]# openstack endpoint create --region RegionOne \
>   compute public http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 7524a1aa1c6f4c21ac4917c1865667f3 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 8e002dd8e3ba4bd98a15b433dede19a3 |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+
[root@node01 ~]# 

  創建私有端點

[root@node01 ~]# openstack endpoint create --region RegionOne \
>   compute internal http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 1473a41427174c24b8d84c62b25262f6 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 8e002dd8e3ba4bd98a15b433dede19a3 |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+
[root@node01 ~]# 

  創建管理端點

[root@node01 ~]# openstack endpoint create --region RegionOne \
>   compute admin http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 3427fe37f3564252bffe0ee2f6bc766c |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 8e002dd8e3ba4bd98a15b433dede19a3 |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+
[root@node01 ~]# 

  創建placement用戶,并設定密碼為placement

[root@node01 ~]# openstack user create --domain default --password-prompt placement
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | 47c0915c914c49bb8670703e4315a80f |
| enabled             | True                             |
| id                  | a75c42cd405b4ea4885141df228b4caf |
| name                | placement                        |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
[root@node01 ~]# 

  將placement用戶授權為admin角色,并指明是一個service專案

[root@node01 ~]# openstack role add --project service --user placement admin
[root@node01 ~]# 

  創建placement服務,并將其型別設定為placement

[root@node01 ~]# openstack service create --name placement \
>   --description "Placement API" placement
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Placement API                    |
| enabled     | True                             |
| id          | de21b8c49adb4a8d88c38a08d5db2d59 |
| name        | placement                        |
| type        | placement                        |
+-------------+----------------------------------+
[root@node01 ~]# 

  創建placement API endport (服務端點,注冊服務)

  公共端點

[root@node01 ~]# openstack endpoint create --region RegionOne \
>   placement public http://controller:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 222b6f91a2674ea993524c94e41a5757 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | de21b8c49adb4a8d88c38a08d5db2d59 |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://controller:8778           |
+--------------+----------------------------------+
[root@node01 ~]# 

  私有端點

[root@node01 ~]# openstack endpoint create --region RegionOne \
>   placement internal http://controller:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 04fa958200a943f4905893c6063389ab |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | de21b8c49adb4a8d88c38a08d5db2d59 |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://controller:8778           |
+--------------+----------------------------------+
[root@node01 ~]# 

  管理端點

[root@node01 ~]# openstack endpoint create --region RegionOne \
>   placement admin http://controller:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 6ddf51b6d9d8467e92cbf22c40e1ba1c |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | de21b8c49adb4a8d88c38a08d5db2d59 |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://controller:8778           |
+--------------+----------------------------------+
[root@node01 ~]# 

  驗證:在控制節點上查看是端點串列,看看nova和placement服務端點是否都創建成功?

[root@node01 ~]# openstack endpoint list 
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
| ID                               | Region    | Service Name | Service Type | Enabled | Interface | URL                         |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
| 04cd3747614b42a3ba086cef39a1acd9 | RegionOne | glance       | image        | True    | admin     | http://controller:9292      |
| 04fa958200a943f4905893c6063389ab | RegionOne | placement    | placement    | True    | internal  | http://controller:8778      |
| 09f5ec434ea24d4c8dc9efe2bbb62b01 | RegionOne | glance       | image        | True    | internal  | http://controller:9292      |
| 1473a41427174c24b8d84c62b25262f6 | RegionOne | nova         | compute      | True    | internal  | http://controller:8774/v2.1 |
| 222b6f91a2674ea993524c94e41a5757 | RegionOne | placement    | placement    | True    | public    | http://controller:8778      |
| 3427fe37f3564252bffe0ee2f6bc766c | RegionOne | nova         | compute      | True    | admin     | http://controller:8774/v2.1 |
| 358ccfc245264b60a9d1a0c113dfa628 | RegionOne | glance       | image        | True    | public    | http://controller:9292      |
| 3bd05493999b462eb4b4af8d5e5c1fa9 | RegionOne | keystone     | identity     | True    | admin     | http://controller:5000/v3   |
| 5293ad18db674ea1b01d8f401cb2cf14 | RegionOne | keystone     | identity     | True    | public    | http://controller:5000/v3   |
| 6593f8d808094b01a6311828f2ef72bd | RegionOne | keystone     | identity     | True    | internal  | http://controller:5000/v3   |
| 6ddf51b6d9d8467e92cbf22c40e1ba1c | RegionOne | placement    | placement    | True    | admin     | http://controller:8778      |
| 7524a1aa1c6f4c21ac4917c1865667f3 | RegionOne | nova         | compute      | True    | public    | http://controller:8774/v2.1 |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
[root@node01 ~]# 

  提示:如果在端點串列中有3個nova和3個placement的端點,分別對應public、internal和admin介面,說明我們配置nova和placement服務端端點注冊沒有問題;

  安裝nova服務組件包

[root@node01 ~]# yum install openstack-nova-api openstack-nova-conductor \
>   openstack-nova-console openstack-nova-novncproxy \
>   openstack-nova-scheduler openstack-nova-placement-api
Loaded plugins: fastestmirror
base                                                                                                   | 3.6 kB  00:00:00     
centos-ceph-luminous                                                                                   | 3.0 kB  00:00:00     
centos-openstack-rocky                                                                                 | 3.0 kB  00:00:00     
centos-qemu-ev                                                                                         | 3.0 kB  00:00:00     
epel                                                                                                   | 4.7 kB  00:00:00     
extras                                                                                                 | 2.9 kB  00:00:00     
updates                                                                                                | 2.9 kB  00:00:00     
(1/2): epel/x86_64/updateinfo                                                                          | 1.0 MB  00:00:00     
(2/2): epel/x86_64/primary_db                                                                          | 6.9 MB  00:00:00     
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * centos-qemu-ev: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package openstack-nova-api.noarch 1:18.3.0-1.el7 will be installed
--> Processing Dependency: openstack-nova-common = 1:18.3.0-1.el7 for package: 1:openstack-nova-api-18.3.0-1.el7.noarch
---> Package openstack-nova-conductor.noarch 1:18.3.0-1.el7 will be installed
---> Package openstack-nova-console.noarch 1:18.3.0-1.el7 will be installed
--> Processing Dependency: python-websockify >= 0.8.0 for package: 1:openstack-nova-console-18.3.0-1.el7.noarch
---> Package openstack-nova-novncproxy.noarch 1:18.3.0-1.el7 will be installed
……省略部分內容……
Installed:
  openstack-nova-api.noarch 1:18.3.0-1.el7                        openstack-nova-conductor.noarch 1:18.3.0-1.el7              
  openstack-nova-console.noarch 1:18.3.0-1.el7                    openstack-nova-novncproxy.noarch 1:18.3.0-1.el7             
  openstack-nova-placement-api.noarch 1:18.3.0-1.el7              openstack-nova-scheduler.noarch 1:18.3.0-1.el7              

Dependency Installed:
  novnc.noarch 0:0.5.1-2.el7                                      openstack-nova-common.noarch 1:18.3.0-1.el7                
  python-kazoo.noarch 0:2.2.1-1.el7                               python-nova.noarch 1:18.3.0-1.el7                          
  python-oslo-versionedobjects-lang.noarch 0:1.33.3-1.el7         python-paramiko.noarch 0:2.1.1-9.el7                       
  python-websockify.noarch 0:0.8.0-1.el7                          python2-microversion-parse.noarch 0:0.2.1-1.el7            
  python2-os-traits.noarch 0:0.9.0-1.el7                          python2-os-vif.noarch 0:1.11.2-1.el7                       
  python2-oslo-reports.noarch 0:1.28.0-1.el7                      python2-oslo-versionedobjects.noarch 0:1.33.3-1.el7        
  python2-psutil.x86_64 0:5.6.7-1.el7                             python2-pyroute2.noarch 0:0.5.2-4.el7                      
  python2-redis.noarch 0:2.10.6-1.el7                             python2-tooz.noarch 0:1.62.1-1.el7                         
  python2-voluptuous.noarch 0:0.11.5-1.el7.1                      python2-zake.noarch 0:0.2.2-2.el7                          

Complete!
[root@node01 ~]# 

  編輯配置/etc/nova/nova.conf檔案,在【DEFAULT】配置段配置僅啟用計算和元資料api和rabbitmq地址資訊

  在【api_daabase】配置段配置連接nova_api資料庫相關資訊

  在【database】配置段配置連接nova資料庫的相關資訊

  在【placement_database】配置段配置連接placlement資料庫相關資訊

  在【api】配置段配置使用keystone驗證

  在【keystone_authtoken】配置段配置keystone相關資訊

  在【DEFAULT】配置段配置支持使用neutron以及相關驅動

  在【vnc】配置段配置啟用vnc,并設定vnc監聽地址和客戶端代理使用的ip地址,這里都用controller的決議地址即可;

  在【glance】配置段配置連接glance的地址

  在【oslo_concurrency】配置段配置鎖檔案存放路徑

  在【placement】配置段配置plancement api服務相關資訊

  /etc/nova/nova.conf最終配置

[root@node01 ~]# grep -i ^"[a-z\[]" /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:openstack123@node02
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy = keystone
[api_database]
connection = mysql+pymysql://nova:nova123@node02/nova_api
[barbican]
[cache]
[cells]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[database]
connection = mysql+pymysql://nova:nova123@node02/nova
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers = http://controller:9292
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
auth_url = http://controller:5000/v3
memcached_servers = node02:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = nova
[libvirt]
[matchmaker_redis]
[metrics]
[mks]
[neutron]
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
username = placement
password = placement
[placement_database]
connection = mysql+pymysql://placement:nova123@node02/placement
[powervm]
[profiler]
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[upgrade_levels]
[vault]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled = true
server_listen = controller
server_proxyclient_address = controller
[workarounds]
[wsgi]
[xenserver]
[xvp]
[zvm]
[root@node01 ~]# 

  編輯/etc/httpd/conf.d/00-nova-placement-api.conf組態檔,添加對placement api 的訪問控制,在組態檔末尾添加

<Directory /usr/bin>
   <IfVersion >= 2.4>
      Require all granted
   </IfVersion>
   <IfVersion < 2.4>
      Order allow,deny
      Allow from all
   </IfVersion>
</Directory>

  重啟httpd

  提示:重啟httpd服務后,確保5000和8778埠能夠正常監聽;

  初始化資料庫

  初始化nova_api資料庫和placement資料庫

[root@node01 ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
[root@node01 ~]# 

  驗證:查看nova-api庫和placement庫是否有表生成?

MariaDB [(none)]> use nova_api
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [nova_api]> show tables;
+------------------------------+
| Tables_in_nova_api           |
+------------------------------+
| aggregate_hosts              |
| aggregate_metadata           |
| aggregates                   |
| allocations                  |
| build_requests               |
| cell_mappings                |
| consumers                    |
| flavor_extra_specs           |
| flavor_projects              |
| flavors                      |
| host_mappings                |
| instance_group_member        |
| instance_group_policy        |
| instance_groups              |
| instance_mappings            |
| inventories                  |
| key_pairs                    |
| migrate_version              |
| placement_aggregates         |
| project_user_quotas          |
| projects                     |
| quota_classes                |
| quota_usages                 |
| quotas                       |
| request_specs                |
| reservations                 |
| resource_classes             |
| resource_provider_aggregates |
| resource_provider_traits     |
| resource_providers           |
| traits                       |
| users                        |
+------------------------------+
32 rows in set (0.00 sec)

MariaDB [nova_api]> use placement
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [placement]> show tables;
+------------------------------+
| Tables_in_placement          |
+------------------------------+
| aggregate_hosts              |
| aggregate_metadata           |
| aggregates                   |
| allocations                  |
| build_requests               |
| cell_mappings                |
| consumers                    |
| flavor_extra_specs           |
| flavor_projects              |
| flavors                      |
| host_mappings                |
| instance_group_member        |
| instance_group_policy        |
| instance_groups              |
| instance_mappings            |
| inventories                  |
| key_pairs                    |
| migrate_version              |
| placement_aggregates         |
| project_user_quotas          |
| projects                     |
| quota_classes                |
| quota_usages                 |
| quotas                       |
| request_specs                |
| reservations                 |
| resource_classes             |
| resource_provider_aggregates |
| resource_provider_traits     |
| resource_providers           |
| traits                       |
| users                        |
+------------------------------+
32 rows in set (0.00 sec)

MariaDB [placement]> 

  注冊cell0

[root@node01 ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
[root@node01 ~]# 

  創建cell1

[root@node01 ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
2ad18452-0e55-4505-ba5e-76cbf071b0d6
[root@node01 ~]# 

  驗證cell0和cell1是否注冊正確

[root@node01 ~]# su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
+-------+--------------------------------------+--------------------------------+---------------------------------------------+----------+
|  Name |                 UUID                 |         Transport URL          |             Database Connection             | Disabled |
+-------+--------------------------------------+--------------------------------+---------------------------------------------+----------+
| cell0 | 00000000-0000-0000-0000-000000000000 |             none:/             | mysql+pymysql://nova:****@node02/nova_cell0 |  False   |
| cell1 | 2ad18452-0e55-4505-ba5e-76cbf071b0d6 | rabbit://openstack:****@node02 |    mysql+pymysql://nova:****@node02/nova    |  False   |
+-------+--------------------------------------+--------------------------------+---------------------------------------------+----------+
[root@node01 ~]#

  提示:能夠看到以上資訊就表示cell0和cell1注冊沒有問題;

  初始化nova資料庫

[root@node01 ~]# su -s /bin/sh -c "nova-manage db sync" nova
/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u'Duplicate index `block_device_mapping_instance_uuid_virtual_name_device_name_idx`. This is deprecated and will be disallowed in a future release.')
  result = self._query(query)
/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u'Duplicate index `uniq_instances0uuid`. This is deprecated and will be disallowed in a future release.')
  result = self._query(query)
[root@node01 ~]# 

  提示:這里提示兩個警告資訊,說兩個指令在未來的版本中不允許這樣使用;我們可以忽略這些警告資訊;

  驗證:查看nova資料庫中是否有表生成?

MariaDB [placement]> use nova
Database changed
MariaDB [nova]> show tables;
+--------------------------------------------+
| Tables_in_nova                             |
+--------------------------------------------+
| agent_builds                               |
| aggregate_hosts                            |
| aggregate_metadata                         |
| aggregates                                 |
| allocations                                |
| block_device_mapping                       |
| bw_usage_cache                             |
| cells                                      |
| certificates                               |
| compute_nodes                              |
| console_auth_tokens                        |
| console_pools                              |
| consoles                                   |
| dns_domains                                |
| fixed_ips                                  |
| floating_ips                               |
| instance_actions                           |
| instance_actions_events                    |
| instance_extra                             |
| instance_faults                            |
| instance_group_member                      |
| instance_group_policy                      |
| instance_groups                            |
| instance_id_mappings                       |
| instance_info_caches                       |
| instance_metadata                          |
| instance_system_metadata                   |
| instance_type_extra_specs                  |
| instance_type_projects                     |
| instance_types                             |
| instances                                  |
| inventories                                |
| key_pairs                                  |
| migrate_version                            |
| migrations                                 |
| networks                                   |
| pci_devices                                |
| project_user_quotas                        |
| provider_fw_rules                          |
| quota_classes                              |
| quota_usages                               |
| quotas                                     |
| reservations                               |
| resource_provider_aggregates               |
| resource_providers                         |
| s3_images                                  |
| security_group_default_rules               |
| security_group_instance_association        |
| security_group_rules                       |
| security_groups                            |
| services                                   |
| shadow_agent_builds                        |
| shadow_aggregate_hosts                     |
| shadow_aggregate_metadata                  |
| shadow_aggregates                          |
| shadow_block_device_mapping                |
| shadow_bw_usage_cache                      |
| shadow_cells                               |
| shadow_certificates                        |
| shadow_compute_nodes                       |
| shadow_console_pools                       |
| shadow_consoles                            |
| shadow_dns_domains                         |
| shadow_fixed_ips                           |
| shadow_floating_ips                        |
| shadow_instance_actions                    |
| shadow_instance_actions_events             |
| shadow_instance_extra                      |
| shadow_instance_faults                     |
| shadow_instance_group_member               |
| shadow_instance_group_policy               |
| shadow_instance_groups                     |
| shadow_instance_id_mappings                |
| shadow_instance_info_caches                |
| shadow_instance_metadata                   |
| shadow_instance_system_metadata            |
| shadow_instance_type_extra_specs           |
| shadow_instance_type_projects              |
| shadow_instance_types                      |
| shadow_instances                           |
| shadow_key_pairs                           |
| shadow_migrate_version                     |
| shadow_migrations                          |
| shadow_networks                            |
| shadow_pci_devices                         |
| shadow_project_user_quotas                 |
| shadow_provider_fw_rules                   |
| shadow_quota_classes                       |
| shadow_quota_usages                        |
| shadow_quotas                              |
| shadow_reservations                        |
| shadow_s3_images                           |
| shadow_security_group_default_rules        |
| shadow_security_group_instance_association |
| shadow_security_group_rules                |
| shadow_security_groups                     |
| shadow_services                            |
| shadow_snapshot_id_mappings                |
| shadow_snapshots                           |
| shadow_task_log                            |
| shadow_virtual_interfaces                  |
| shadow_volume_id_mappings                  |
| shadow_volume_usage_cache                  |
| snapshot_id_mappings                       |
| snapshots                                  |
| tags                                       |
| task_log                                   |
| virtual_interfaces                         |
| volume_id_mappings                         |
| volume_usage_cache                         |
+--------------------------------------------+
110 rows in set (0.00 sec)

MariaDB [nova]> 

  提示:可以看到nova資料庫中生成了很多張表,說明初始nova資料庫沒有問題;

  啟動nova相關服務,并將其設定為開機啟動

[root@node01 ~]# systemctl start openstack-nova-api.service \
>   openstack-nova-consoleauth openstack-nova-scheduler.service \
>   openstack-nova-conductor.service openstack-nova-novncproxy.service
[root@node01 ~]# systemctl enable openstack-nova-api.service \
>   openstack-nova-consoleauth openstack-nova-scheduler.service \
>   openstack-nova-conductor.service openstack-nova-novncproxy.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-api.service to /usr/lib/systemd/system/openstack-nova-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-consoleauth.service to /usr/lib/systemd/system/openstack-nova-consoleauth.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-scheduler.service to /usr/lib/systemd/system/openstack-nova-scheduler.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-conductor.service to /usr/lib/systemd/system/openstack-nova-conductor.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-novncproxy.service to /usr/lib/systemd/system/openstack-nova-novncproxy.service.
[root@node01 ~]#

  驗證對應服務的埠是否處于監聽狀態?

  提示:6080是nova-novncproxy服務所監聽的埠;8774和8775是nova-api所監聽的埠;8778是placement服務所監聽的埠;如果能夠看到這四個埠啟動起來了,說明在控制節點的nova服務配置就沒有什么問題;

  到此nova服務在控制節點上就安裝配置完畢

  3、在計算節點上安裝配置nova服務

  安裝nova-compute包

[root@node03 ~]# yum install openstack-nova-compute -y

  編輯/etc/nova/nova.conf組態檔,在【DEFAULT】配置段配置僅啟用計算和元資料api和rabbitmq地址資訊

  在【api】配置段配置使用keystone服務進行驗證

  在【keystone_authtoken】配置段配置keystone服務相關資訊

  在【DEFAULT】配置段配置支持使用neutron以及相關驅動

  在【vnc】配置段配置啟用vpn,以及vncserver的地址和novncproxy的介面地址

  提示:server_proxyclient_address這個可以寫ip地址或者主機名,如果是主機名請將其決議到對應計算節點的ip上;

  在【glance】配置段配置連接glance服務端相關資訊

  在【oslo_concurrency】配置段配置鎖檔案存放路徑

  在【placement】配置段配置placement服務相關資訊

  驗證計算節點是否支持硬體虛擬化

[root@node03 ~]# egrep -c '(vmx|svm)' /proc/cpuinfo
0
[root@node03 ~]# 

  提示:如果以上命令運行回傳0,表示該計算節點不支持硬體虛擬化,如果回傳非0,表示該計算節點支持硬體虛擬化;如果計算節點支持硬體虛擬化,到此計算節點上的nova配置就完成了;如果不支持硬體虛擬化,我們需要在【libvirt】配置段明確指明使用的virt_type為qemu,而不是kvm;

  在【libvirt】配置段明確指明使用qemu

  nova.conf最終配置

[root@node03 ~]# grep -i ^"[a-z\[]" /etc/nova/nova.conf               
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:openstack123@node02
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy = keystone
[api_database]
[barbican]
[cache]
[cells]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[database]
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers = http://controller:9292
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
auth_url = http://controller:5000/v3
memcached_servers = node02:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = nova
[libvirt]
virt_type = qemu
[matchmaker_redis]
[metrics]
[mks]
[neutron]
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
username = placement
password = placement
[placement_database]
[powervm]
[profiler]
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[upgrade_levels]
[vault]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled = true
server_listen = 0.0.0.0
server_proxyclient_address = node03
novncproxy_base_url = http://controller:6080/vnc_auto.html
[workarounds]
[wsgi]
[xenserver]
[xvp]
[zvm]
[root@node03 ~]# 

  啟動nova-compute和libvirtd服務,并將其設定為開機啟動

[root@node03 ~]# systemctl start libvirtd.service openstack-nova-compute.service
[root@node03 ~]# systemctl enable libvirtd.service openstack-nova-compute.service     
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service to /usr/lib/systemd/system/openstack-nova-compute.service.
[root@node03 ~]# 

  在控制節點上匯出admin用戶的環境變數,將計算節點資訊添加到cell資料庫中

[root@node01 ~]# source admin.sh 
[root@node01 ~]# openstack compute service list --service nova-compute
+----+--------------+-----------------+------+---------+-------+----------------------------+
| ID | Binary       | Host            | Zone | Status  | State | Updated At                 |
+----+--------------+-----------------+------+---------+-------+----------------------------+
|  9 | nova-compute | node03.test.org | nova | enabled | up    | 2020-10-29T16:46:34.000000 |
+----+--------------+-----------------+------+---------+-------+----------------------------+
[root@node01 ~]# 

  手動掃描發現計算節點

[root@node01 ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': 2ad18452-0e55-4505-ba5e-76cbf071b0d6
Checking host mapping for compute host 'node03.test.org': 24beeca9-7c6e-4025-ada4-f6cfffb89b5d
Creating host mapping for compute host 'node03.test.org': 24beeca9-7c6e-4025-ada4-f6cfffb89b5d
Found 1 unmapped computes in cell: 2ad18452-0e55-4505-ba5e-76cbf071b0d6
[root@node01 ~]# 

  設定自動發現計算節點,并自動完成計算節點注冊的間隔時間

  提示:這個配置要在控制節點的nova.conf中配置,上述配置表示每隔300秒自動掃描一下有沒有新的計算節點加入;

  到此,計算節點上的nova服務就安裝配置完成了

  驗證:在控制節點匯出admin用戶的環境變數,列出服務組件,驗證每個流程的成功啟動和注冊

[root@node01 ~]# source admin.sh 
[root@node01 ~]# openstack compute service list 
+----+------------------+-----------------+----------+---------+-------+----------------------------+
| ID | Binary           | Host            | Zone     | Status  | State | Updated At                 |
+----+------------------+-----------------+----------+---------+-------+----------------------------+
|  1 | nova-consoleauth | node01.test.org | internal | enabled | up    | 2020-10-29T16:57:33.000000 |
|  2 | nova-scheduler   | node01.test.org | internal | enabled | up    | 2020-10-29T16:57:33.000000 |
|  6 | nova-conductor   | node01.test.org | internal | enabled | up    | 2020-10-29T16:57:34.000000 |
|  9 | nova-compute     | node03.test.org | nova     | enabled | up    | 2020-10-29T16:57:34.000000 |
+----+------------------+-----------------+----------+---------+-------+----------------------------+
[root@node01 ~]# 

  提示:能夠看到controller節點上啟用的三個服務組件和compute節點上啟用的一個服務組件,能夠看到上述資訊,表示nova服務作業正常;

  驗證:列出通過keystone驗證的API端點

[root@node01 ~]# openstack catalog list
+-----------+-----------+-----------------------------------------+
| Name      | Type      | Endpoints                               |
+-----------+-----------+-----------------------------------------+
| nova      | compute   | RegionOne                               |
|           |           |   internal: http://controller:8774/v2.1 |
|           |           | RegionOne                               |
|           |           |   admin: http://controller:8774/v2.1    |
|           |           | RegionOne                               |
|           |           |   public: http://controller:8774/v2.1   |
|           |           |                                         |
| keystone  | identity  | RegionOne                               |
|           |           |   admin: http://controller:5000/v3      |
|           |           | RegionOne                               |
|           |           |   public: http://controller:5000/v3     |
|           |           | RegionOne                               |
|           |           |   internal: http://controller:5000/v3   |
|           |           |                                         |
| glance    | image     | RegionOne                               |
|           |           |   admin: http://controller:9292         |
|           |           | RegionOne                               |
|           |           |   internal: http://controller:9292      |
|           |           | RegionOne                               |
|           |           |   public: http://controller:9292        |
|           |           |                                         |
| placement | placement | RegionOne                               |
|           |           |   internal: http://controller:8778      |
|           |           | RegionOne                               |
|           |           |   public: http://controller:8778        |
|           |           | RegionOne                               |
|           |           |   admin: http://controller:8778         |
|           |           |                                         |
+-----------+-----------+-----------------------------------------+
[root@node01 ~]# 

  驗證:檢查cell和placement是否作業正常

[root@node01 ~]# nova-status upgrade check
+--------------------------------+
| Upgrade Check Results          |
+--------------------------------+
| Check: Cells v2                |
| Result: Success                |
| Details: None                  |
+--------------------------------+
| Check: Placement API           |
| Result: Success                |
| Details: None                  |
+--------------------------------+
| Check: Resource Providers      |
| Result: Success                |
| Details: None                  |
+--------------------------------+
| Check: Ironic Flavor Migration |
| Result: Success                |
| Details: None                  |
+--------------------------------+
| Check: API Service Version     |
| Result: Success                |
| Details: None                  |
+--------------------------------+
| Check: Request Spec Migration  |
| Result: Success                |
| Details: None                  |
+--------------------------------+
| Check: Console Auths           |
| Result: Success                |
| Details: None                  |
+--------------------------------+
[root@node01 ~]# 

  提示:這個檢查必須要全部都是成功的才沒有問題;到此nova服務的安裝配置和測驗就完了;后續我們還差一個neutron網路服務,就可以在openstack上啟動虛擬機了;

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/195881.html

標籤:其他

上一篇:干貨分享:Windows資源管理器無限重啟?解決方法竟然是…

下一篇:iptables_表和鏈(Traversing of tables and chains)

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • CA和證書

    1、在 CentOS7 中使用 gpg 創建 RSA 非對稱密鑰對 gpg --gen-key #Centos上生成公鑰/密鑰對(存放在家目錄.gnupg/) 2、將 CentOS7 匯出的公鑰,拷貝到 CentOS8 中,在 CentOS8 中使用 CentOS7 的公鑰加密一個檔案 gpg -a ......

    uj5u.com 2020-09-10 00:09:53 more
  • Kubernetes K8S之資源控制器Job和CronJob詳解

    Kubernetes的資源控制器Job和CronJob詳解與示例 ......

    uj5u.com 2020-09-10 00:10:45 more
  • VMware下安裝CentOS

    VMware下安裝CentOS 一、軟硬體準備 1 Centos鏡像準備 1.1 CentOS鏡像下載地址 下載地址 1.2 CentOS鏡像下載程序 點擊下載地址進入如下圖的網站,選擇需要下載的版本,這里選擇的是Centos8,點擊如圖所示。 決定選擇Centos8后,選擇想要的鏡像源進行下載,此 ......

    uj5u.com 2020-09-10 00:12:10 more
  • 如何使用Grep命令查找多個字串

    如何使用Grep 命令查找多個字串 大家好,我是良許! 今天向大家介紹一個非常有用的技巧,那就是使用 grep 命令查找多個字串。 簡單介紹一下,grep 命令可以理解為是一個功能強大的命令列工具,可以用它在一個或多個輸入檔案中搜索與正則運算式相匹配的文本,然后再將每個匹配的文本用標準輸出的格式 ......

    uj5u.com 2020-09-10 00:12:28 more
  • git配置http代理

    git配置http代理 經常遇到克隆 github 慢的問題,這里記錄一下幾種配置 git 代理的方法,解決 clone github 過慢。 目錄 git配置代理 git單獨配置github代理 git配置全域代理 配置終端環境變數 git配置代理 主要使用 git config 命令 git單獨 ......

    uj5u.com 2020-09-10 00:12:33 more
  • Linux npm install 裝包時提示Error EACCES permission denied解

    npm install 裝包時提示Error EACCES permission denied解決辦法 ......

    uj5u.com 2020-09-10 00:12:53 more
  • Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟體包

    Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟體包。 18 (flaskApi) [root@67 flaskDemo]# yum -y install nginx 19 已加載插件:fastestmirror, langpacks 20 Loading ......

    uj5u.com 2020-09-10 00:13:13 more
  • Linux查看服務器暴力破解ssh IP

    在公網的服務器上經常遇到別人爆破你服務器的22埠,用來挖礦或者干其他嘿嘿嘿的事情~ 這種情況下正確的做法是: 修改默認ssh的22埠 使用設定密鑰登錄或者白名單ip登錄 建議服務器密碼為復雜密碼 創建普通用戶登錄服務器(root權限過大) 建立堡壘機,實作統一管理服務器 統計爆破IP [root ......

    uj5u.com 2020-09-10 00:13:17 more
  • CentOS 7系統常見快捷鍵操作方式

    Linux系統中一些常見的快捷方式,可有效提高操作效率,在某些時刻也能避免操作失誤帶來的問題。 ......

    uj5u.com 2020-09-10 00:13:31 more
  • CentOS 7作業系統目錄結構介紹

    作業系統存在著大量的資料檔案資訊,相應檔案資訊會存在于系統相應目錄中,為了更好的管理資料資訊,會將系統進行一些目錄規劃,不同目錄存放不同的資源。 ......

    uj5u.com 2020-09-10 00:13:35 more
最新发布
  • vim的常用命令

    Vim的6種基本模式 1. 普通模式在普通模式中,用的編輯器命令,比如移動游標,洗掉文本等等。這也是Vim啟動后的默認模式。這正好和許多新用戶期待的操作方式相反(大多數編輯器默認模式為插入模式)。 2. 插入模式在這個模式中,大多數按鍵都會向文本緩沖中插入文本。大多數新用戶希望文本編輯器編輯程序中一 ......

    uj5u.com 2023-04-20 08:43:21 more
  • vim的常用命令

    Vim的6種基本模式 1. 普通模式在普通模式中,用的編輯器命令,比如移動游標,洗掉文本等等。這也是Vim啟動后的默認模式。這正好和許多新用戶期待的操作方式相反(大多數編輯器默認模式為插入模式)。 2. 插入模式在這個模式中,大多數按鍵都會向文本緩沖中插入文本。大多數新用戶希望文本編輯器編輯程序中一 ......

    uj5u.com 2023-04-20 08:42:36 more
  • docker學習

    ###Docker概述 真實專案部署環境可能非常復雜,傳統發布專案一個只需要一個jar包,運行環境需要單獨部署。而通過Docker可將jar包和相關環境(如jdk,redis,Hadoop...)等打包到docker鏡像里,將鏡像發布到Docker倉庫,部署時下載發布的鏡像,直接運行發布的鏡像即可。 ......

    uj5u.com 2023-04-19 09:26:53 more
  • 設定Windows主機的瀏覽器為wls2的默認瀏覽器

    這里以Chrome為例。 1. 準備作業 wsl是可以使用Windows主機上安裝的exe程式,出于安全考慮,默認情況下改功能是無法使用。要使用的話,終端需要以管理員權限啟動。 我這里以Windows Terminal為例,介紹如何默認使用管理員權限打開終端,具體操作如下圖所示: 2. 操作 wsl ......

    uj5u.com 2023-04-19 09:25:49 more
  • docker學習

    ###Docker概述 真實專案部署環境可能非常復雜,傳統發布專案一個只需要一個jar包,運行環境需要單獨部署。而通過Docker可將jar包和相關環境(如jdk,redis,Hadoop...)等打包到docker鏡像里,將鏡像發布到Docker倉庫,部署時下載發布的鏡像,直接運行發布的鏡像即可。 ......

    uj5u.com 2023-04-19 09:19:04 more
  • Linux學習筆記

    IP地址和主機名 IP地址 ifconfig可以用來查詢本機的IP地址,如果不能使用,可以通過install net-tools安裝。 Centos系統下ens33表示主網卡;inet后表示IP地址;lo表示本地回環網卡; 127.0.0.1表示代指本機;0.0.0.0可以用于代指本機,同時在放行設 ......

    uj5u.com 2023-04-18 06:52:01 more
  • 解決linux系統的kdump服務無法啟動的問題

    問題:專案麒麟系統服務器的kdump服務無法啟動,沒有相關日志無法定位問題。 1、查看服務狀態是關閉的,重啟系統也無法啟動 systemctl status kdump 2、修改grub引數,修改“crashkernel”為“512M(有的機器數值太大太小都會導致報錯,建議從128M開始試,或者加個 ......

    uj5u.com 2023-04-12 09:59:50 more
  • 解決linux系統的kdump服務無法啟動的問題

    問題:專案麒麟系統服務器的kdump服務無法啟動,沒有相關日志無法定位問題。 1、查看服務狀態是關閉的,重啟系統也無法啟動 systemctl status kdump 2、修改grub引數,修改“crashkernel”為“512M(有的機器數值太大太小都會導致報錯,建議從128M開始試,或者加個 ......

    uj5u.com 2023-04-12 09:59:01 more
  • 你是不是暴露了?

    作者:袁首京 原創文章,轉載時請保留此宣告,并給出原文連接。 如果您是計算機相關從業人員,那么應該經歷不止一次網路安全專項檢查了,你肯定是收到過資訊系統技術檢測報告,要求你加強風險監測,確保你提供的系統服務堅實可靠了。 沒檢測到問題還好,檢測到問題的話,有些處理起來還是挺麻煩的,尤其是線上正在運行的 ......

    uj5u.com 2023-04-05 16:52:56 more
  • 細節拉滿,80 張圖帶你一步一步推演 slab 記憶體池的設計與實作

    1. 前文回顧 在之前的幾篇記憶體管理系列文章中,筆者帶大家從宏觀角度完整地梳理了一遍 Linux 記憶體分配的整個鏈路,本文的主題依然是記憶體分配,這一次我們會從微觀的角度來探秘一下 Linux 內核中用于零散小記憶體塊分配的記憶體池 —— slab 分配器。 在本小節中,筆者還是按照以往的風格先帶大家簡單 ......

    uj5u.com 2023-04-05 16:44:11 more