涛子 - 简单就是美

成单纯魁增,永继振国兴,克复宗清政,广开家必升

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  428 随笔 :: 0 文章 :: 19 评论 :: 22万 阅读
# 建立数据库用户及权限
create database nova;
grant all privileges on nova.* to nova@'localhost' identified by 'Abc@123';
grant all privileges on nova.* to nova@'%' identified by 'Abc@123';

create database nova_api;
grant all privileges on nova_api.* to nova@'localhost' identified by 'Abc@123';
grant all privileges on nova_api.* to nova@'%' identified by 'Abc@123';

create database nova_cell0;
grant all privileges on nova_cell0.* to nova@'localhost' identified by 'Abc@123';
grant all privileges on nova_cell0.* to nova@'%' identified by 'Abc@123';

flush privileges;

# 建立用户、角色、服务、项目、域、端点
source ~/.openstack_admin
openstack user create --domain default --project service --password Abc@123 nova
openstack role add --project service --user nova admin
openstack service create --name nova --description "OpenStack Compute Service" compute

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

# 安装程序包
yum install -y openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-console

# 变更配置文件
cd /etc/nova
mv nova.conf nova.conf.org

cat > /etc/nova/nova.conf << EOF
[DEFAULT]
my_ip = 192.168.10.218
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:Abc@123@controller
user_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver

[api_database]
connection = mysql+pymysql://nova:Abc@123@controller/nova_api

[database]
connection = mysql+pymysql://nova:Abc@123@controller/nova

[api]
auth_strategy = keystone

[keystone_authtoken]
auth_url = http://controller:5000/v3
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project _name = service
username = nova
password = Abc@123

[vnc]
enabled = true
server_listen = \$my_ip
server_proxyclient_address = \$my_ip

[glance]
api_servers = http://controller:9292

[oslo_concurrency]
lock_path = /var/lib/nova/tmp

[placement]
auth_url = http://controller:5000/v3
region_name = RegionOne
project_domain_name = default
user_domain_name = default
project _name = service
auth_type = password
username = placement
password = Abc@123

[scheduler]
discover_hosts_in_cells_interval = 300
EOF

chmod 640 /etc/nova/nova.conf
chown root:nova /etc/nova/nova.conf

# 同步数据库
su -s /bin/bash -c "nova-manage api_db sync" nova
su -s /bin/bash -c "nova-manage cell_v2 map_cell0" nova
su -s /bin/bash -c "nova-manage cell_v2 create_cell --name cell1 --verbose" nova
su -s /bin/bash -c "nova-manage db sync" nova

su -s /bin/bash -c "nova-manage cell_v2 list_cells" nova
su -s /bin/bash -c "nova-manage cell_v2 discover_hosts --verbose" nova

# 开启服务
systemctl restart openstack-nova-api && systemctl enable openstack-nova-api
systemctl restart openstack-nova-scheduler && systemctl enable openstack-nova-scheduler
systemctl restart openstack-nova-conductor && systemctl enable openstack-nova-conductor
systemctl restart openstack-nova-novncproxy && systemctl enable openstack-nova-novncproxy
systemctl restart openstack-nova-consoleauth && systemctl enable openstack-nova-consoleauth

# 验证
openstack compute service list
posted on   北京涛子  阅读(372)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类
历史上的今天:
2018-11-16 从golang-gin-realworld-example-app项目学写httpapi (二)
点击右上角即可分享
微信分享提示