本文主要是介绍13 龙芯平台openstack部署搭建-nova-controllercomputer部署(单节点),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、创建Nova相关数据库、凭据与API端点
1.创建数据库并授权
#nova-controller先决条件
mysql -uroot -ploongson -e “CREATE DATABASE nova_api;”
mysql -uroot -ploongson -e “CREATE DATABASE nova;”
mysql -uroot -ploongson -e “CREATE DATABASE nova_cell0;”
mysql -uroot -ploongson -e “GRANT ALL PRIVILEGES ON nova_api.* TO ‘nova’@‘localhost’ IDENTIFIED BY ‘loongson’;”
mysql -uroot -ploongson -e “GRANT ALL PRIVILEGES ON nova_api.* TO ‘nova’@‘%’ IDENTIFIED BY ‘loongson’;”
mysql -uroot -ploongson -e “GRANT ALL PRIVILEGES ON nova.* TO ‘nova’@‘localhost’ IDENTIFIED BY ‘loongson’;”
mysql -uroot -ploongson -e “GRANT ALL PRIVILEGES ON nova.* TO ‘nova’@‘%’ IDENTIFIED BY ‘loongson’;”
mysql -uroot -ploongson -e “GRANT ALL PRIVILEGES ON nova_cell0.* TO ‘nova’@‘localhost’ IDENTIFIED BY ‘loongson’;”
mysql -uroot -ploongson -e “GRANT ALL PRIVILEGES ON nova_cell0.* TO ‘nova’@‘%’ IDENTIFIED BY ‘loongson’;”
2.创建计算服务凭据
#以下命令需要输入密码
openstack user create --domain default --password-prompt nova
openstack role add --project service --user nova admin
openstack service create --name nova --description “OpenStack Compute” compute
3.创建compute API服务端点
openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
二、nova相关软件安装与配置
1.安装nova相关软件
yum install -y openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler
2.配置文件修改
cp /etc/nova/nova.conf /etc/nova/nova.conf.bac
openstack-config --set /etc/nova/nova.conf DEFAULT debug true
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 10.130.0.31
openstack-config --set /etc/nova/nova.conf DEFAULT pybasedir /usr/lib/python3/dist-packages
openstack-config --set /etc/nova/nova.conf DEFAULT bindir /usr/bin
openstack-config --set /etc/nova/nova.conf DEFAULT state_path /var/lib/nova
openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
openstack-config --set /etc/nova/nova.conf DEFAULT transport_url rabbit://guest:loongson@10.130.0.31:5672
openstack-config --set /etc/nova/nova.conf api auth_strategy keystone
openstack-config --set /etc/nova/nova.conf api_database connection mysql+pymysql://nova:loongson@controller:3306/nova_api
openstack-config --set /etc/nova/nova.conf cinder os_region_name RegionOne
openstack-config --set /etc/nova/nova.conf database connection mysql+pymysql://nova:loongson@controller:3306/nova
openstack-config --set /etc/nova/nova.conf glance api_servers http://controller:9292
openstack-config --set /etc/nova/nova.conf keystone_authtoken www_authenticate_uri http://controller:5000
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:5000
openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers controller:11211
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_type password
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_name Default
openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_name Default
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
openstack-config --set /etc/nova/nova.conf keystone_authtoken password loongson
openstack-config --set /etc/nova/nova.conf libvirt virt_type kvm
openstack-config --set /etc/nova/nova.conf libvirt use_virtio_for_bridges true
openstack-config --set /etc/nova/nova.conf neutron auth_url http://controller:5000
openstack-config --set /etc/nova/nova.conf neutron auth_type password
openstack-config --set /etc/nova/nova.conf neutron project_domain_name default
openstack-config --set /etc/nova/nova.conf neutron user_domain_name default
openstack-config --set /etc/nova/nova.conf neutron region_name RegionOne
openstack-config --set /etc/nova/nova.conf neutron project_name service
openstack-config --set /etc/nova/nova.conf neutron username neutron
openstack-config --set /etc/nova/nova.conf neutron password loongson
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
openstack-config --set /etc/nova/nova.conf placement region_name RegionOne
openstack-config --set /etc/nova/nova.conf placement project_domain_name Default
openstack-config --set /etc/nova/nova.conf placement project_name service
openstack-config --set /etc/nova/nova.conf placement auth_type password
openstack-config --set /etc/nova/nova.conf placement user_domain_name Default
openstack-config --set /etc/nova/nova.conf placement auth_url http://controller:5000/v3
openstack-config --set /etc/nova/nova.conf placement username placement
openstack-config --set /etc/nova/nova.conf placement password loongson
openstack-config --set /etc/nova/nova.conf vnc enabled true
openstack-config --set /etc/nova/nova.conf vnc server_listen $my_ip
openstack-config --set /etc/nova/nova.conf vnc server_proxyclient_address $my_ip
openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://controller:6080/vnc_auto.html
#检查配置文件修改
cat /etc/nova/nova.conf
[DEFAULT]
debug = true
my_ip = 10.130.0.31
pybasedir = /usr/lib/python3/dist-packages
bindir = /usr/bin
state_path = /var/lib/nova
enabled_apis = osapi_compute,metadata
transport_url = rabbit://guest:loongson@10.130.0.31:5672
[api]
auth_strategy = keystone
[api_database]
connection = mysql+pymysql://nova:loongson@controller:3306/nova_api
[cinder]
os_region_name = RegionOne
[database]
connection = mysql+pymysql://nova:loongson@controller:3306/nova
[glance]
api_servers = http://controller:9292
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = loongson
#region_name = RegionOne
[libvirt]
virt_type = kvm
use_virtio_for_bridges = true
[neutron]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = loongson
#service_metadata_proxy = true
#metadata_proxy_shared_secret = loongson
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[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 = loongson
[spice]
#enabled = true
#server_listen = 0.0.0.0
#server_proxyclient_address = $my_ip
[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
[scheduler]
discover_hosts_in_cells_interval = 300
3.同步创建相关数据库(注意顺序)
(1)填充nova-api数据库
su -s /bin/sh -c “nova-manage api_db sync” nova
#验证数据库
mysql -unova -ploongson -e “use nova_api;show tables;”
(2)注册cell0数据库
su -s /bin/sh -c “nova-manage cell_v2 map_cell0” nova
(3)创建cell1单元
su -s /bin/sh -c “nova-manage cell_v2 create_cell --name=cell1 --verbose” nova
(4)初始化nova数据库
su -s /bin/sh -c “nova-manage db sync” nova
(5)检查确认cell0和cell1注册成功
su -s /bin/sh -c “nova-manage cell_v2 list_cells” nova
(6)验证数据库
mysql -unova -ploongson -e “use nova_api;show tables;”
mysql -uplacement -ploongson -e “use placement;show tables;”
#启动计算服并设置开机自启
systemctl enable
openstack-nova-api.service
openstack-nova-scheduler.service
openstack-nova-conductor.service
openstack-nova-novncproxy.service
systemctl start
openstack-nova-api.service
openstack-nova-scheduler.service
openstack-nova-conductor.service
openstack-nova-novncproxy.service
systemctl status
openstack-nova-api.service
openstack-nova-scheduler.service
openstack-nova-conductor.service
openstack-nova-novncproxy.service
#安装计算相关服务
yum install -y openstack-nova-compute
#安装dmidecode
yum install -y dmidecode
#安装qemu-system-loongarch64
yum install -y qemu-system-loongarch64
ln -s /usr/bin/qemu-system-loongarch64 /usr/libexec/qemu-kvm
#使能openstack-nova-compute
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
systemctl status libvirtd.service openstack-nova-compute.service
#将计算节点添加到cell数据库中
openstack compute service list --service nova-compute
su -s /bin/sh -c “nova-manage cell_v2 discover_hosts --verbose” nova
#创建flavor
nova flavor-create --is-public true boshen_ram_2048_disk_2_vcpus_1 boshen_ram_2048_disk_2_vcpus_1 2048 60 2
#验证
openstack compute service list
openstack catalog list
openstack image list
nova-status upgrade check
这篇关于13 龙芯平台openstack部署搭建-nova-controllercomputer部署(单节点)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!