当前位置: 首页 > news >正文

08 龙芯平台openstack部署搭建-neutron-controller部署

一、创建neutron相关数据库、服务凭证和API端点

1.创建neutron数据库,授予合适的访问权限

mysql -uroot -ploongson -e “CREATE DATABASE neutron;”
mysql -uroot -ploongson -e “GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron’@‘localhost’ IDENTIFIED BY ‘loongson’;”
mysql -uroot -ploongson -e “GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron’@‘%’ IDENTIFIED BY ‘loongson’;”

#要创建服务凭证
#以下命令需要输入密码
openstack user create --domain default --password-prompt neutron

openstack role add --project service --user neutron admin
openstack service create --name neutron --description “OpenStack Networking” network

#创建网络服务 API 端点
openstack endpoint create --region RegionOne network public http://controller:9696
openstack endpoint create --region RegionOne network internal http://controller:9696
openstack endpoint create --region RegionOne network admin http://controller:9696
openstack endpoint list

二、neutron相关软件安装与配置

#安装neutron相关软件
yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables

#配置服务器组件
cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bac
openstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin ml2
openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins router
openstack-config --set /etc/neutron/neutron.conf DEFAULT transport_url rabbit://guest:loongson@10.130.0.31:5672
openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_status_changes True
openstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_data_changes True

openstack-config --set /etc/neutron/neutron.conf database connection mysql+pymysql://neutron:loongson@controller:3306/neutron

openstack-config --set /etc/neutron/neutron.conf keystone_authtoken www_authenticate_uri http://controller:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://controller:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers controller:11211
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_type password
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name service
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutron
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken password loongson

openstack-config --set /etc/neutron/neutron.conf nova auth_url http://controller:5000
openstack-config --set /etc/neutron/neutron.conf nova auth_type password
openstack-config --set /etc/neutron/neutron.conf nova project_domain_name default
openstack-config --set /etc/neutron/neutron.conf nova user_domain_name default
openstack-config --set /etc/neutron/neutron.conf nova region_name RegionOne
openstack-config --set /etc/neutron/neutron.conf nova project_name service
openstack-config --set /etc/neutron/neutron.conf nova username nova
openstack-config --set /etc/neutron/neutron.conf nova password loongson

openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp

#配置模块化第 2 层 (ML2) 插件
cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bac
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers local,flat,vlan,gre,vxlan,geneve
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types vxlan
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers linuxbridge
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers port_security

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks provider

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_vxlan vni_ranges 1:1000

#注意网卡名称需要根据实际情况修改
#配置 Linux 网桥代理
cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bac
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip 10.130.0.31
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population true

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group false
#openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver iptables

#请根据实际情况修改网卡名称
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings provider:enp0s3f0

#配置 DHCP 代理
cp /etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.bac
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver linuxbridge
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dhcp_driver neutron.agent.linux.dhcp.Dnsmasq
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT enable_isolated_metadata true

#配置元数据代理
cp /etc/neutron/metadata_agent.ini /etc/neutron/metadata_agent.ini.bac
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_host controller
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret loongson

三、配置 Compute 服务以使用 Networking 服务

#安装计算相关网络服务
yum install -y openstack-neutron-linuxbridge ebtables ipset

#完成安装
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
su -s /bin/sh -c “neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head” neutron
systemctl restart openstack-nova-api.service

#使能控制节点网络服务
systemctl enable neutron-server.service
neutron-linuxbridge-agent.service neutron-dhcp-agent.service
neutron-metadata-agent.service

systemctl start neutron-server.service
neutron-linuxbridge-agent.service neutron-dhcp-agent.service
neutron-metadata-agent.service

systemctl status neutron-server.service
neutron-linuxbridge-agent.service neutron-dhcp-agent.service
neutron-metadata-agent.service

http://www.lryc.cn/news/321900.html

相关文章:

  • JAVA 100道题(6)
  • Leetcode面试经典150题
  • 王者荣耀使用的UDP通信,十几年编程没用过的协议
  • HiveQL详解
  • Linux/Bizness
  • mysql 数据库 增删改查 基本操作
  • 计算机网络——物理层(编码与调制)
  • PHP魔术方法详解
  • 游戏 AI 反作弊|内附解决方案详情!
  • elementUI组件库样式修改整理
  • 还是了解下吧,大语言模型调研汇总
  • Win11初始化系统遇一文解决
  • vr虚拟现实游戏世界介绍|数字文化展览|VR元宇宙文旅
  • kotlin 程序 编译与执行
  • Python学习:注释和运算符
  • 英伟达 V100、A100/800、H100/800 GPU 对比
  • Spark面试重点
  • UGUI源码分析与研究2-从底层实现的角度去分析和调优UI的性能问题和疑难杂症
  • OpenAI的GPT已达极限,更看好AI Agent
  • 【C/C++】详解 assert() 断言(什么是assert? assert有什么作用?)
  • [C++]20:unorderedset和unorderedmap结构和封装。
  • ARM 汇编指令:(六) B 跳转指令
  • ​​SQLiteC/C++接口详细介绍之sqlite3类(十一)
  • 百度智能云+SpringBoot=AI对话【人工智能】
  • 第二十七节 Java 多态
  • 基于Springboot的员工健康管理系统(有报告)。Javaee项目,springboot项目。
  • [论文精读]Dynamic Coarse-to-Fine Learning for Oriented Tiny Object Detection
  • Selenium WebDriver 中用于查找网页元素的两个方法
  • python 常用装饰器
  • 深入解析MySQL日志系统:Binlog、Undo Log和Redo Log