OpenStack 最小化安装配置(七):Nova服务配置

来源:互联网 发布:有道翻译无网络连接 编辑:程序博客网 时间:2024/06/03 12:01

      搞定了镜像,认证服务,数据库,接下来就到了整个平台综合性的配置。就是Nova几乎跟所有组件都打交道了。Nova的IP为192.168.137.106 内部通信的IP 为192.168.1.106

首先要做的安装服务。

     安装脚本如下:

apt-get updateapt-get install -y nova-api nova-cert nova-common nova-conductor nova-consoleauth nova-novncproxy nova-scheduler \python-nova python-keystone python-glance python-mysqldb python-novaclient novnc

    一般的我们的服务器需要装上ntp服务器,用来时间同步。云平台管理节点的多个服务如果时间相差很大可能会导致无法相互间访问的现象。最好要装上ntp

apt-get install -y ntp

同步时间

ntpdate 210.72.145.44

平时如果服务间无法通信应该要想到可能是时间没有同步,相差太大造成。

好了接下来又是最讨厌的修改配置文件的时间.这个过程虽然难受不过成功了之后确实很爽。

首先需要修改的配置文件/etc/nova/api-paste.ini

添加认证身份信息。

[filter:authtoken]paste.filter_factory = keystoneclient.middleware.auth_token:filter_factoryauth_host = 192.168.1.104auth_port = 35357auth_protocol = httpadmin_tenant_name = serviceTenantadmin_user = novaadmin_password = Nova_Pass signing_dir = /tmp/keystone-signing-novaauth_version = v2.0

接下来修改/etc/nova/nova.conf配置文件。由于要修改的太多我直接附上我的配置文件。并加上注释

[DEFAULT]#debug=True#基本设置logdir = /var/log/novastate_path = /var/lib/novalock_path = /var/lib/nova/tmpverbose=Truelibvirt_type = kvm#volumes_dir = /etc/nova/volumes#iscsi_helper = tgtadm#connect to mysql #设置数据库连接可以访问数据库sql_connection = mysql://novaUser:novaPass@192.168.1.102:3306/nova#rpc_backend = nova.openstack.common.rpc.impl_qpidrootwrap_config = /etc/nova/rootwrap.conf#my_ip=192.168.137.104#instances_path=/state/partition1/openstack/instance#Image Service#用来管理镜像服务器glance_api_servers=192.168.1.105:9292image_server=nova.image.glance.GlanceImageService#RabbitMQ#通讯节点compute_scheduler_driver=nova.scheduler.filter_scheduler.FilterSchedulerrabbit_host=192.168.1.103rabbit_port=5672rabbit_userid=guestrabbit_password=myrabbitmqpasswordapi_paste_config=/etc/nova/api-paste.ini#NETWORK#网络节点dhcpbridge = /usr/bin/nova-dhcpbridgedhcpbridge_flagfile = /etc/nova/nova.confforce_dhcp_release = True#libvirt_inject_partition = -1#injected_network_template = /usr/share/nova/interfaces.template#libvirt_nonblocking = True#防火墙组件firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver#网络管理组件network_manager = nova.network.manager.FlatDHCPManager#网段设置fixed_range=192.168.100.0/24#计算节点的网桥flat_network_bridge = br100public_interface=eth3#计算节点的内部网络接口flat_interface=eth2#网段启始ipflat_network_dhcp_start=192.168.100.2#floating_range=60.12.206.32/27network_size = 1multi_host = true#enabled_apis=metadata#VNC#设置vnc服务novnc_enabled=truenovncproxy_base_url=http://192.168.1.106:6080/vnc_auto.htmlnovncproxy_port = 6080vncserver_proxyclient_address = 192.168.137.106vncserver_listen = 0.0.0.0#AUTHauth_strategy = keystone#Must Have #这个我试过用来认证如果没有将没法认证Keystone服务也无法启动[keystone_authtoken]admin_tenant_name = serviceTenantadmin_user = novaadmin_password = Nova_Passauth_host = 192.168.1.104auth_port = 35357auth_protocol = httpsigning_dir = /tmp/keystone-signing-nova#Computecompute_driver = libvirt.LibvirtDriver

接下来进行数据库同步

nova-manage db sync

确保nova用户对/etc/nova /var/lib/nova有完全的权限

chown -R nova:nova /etc/novachown -R nova:nova /var/lib/nova
如果权限不对可能会有问题。

最后重启服务。为了方便我写在脚本里。

restart_nova.sh

service nova-api restartservice nova-cert restartservice nova-conductor restartservice nova-consoleauth restartservice nova-novncproxy restartservice nova-scheduler restart

测试一下功能。
nova list

这时候又会出现之前的问题。

ERROR: You must provide a username via either --os-username or env[OS_USERNAME]

导入类似的脚本export_nova.sh

export OS_TENANT_NAME=serviceTenantexport OS_USERNAME=novaexport OS_PASSWORD=Nova_Passexport OS_AUTH_URL=http://192.168.1.104:35357/v2.0

再次运行
nova list 


成功的样子就是这样。这样我们的Nova服务大功告成。接下来要配置的就是管理界面了。

0 0