openstack搭建配置

安装和配置网络节点
vim /etc/sysctl.conf
net.ipv4.ip_forward=1
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0

sysctl -p
yum -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch

vim /etc/neutron/neutron.conf
[DEFAULT]
...
rpc_backend = rabbit
rabbit_host = 192.168.5.1
rabbit_password = 666666
auth_strategy = keystone
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
verbose = True
[keystone_authtoken]
...
auth_uri = http://192.168.5.1:5000/v2.0
identity_uri = http://192.168.5.1:35357
admin_tenant_name = service
admin_user = neutron
admin_password = 666666

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

[ml2]
...
type_drivers = flat,gre
tenant_network_types = gre
mechanism_drivers = openvswitch

[ml2_type_flat]
...
flat_networks = external

[ml2_type_gre]
...
tunnel_id_ranges = 1:1000

[securitygroup]
...
enable_security_group = True
enable_ipset = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver

[ovs]
...
local_ip = 192.168.8.1
enable_tunneling = True
bridge_mappings = external:br-ex

[agent]
...
tunnel_types = gre

vim /etc/neutron/l3_agent.ini
[DEFAULT]
...
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
use_namespaces = True
external_network_bridge = br-ex
router_delete_namespaces = True
verbose = True

vim /etc/neutron/dhcp_agent.ini
[DEFAULT]
...
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
use_namespaces = True
dhcp_delete_namespaces = True
verbose = True

vim /etc/neutron/dhcp_agent.ini
[DEFAULT]
...
dnsmasq_config_file = /etc/neutron/dnsmasq-neutron.conf

vim /etc/neutron/dnsmasq-neutron.conf
dhcp-option-force=26,1454

pkill dnsmasq

vim /etc/neutron/metadata_agent.ini

[DEFAULT]
...
auth_url = http://192.168.5.1:5000/v2.0
auth_region = regionOne
admin_tenant_name = service
admin_user = neutron
admin_password = 666666
nova_metadata_ip = 192.168.5.1
metadata_proxy_shared_secret = METADATA_SECRET
verbose = True

在控制节点上操作
vim /etc/nova/nova.conf
[neutron]
...
service_metadata_proxy = True
metadata_proxy_shared_secret = METADATA_SECRET

systemctl restart openstack-nova-api.service

在网络节点上操作
systemctl enable openvswitch.service
systemctl start openvswitch.service

ovs-vsctl add-br br-ex  ####http://blog.csdn.net/signmem/article/details/19419517
####http://www.aboutyun.com/thread-11777-1-1.html

ovs-vsctl add-port br-ex ext8
ethtool -K ext8 gro off

ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
cp /usr/lib/systemd/system/neutron-openvswitch-agent.service /usr/lib/systemd/system/neutron-openvswitch-agent.service.orig
sed -i ‘s,plugins/openvswitch/ovs_neutron_plugin.ini,plugin.ini,g‘ /usr/lib/systemd/system/neutron-openvswitch-agent.service

systemctl enable neutron-openvswitch-agent.service neutron-l3-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-ovs-cleanup.service

systemctl start neutron-openvswitch-agent.service neutron-l3-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service

在控制节点安装
source admin-openrc.sh

neutron agent-list

在计算节点上操作

vim /etc/sysctl.conf
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0

sysctl -p

yum -y install openstack-neutron-ml2 openstack-neutron-openvswitch

vim /etc/neutron/neutron.conf
 
在[database]注销connection
[DEFAULT]
...
rpc_backend = rabbit
rabbit_host = 192.168.5.1
rabbit_password = 666666
auth_strategy = keystone
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
verbose = True
[keystone_authtoken]
...
auth_uri = http://192.168.5.1:5000/v2.0
identity_uri = http://192.168.5.1:35357
admin_tenant_name = service
admin_user = neutron
admin_password = 666666

vim /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
...
type_drivers = flat,gre
tenant_network_types = gre
mechanism_drivers = openvswitch
[ml2_type_gre]
...
tunnel_id_ranges = 1:1000

[securitygroup]
...
enable_security_group = True
enable_ipset = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
[ovs]
...
local_ip = 192.168.5.2  ###计算节点ip
enable_tunneling = True

[agent]
...
tunnel_types = gre

systemctl enable openvswitch.service

systemctl start openvswitch.service

vim /etc/nova/nova.conf

[DEFAULT]
...
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver

[neutron]
...
url = http://192.168.5.1:9696
auth_strategy = keystone
admin_auth_url = http://192.168.5.1:35357/v2.0
admin_tenant_name = service
admin_username = neutron
admin_password = 666666

ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

cp /usr/lib/systemd/system/neutron-openvswitch-agent.service /usr/lib/systemd/system/neutron-openvswitch-agent.service.orig
sed -i ‘s,plugins/openvswitch/ovs_neutron_plugin.ini,plugin.ini,g‘ /usr/lib/systemd/system/neutron-openvswitch-agent.service

systemctl restart openstack-nova-compute.service

systemctl enable neutron-openvswitch-agent.service
systemctl restart neutron-openvswitch-agent.service

在控制节点上操作
source admin-openrc.sh
neutron agent-list

source admin-openrc.sh

neutron net-create ext-net --router:external True --provider:physical_network external --provider:network_type flat

neutron subnet-create ext-net --name ext-subnet --allocation-pool start=FLOATING_IP_START,end=FLOATING_IP_END --disable-dhcp --gateway EXTERNAL_NETWORK_GATEWAY EXTERNAL_NETWORK_CIDR

neutron subnet-create ext-net --name ext-subnet --allocation-pool start=172.16.1.100,end=172.16.1.200 --disable-dhcp --gateway 172.16.1.1 172.16.0.0/16

source demo-openrc.sh
neutron net-create demo-net
neutron subnet-create demo-net --name demo-subnet --gateway TENANT_NETWORK_GATEWAY TENANT_NETWORK_CIDR

neutron subnet-create demo-net --name demo-subnet --gateway 192.168.2.1 192.168.2.0/24

neutron router-create demo-router

neutron router-interface-add demo-router demo-subnet
Added interface b1a894fd-aee8-475c-9262-4342afdc1b58 to router demo-router

neutron router-gateway-set demo-router ext-net
Set gateway for router demo-router

vim /etc/nova/nova.conf

[DEFAULT]
...
network_api_class = nova.network.api.API
security_group_api = nova

systemctl restart openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service

在计算节点操作
yum -y install openstack-nova-network openstack-nova-api

vim /etc/nova/nova.conf
[DEFAULT]
...
network_api_class = nova.network.api.API
security_group_api = nova
firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver
network_manager = nova.network.manager.FlatDHCPManager
network_size = 254
allow_same_net_traffic = False
multi_host = True
send_arp_for_ha = True
share_dhcp_address = True
force_dhcp_release = True
flat_network_bridge = br100
flat_interface = INTERFACE_NAME  ####
public_interface = INTERFACE_NAME  ####

systemctl enable openstack-nova-network.service openstack-nova-metadata-api.service
systemctl start openstack-nova-network.service openstack-nova-metadata-api.service

在控制节点上操作
source admin-openrc.sh
nova network-create demo-net --bridge br100 --multi-host T --fixed-range-v4 NETWORK_CIDR

nova network-create demo-net --bridge br100 --multi-host T --fixed-range-v4 203.0.113.24/29

nova net-list

添加仪表盘
在控制节点上操作
yum -y install openstack-dashboard httpd mod_wsgi memcached python-memcached

vim /etc/openstack-dashboard/local_settings
OPENSTACK_HOST = "192.168.5.1"
ALLOWED_HOSTS = [‘*‘]
CACHES = {  
   ‘default‘: {
       ‘BACKEND‘: ‘django.core.cache.backends.memcached.MemcachedCache‘,
       ‘LOCATION‘: ‘127.0.0.1:11211‘,
   }
}
TIME_ZONE = "Asia/Shanghai"

setsebool -P httpd_can_network_connect on

chown -R apache:apache /usr/share/openstack-dashboard/static

systemctl enable httpd.service memcached.service
systemctl start httpd.service memcached.service

访问http://192.168.5.1/dashboard

时间: 2024-10-13 07:28:09

openstack搭建配置的相关文章

OpenStack 学习笔记(七):OpenStack Dashboard服务搭建配置

--Dashboard服务搭建配置 1.)安装dashboard [[email protected] ~]# yum -y install openstack-dashboard 2.)配置dashboard [[email protected] ~]# cp /etc/openstack-dashboard/local_settings /etc/openstack-dashboard/local_settings.bak [[email protected] ~]# vim /etc/op

【OpenCV笔记】使用VS2012和OpenCV2.4.9搭建配置OpenCV开发环境

使用MS Visual C++来创建OpenCV工程,由于不同的VS版本在配置时有所差别,现特把配置过程总结下来,以方便自己和其他朋友使用. 1.软件准备 安装Visual Studio2012和OpenCV2.4.9 这里就不再对软件的安装和环境变量的设置进行说明了,其他类似的文章的设置都大抵相似,本文重点介绍一下VS2012环境的配置. 2.配置VS2012环境 (1)新建工程 你可以创建简单的控制台应用或者拥有图形用户界面的复杂应用,此处我们选择最简单常用的控制台应用. 理解解决方案(So

Gitolite服务器搭建配置

最近开发说需要搭建一个git服务器来用,就顺便学了下,也记下来方便以后参考 安装GIT ## 安装依赖包 yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel ## 安装libiconv依赖包 wget http://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz tar -xf libiconv-1.14.tar.gz  cd libiconv-1.1

Shark集群搭建配置

一.Shark简介 Shark是基于Spark与Hive之上的一种SQL查询引擎,官网的架构图及性能测试图如下: 我们涉及到了2个依赖组件,1是Apache Spark, 另外一个是AMPLAB的Hive0.11. 这里注意版本的选择,一定要选择官方的推荐版本: Spark0.91 + AMPLAB Hive0.11 + Shark0.91 一定要自己编译好它们,适用于自己的集群. 二.Shark集群搭建 1. 搭建Spark集群,这个可以参照:Spark集群搭建. 2. 编译AMPLAB的Hi

OpenStack 搭建(一)

OpenStack介绍 openstack是一个云平台管理项目,我们可以使用openstack来管理我们的资源池,在这个资源池中包含了很多的子项目.openstack是有多个不同的模块组成,不同的功能有相对应得不同模块负责.openstack三大核心分别是 计算.网络.存储.通过调用不同模块的API来对外提供交互. openstack 的版本发布很快,从最初的A版到现在的N版,官方一般会每隔六个月发布一个新的版本. openstack每个服务都有对应的项目名称,不同的项目就相当于一个提供单独服务

Linux之LAMP架构搭建配置

Linux之LAMP架构搭建配置 LAMP简介 LAMP定义指Linux(操作系统).ApacheHTTP 服务器,MySQL(有时也指MariaDB,数据库软件) 和PHP(有时也是指Perl或Python) 的第一个字母,一般用来建立web应用平台. 对于大流量.大并发量的网站系统架构来说,除了硬件上使用高性能的服务器.负载均衡.CDN 等之外,在软件架构上需要重点关注下面几个环节: 使用高性能的操作系统 (OS) . 高性能的网页服务器 (Web Server) .高性能的数据库(Data

GOLDENGATE安装与数据复制流搭建配置_不含DDL抽取版

GOLDENGATE安装与数据复制流搭建配置 (源库为实例,支持ASM,不含DDL抽取版) 1.配置场景 2.OGG软件安装 2.1 源端和目标端创建OGG安装目录与授权 #mkdir /u01/ogg #chown –R oracle:oinstall/u01/ogg #chmod –R 777/u01/ogg 2.2 源端和目标端配置环境变量 #su – oracle [[email protected]~]$ vi.bash_profile 添加以下内容: export OGG=/u01/

Samba服务器搭建配置

本次环境: 服务端-centos6.8-192.168.2.200 客户端1-centos6.8-192.168.2.201 客户端2-Windows7-192.168.2.104 假设条件如下: 使用者认证层级设定 (security) 为: user 用户密码档案使用 TDB 数据库格式,默认档案在 /var/lib/samba/private/ 内: 密码必须要加密: 每个可使用 samba 的使用者均拥有自己的家目录: 设定三个用户,名称为 smb1, smb2, smb3 ,且均加入

httpd(2.2&2.4)RPM搭建配置定义详解

一.RPM包安装配置程序环境 1.CentOS6系列(默认httpd2.2) (1)配置文件:/etc/httpd/conf/httpd.conf.  /etc/httpd/conf.d/*.conf() (2)服务脚本:/etc/rc.d/init.d/httpd 配置文件:/etc/sysconfig/httpd (3)主程序文件:/usr/sbin/httpd.  /usr/sbin/httpd.event.  /usr/sbin/httpd.worker (4)日志文件目录:/var/l