openstack安装配置(三)

增加Networking - 前期准备(controller)

Networking又叫做Neutron,是Openstack必不可少的组件,它其实是网络虚拟化的实现工具,可以让我们模拟出路由器、交换机、网卡等网络设备。

Neutron支持两种网络模式,第一种是非常简单的网络架构,它仅支持是让实例连接外网,不支持自定义网络、路由器以及浮动ip。只有管理员或者授权的用户有权限去管理网络。第二种网络功能比较强大,支持自定义网络管理,支持自建路由器并且也支持浮动ip。即使没有授权的用户也可以管理网络,支持用户自己配置和管理。

创建库、授权账号 mysql -uroot -ptn1Pi6Ytm

> CREATE DATABASE neutron;

> GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘localhost‘    IDENTIFIED BY ‘RYgv0rg7p‘;

> GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘%‘    IDENTIFIED BY ‘RYgv0rg7p‘;

执行脚本 source admin-openrc.sh

创建neutron用户(密码为mdcGVl29i)

openstack user create --domain default --password-prompt neutron

把admin角色添加到neutron用户里

openstack role add --project service --user neutron admin

创建neutron实例

openstack service create --name neutron   --description "OpenStack Networking" network

创建networking服务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

增加Networking - 配置(controller)

安装组件

yum install openstack-neutron openstack-neutron-ml2 \

openstack-neutron-linuxbridge python-neutronclient ebtables ipset -y

配置服务端组件

vim   /etc/neutron/neutron.conf  //更改或增加

[DEFAULT]

core_plugin = ml2

service_plugins =

rpc_backend = rabbit

auth_strategy = keystone

notify_nova_on_port_status_changes = True

notify_nova_on_port_data_changes = True

nova_url = http://controller:8774/v2

verbose = True

[database]

connection = mysql://neutron:[email protected]/neutron

[oslo_messaging_rabbit]

rabbit_host = controller

rabbit_userid = openstack

rabbit_password = o3NXovnz5

[keystone_authtoken]

auth_uri = http://controller:5000

auth_url = http://controller:35357

auth_plugin = password

project_domain_id = default

user_domain_id = default

project_name = service

username = neutron

password = mdcGVl29i

[nova]

auth_url = http://controller:35357

auth_plugin = password

project_domain_id = default

user_domain_id = default

region_name = RegionOne

project_name = service

username = nova

password = hsSNsqc43

[oslo_concurrency]

lock_path = /var/lib/neutron/tmp

配置ml2 插件

vim  /etc/neutron/plugins/ml2/ml2_conf.ini  //更改或增加

[ml2]

type_drivers = flat,vlan

tenant_network_types =

mechanism_drivers = linuxbridge

extension_drivers = port_security

[ml2_type_flat]

flat_networks = public

[securitygroup]

enable_ipset = True

编辑linux桥接agent

vim  /etc/neutron/plugins/ml2/linuxbridge_agent.ini  //增加或更改

[linux_bridge]

physical_interface_mappings = public:eno16777736

[vxlan]

enable_vxlan = False

[agent]

prevent_arp_spoofing = True

[securitygroup]

enable_security_group = True

firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

配置dhcp agent

vim  /etc/neutron/dhcp_agent.ini  //增加或更改

[DEFAULT]

interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver

dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq

enable_isolated_metadata = True

verbose = True

增加Networking - 配置元数据agent(controller)

编辑配置文件

vim  /etc/neutron/metadata_agent.ini  //更改或增加

[DEFAULT]

auth_uri = http://controller:5000

auth_url = http://controller:35357

auth_region = RegionOne

auth_plugin = password

project_domain_id = default

user_domain_id = default

project_name = service

username = neutron

password = mdcGVl29i

nova_metadata_ip = controller

metadata_proxy_shared_secret = m8uhmQTu2

verbose = True

说明:需要删除掉配置文件里原有的 auth_url   auth_region admin_tenant_name  admin_user  admin_password

增加Networking - compute使用网络(controller)

vim /etc/nova/nova.conf  //更改或添加

[neutron]

url = http://controller:9696

auth_url = http://controller:35357

auth_plugin = password

project_domain_id = default

user_domain_id = default

region_name = RegionOne

project_name = service

username = neutron

password = mdcGVl29i

service_metadata_proxy = True

metadata_proxy_shared_secret = m8uhmQTu2

增加Networking - 启动服务(controller)

创建ml2插件配置文件创建软连接

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

重启compute api服务

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 enable neutron-l3-agent.service

systemctl start neutron-l3-agent.service

增加Networking - 配置compute节点(compute)

安装组件 yum install -y openstack-neutron openstack-neutron-linuxbridge ebtables ipset

配置普通组件  vim /etc/neutron/neutron.conf //更改或增加

[DEFAULT]

rpc_backend = rabbit

auth_strategy = keystone

verbose = True

[oslo_messaging_rabbit]

rabbit_host = controller

rabbit_userid = openstack

rabbit_password = o3NXovnz5

[keystone_authtoken]

auth_uri = http://controller:5000

auth_url = http://controller:35357

auth_plugin = password

project_domain_id = default

user_domain_id = default

project_name = service

username = neutron

password = mdcGVl29i

[oslo_concurrency]

lock_path = /var/lib/neutron/tmp

配置linux桥接agent

vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini

[linux_bridge]

physical_interface_mappings = public:eno16777736

[vxlan]

enable_vxlan = False

[agent]

prevent_arp_spoofing = True

[securitygroup]

enable_security_group = True

firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

配置compute使用网络

vim /etc/nova/nova.conf  //更改或增加

[neutron]

url = http://controller:9696

auth_url = http://controller:35357

auth_plugin = password

project_domain_id = default

user_domain_id = default

region_name = RegionOne

project_name = service

username = neutron

password = mdcGVl29i

启动服务

systemctl restart openstack-nova-compute.service

systemctl enable neutron-linuxbridge-agent.service

systemctl start neutron-linuxbridge-agent.service

增加Networking - 验证配置(controller)

执行环境变量脚本

source admin-openrc.sh

列出所有的扩展

neutron ext-list

列出所有agent

neutron agent-list

agent type如下:

Linux bridge agent

Linux bridge agent

DHCP agent

Metadata agent

必须要有4个,否则说明上面的某个步骤配置有问题。

时间: 2024-08-24 15:20:35

openstack安装配置(三)的相关文章

MYSQL + MHA +keepalive + VIP安装配置(三)--keepalived安装配置

一.概述 keepalived介绍:Keepalived的作用是检测web服务器的状态,如果有一台web服务器死机,或工作出现故障,Keepalived将检测到,并将有故障的web 服务器从系统中剔除,当web服务器工作正常后Keepalived自动将web服务器加入到服务器群中,这些工作全部自动完成,不需要人工干涉,需要人 工做的只是修复故障的web服务器. 二.环境 ? 1 2 3 vip:192.168.1.203\204 mysql-master:192.168.1.231 mysql-

openstack安装配置—— controller node配置

    实际生产环境中,每个服务模块很有可能都是一个集群,但我们这里只是带大家配置了一个实验环境,所以我们这里把keystone.nova.neutron.glance.dashboard都安装在了contoller节点上. controller节点基础配置 [[email protected] ~]# hostname controller [[email protected] ~]# lscpu Architecture:          x86_64 CPU op-mode(s):  

openstack安装配置—— orchestration安装配置

    如果一次需要启动10个实例,手动一个一个的去套模版启动,相信也行太low了吧,openstack官方也为运维人员准备了强大的利器,那就是任务编排orchestration服务模块了,当然如果要想用好这一工具来帮我解决低级趣味的任务编排,还需要我们专业去学习一下heat模版语法了,在这里我只是带大家简单实现一下通过任务编排模版自动创建并启动一个实例,具体语法规则不这里不详细陈述. controller节点安装配置 准备数据库 [[email protected] ~]# mysql Wel

openstack安装配置—— compute node配置

    计算节点需要配置的主要是nova和neutron的客户端,控制节点在进行资源调度及配置时需要计算节点配合方能实现的,计算节点配置内容相对较少,实际生产环境中,需要配置的计算节点数量相当庞大,那么我们就需要借助ansible或者puppet这样的自动化工具进行了,   废话不多讲,直接进入配置状态. compute节点基础配置 [[email protected] ~]# lscpu Architecture:          x86_64 CPU op-mode(s):        

openstack安装配置

一.安装前的准备 在RHEL7/CentOS7上安装openstack  liberty 两台虚拟机,安装centos7系统(准备两个网卡,一个NAT,另一个仅主机) nat网卡设置ip,可以联网,仅主机的网卡只要我们windows可以通就行,主要是用putty远程连接的 关闭selinux 关闭iptables systemctl stop firewalld systemctl disable firewalld 关闭NetworkManager systemctl stop Network

openstack安装配置(二)

增加image - 前期准备(controller) image又叫做glance,是用来管理镜像的一个组件,我们用镜像来安装操作系统.glance支持让用户自己管理自定义镜像. 创建glance库和用户 mysql -uroot -ptn1Pi6Ytm > CREATE database  glance; > GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost'    IDENTIFIED BY 'Zznky4tP0'; >

openstack安装配置—— file share node 配置

实际生产中,很多时候需要数据源的共享来实现多节点的实时数据保持一致,openstack官方提供了manila服务模块实现了云盘共享,manila服务也是需要manila服务端和存储节点共同组成的,本实验中为了节约虚机节点,就把manila服务端安装在了controller节点上,manila数据存储节点和cinder存储节点合并使用一个虚机节点,各自使用了一块独立硬盘. manila服务端配置 准备数据库 [[email protected] ~]# mysql Welcome to the M

openstack安装配置—— block node配置

    对于云主机来说,机器可以随时销毁再创建,但数据一定不能,所以就需要数据的持久存储,openstack官方给出的数据存储方案就是cinder模块,cinder模块需要cinder服务端和cinder存储节点共同构成,在本实验中,我们把cinder服务端一并安装在了controller节点上,另行配置一台cinder存储节点,也就是我们的block节点. block节点基础配置 [[email protected] ~]# lscpu Architecture:          x86_6

openstack安装配置—— dnshboard安装配置

    做为专业运维人员,使用命令行工具去管理云主机是没有问题的,但如果云要提供给客户使用,就不可能让用户命令行工具去管理自己的云主机了,此时,就需要一个简单易用的管理页面提供给用户了,openstack官方也很体贴的为我们已经准备好了,只是程序代码方面还存在着一些小问题,不过我已经帮大家趟过一连坑了,按照如下的配置流程是可以让大家体验到使用鼠标管理云主机的效果的. 安装并修改配置文件 [[email protected] ~]# yum install -y openstack-dashboa