Openstack 实战讲解之-----06-计算节点配置

本文介绍了如何在 CentOS 上安装 OpenStack Nova 控制节点和服务软件包的过程,包括解决安装过程中遇到的问题,如下载错误等。同时展示了如何配置 Nova 计算节点,并验证其服务状态。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

控制节点服务状态

[root@linux-node1 ~]# nova service-list
+----+------------------+-------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host        | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+-------------+----------+---------+-------+----------------------------+-----------------+
| 3  | nova-consoleauth | linux-node1 | internal | enabled | up    | 2017-01-02T07:33: | -               |
| 4  | nova-conductor   | linux-node1 | internal | enabled | up    | 2017-01-02T07:33: | -               |
| 5  | nova-scheduler   | linux-node1 | internal | enabled | up    | 2017-01-02T07:33: | -               |
+----+------------------+-------------+----------+---------+-------+----------------------------+-----------------+

二 安装服务软件包

安装库包

1.
安装仓库:
yum install -y centos-release-openstack-newton
修改 
openstack 
源的地址为阿里云的地址(提高 
yum 
下载的速度)
sed -i "s###g"
/etc//CentOS-OpenStack-
2.
安装 
OpenStack 
客户端:
yum install -y python-openstackclient
yum install -y openstack-selinux
rpm -qa python-openstackclient openstack-selinux

安装服务软件包

yum install openstack-nova-compute

安装报错

Error downloading packages:
  1:librados2--_64: [Errno 256] No more mirrors to try.

解放方法:

[root@linux-node2 ]# cat CentOS-Ceph- 
# CentOS-Ceph-
#
# Please see /SpecialInterestGroup/Storage for more
# information
[centos-ceph-jewel]
name=CentOS-$releasever - Ceph Jewel
baseurl=/centos/$releasever/storage/$basearch/ceph-jewel/
gpgcheck=0 #这里全部改成0
enabled=0 #这里全部改成0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage

也可以从下面的链接下载包来安装

/Linux/centos/7/storage/x86_64/ceph-jewel/

修改配置文件

这里很多配置和node1上面的nova配置文件一样,所以我们先把node1上面的配置文件拷贝过来,然后再修改配置,具体执行过程如下:

[root@linux-node1 ]# scp /etc/nova/ :/etc/nova/
root@'s password: 
   
查看权限是否正确
[root@linux-node2 ~]# ll /etc/nova/ 
-rw-r----- 1 root nova 290129 Dec 25 10:32 /etc/nova/
修改配置文件
[root@linux-node2 ~]# vi /etc/nova/ 
    删除2行mysql的配置文件
connection=mysql+pymysql://nova:nova@/nova_api
connection=mysql+pymysql://nova:nova@/nova
全部的配置如下:
[root@linux-node2 nova]# grep -n '^[a-z]' 
2:transport_url=rabbit://openstack:openstack@
15:auth_strategy=keystone
2063:use_neutron=True
3053:enabled_apis=osapi_compute,metadata
3267:firewall_driver = 
4813:api_servers=:9292
5430:auth_uri = :5000
5431:auth_url = :35357
5432:memcached_servers = :11211
5433:auth_type = password
5434:project_domain_name = default
5435:user_domain_name = default
5436:project_name = service
5437:username = nova
5438:password = nova
6470:url = :9696
6471:auth_url = :35357
6472:auth_type = password
6473:project_domain_name = default
6474:user_domain_name = default
6475:region_name = RegionOne
6476:project_name = service
6477:username = neutron
6478:password = neutron
6479:service_metadata_proxy = True
6480:metadata_proxy_shared_secret = oldboy
6716:lock_path=/var/lib/nova/tmp
6895:transport_url=rabbit://openstack:openstack@
8372:enabled=true
8388:keymap=en-us
8395:vncserver_listen=
8407:vncserver_proxyclient_address=
8426:novncproxy_base_url=:6080/vnc_

虚拟机支持查看

[root@linux-node2 nova]# egrep -c '(vmx|svm)' /proc/cpuinfo 
2

如果不支持,则显示为0 ,可以修改配置文件

5672行  #virt_type=kvm

启动计算服务及其依赖,并将其配置为随系统自动启动

[root@linux-node2 nova]# systemctl enable  openstack-nova-
Created symlink from /etc/systemd/system/multi-/openstack-nova- to /usr/lib/systemd/system/openstack-nova-.
[root@linux-node2 nova]# systemctl start  openstack-nova-

检查启动状态

[root@linux-node2 nova]# ps aux|grep nova
nova      20997     1661660 130900 ?      Ssl  14:18   3:13 /usr/bin/python2 /usr/binnova-compute

在node1上检查状态

[root@linux-node1 ~]# . admin-openstack 
[root@linux-node1 ~]# nova service-list
+----+------------------+-------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host        | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+-------------+----------+---------+-------+----------------------------+-----------------+
| 3  | nova-consoleauth | linux-node1 | internal | enabled | up    | 2017-01-02T13:41: | -               |
| 4  | nova-conductor   | linux-node1 | internal | enabled | up    | 2017-01-02T13:41: | -               |
| 5  | nova-scheduler   | linux-node1 | internal | enabled | up    | 2017-01-02T13:41: | -               |
| 6  | nova-compute     | linux-node2 | nova     | enabled | up    | 2017-01-02T13:41: | -               |
+----+------------------+-------------+----------+---------+-------+----------------------------+-----------------+
[root@linux-node1 ~]# openstack compute service list
+----+------------------+-------------+----------+---------+-------+----------------------------+
| ID | Binary           | Host        | Zone     | Status  | State | Updated At                 |
+----+------------------+-------------+----------+---------+-------+----------------------------+
|  3 | nova-consoleauth | linux-node1 | internal | enabled | up    | 2017-01-02T13:42: |
|  4 | nova-conductor   | linux-node1 | internal | enabled | up    | 2017-01-02T13:42: |
|  5 | nova-scheduler   | linux-node1 | internal | enabled | up    | 2017-01-02T13:42: |
|  6 | nova-compute     | linux-node2 | nova     | enabled | up    | 2017-01-02T13:42: |
+----+------------------+-------------+----------+---------+-------+----------------------------+


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值