那些年踩过的坑之Ubuntu openstack搭建

搭建文档参考官网教程:
https://docs.openstack.org/install-guide/

  • 访问controller/horizon出错500:internal server error; 访问controller/horizon出错504:internal server error  gateway timeout

        WSGIApplicationGroup %{GLOBAL}

        把上面这行添加到/etc/apache2/conf-available/openstack-dashboard.conf

  • 搭建apache2过程遇到35357没起来,更新/etc/apache2/sites-available/keystone.conf,添加35357配置部分

  1.         vim /etc/apache2/sites-available/keystone.conf
Listen 5000
Listen 35357
<VirtualHost *:5000>
    WSGIScriptAlias / /usr/bin/keystone-wsgi-public
    WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
    WSGIProcessGroup keystone-public
    WSGIApplicationGroup %{GLOBAL}
    WSGIPassAuthorization On
    LimitRequestBody 114688

    <IfVersion >= 2.4>
      ErrorLogFormat "%{cu}t %M"
    </IfVersion>

    ErrorLog /var/log/apache2/keystone.log
    CustomLog /var/log/apache2/keystone_access.log combined

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

<VirtualHost *:35357>
    WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
    WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
    WSGIProcessGroup keystone-admin
    WSGIApplicationGroup %{GLOBAL}
    WSGIPassAuthorization On
    LimitRequestBody 114688

    <IfVersion >= 2.4>
      ErrorLogFormat "%{cu}t %M"
    </IfVersion>

    ErrorLog /var/log/apache2/keystone.log
    CustomLog /var/log/apache2/keystone_access.log combined

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

Alias /identity /usr/bin/keystone-wsgi-public
<Location /identity>
    SetHandler wsgi-script
    Options +ExecCGI

    WSGIProcessGroup keystone-public
    WSGIApplicationGroup %{GLOBAL}
    WSGIPassAuthorization On
</Location>


Alias /identity-admin /usr/bin/keystone-wsgi-admin
<Location /identity-admin>
    SetHandler wsgi-script
    Options +ExecCGI

    WSGIProcessGroup keystone-admin
    WSGIApplicationGroup %{GLOBAL}
    WSGIPassAuthorization On
</Location>
  1.         重启服务

        service apache2 restart

  •  跑过一遍su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose " nova,但是发现有错误配置需要重跑时报错

        --transport-url not provided in the command line, using the value [DEFAULT]/transport_url from the configuration file

        --database_connection not provided in the command line, using the value [database]/connection from the configuration file

         方案1:带上对应更改的参数重跑

root@master01:/var/lib/glance/images# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose --transport-url rabbit://openstack:casa@master01:5672/ --database_connection mysql+pymysql://nova:casa@master01/nova_api" nova

a4b73290-01bb-4c48-b39d-8fff66cf264e

        方案2:删除错误的cells,重新添加

root@master01:/var/lib/glance/images# nova-manage cell_v2 list_cells
+-------+--------------------------------------+----------------------------------------+-----------------------------------------------+----------+
|  Name |                 UUID                 |             Transport URL              |              Database Connection              | Disabled |
+-------+--------------------------------------+----------------------------------------+-----------------------------------------------+----------+
| cell0 | 00000000-0000-0000-0000-000000000000 |                 none:/                 | mysql+pymysql://nova:****@master01/nova_cell0 |  False   |
| cell1 | 28a769cd-5ae1-4e96-b948-320c671f6fa3 |  rabbit://openstack:****@master:5672/  |    mysql+pymysql://nova:****@master01/nova    |  False   |

root@master01:/var/lib/glance/images# nova-manage cell_v2 delete_cell --cell_uuid 28a769cd-5ae1-4e96-b948-320c671f6fa3
  • 计算节点nova-compute报错

    ERROR nova.compute.manager [req-d31bb39b-74c5-4228-970e-b19625cfab85 - - - - -] Error updating resources for node node01.: FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3/dist-packages/instances'

        添加参数 instances_path=/var/lib/nova/instances 到以下配置文件

root@node01:/etc/nova# vim /etc/nova/nova.conf
[DEFAULT]
transport_url = rabbit://openstack:casa@master01:5672/
my_ip = 172.0.16.19
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
instances_path=/var/lib/nova/instances

        重启nova服务

service nova-api restart
service nova-consoleauth restart
service nova-scheduler restart
service nova-conductor restart
service nova-novncproxy restart
  • 当配置完计算节点后,在控制节点执行openstack compute service list返回空

    查看计算节点日志

    root@node01:/etc/nova# tail -f /var/log/nova/nova-compute.log -n 500
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager [req-f0f54490-8d3a-4680-9e55-70085f75468e - - - - -] Error updating resources for node node01.: nova.exception.ResourceProviderRetrievalFailed: Failed to get resource provider with UUID 47bd6a9e-6c0c-477e-b555-b449c7314ca6
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager Traceback (most recent call last):
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager   File "/usr/lib/python3/dist-packages/nova/compute/manager.py", line 9924, in _update_available_resource_for_node
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager     self.rt.update_available_resource(context, nodename,
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager   File "/usr/lib/python3/dist-packages/nova/compute/resource_tracker.py", line 896, in update_available_resource
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager     self._update_available_resource(context, resources, startup=startup)
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager   File "/usr/lib/python3/dist-packages/oslo_concurrency/lockutils.py", line 360, in inner
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager     return f(*args, **kwargs)
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager   File "/usr/lib/python3/dist-packages/nova/compute/resource_tracker.py", line 981, in _update_available_resource
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager     self._update(context, cn, startup=startup)
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager   File "/usr/lib/python3/dist-packages/nova/compute/resource_tracker.py", line 1233, in _update
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager     self._update_to_placement(context, compute_node, startup)
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager   File "/usr/lib/python3/dist-packages/retrying.py", line 49, in wrapped_f
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager     return Retrying(*dargs, **dkw).call(f, *args, **kw)
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager   File "/usr/lib/python3/dist-packages/retrying.py", line 206, in call
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager     return attempt.get(self._wrap_exception)
    2022-05-07 08:11:56.580 325486 ERROR nova.compute.manager   File "/usr/lib/python3/dis
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小吴在此

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值