openstack n版多节点HA配置

架构
controller1:10.0.10.61
controller1:10.0.10.62
vip:10.0.10.63
computer2:10.0.10.64
computer2:10.0.10.65
cinder:10.0.10.63
mysql:10.0.10.63
rabbitmq:10.0.10.63
配置变量,下面配置时候用这些变量

export con1=10.0.10.61
export con2=10.0.10.62
export vip=10.0.10.63
export com1=10.0.10.64
export com2=10.0.10.65
export myip=10.0.10.63
export rabip=10.0.10.63
export cin=10.0.10.63

{any}:表示任意控制节点执行即可
{all}:表示所有控制节点执行
{one}:第一个控制节点执行
{two}:第二个控制节点执行
{mysql}:mysql节点执行

前置条件

关闭防火墙,时间同步,hosts配置,找一个国内的openstack yum源
163源:
http://mirrors.163.com/centos/7/cloud/x86_64/openstack-newton/

iptables -F
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
yum install -y ntp
ntpdate time.windows.com
systemctl start ntpd
systemctl enable ntpd

{mysql} mysql 配置

安装

yum -y install mariadb mariadb-server python2-PyMySQL

配置

[mysqld]
bind-address = 10.0.10.63
default-storage-engine = innodb
innodb_file_per_table
max_connections = 10000
collation-server = utf8_general_ci
character-set-server = utf8

启动

systemctl enable mariadb.service
systemctl start mariadb.service
systemctl status mariadb.service

初始化

mysql_secure_installation

{rab}rabbitmq

安装

yum install rabbitmq-server -y

启动

systemctl start rabbitmq-server
systemctl enable rabbitmq-server
systemctl status rabbitmq-server

添加用户

rabbitmqctl add_user openstack openstack
rabbitmqctl set_permissions openstack ".*" ".*" ".*"

开启web管理插件

/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management
systemctl restart rabbitmq-server

访问web控制台

http://10.0.10.63:15672
密码:guest/guest

memcached

{all}安装并启动

yum install memcached python-memcached -y
systemctl start memcached
systemctl enable memcached
systemctl status memcached

安装客户端及配置工具

yum -y install python-openstackclient openstack-selinux  openstack-utils  python2-PyMySQL

keystone

{mysql}mysql

mysql -uroot -pmysql -e "CREATE DATABASE keystone;"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%'  IDENTIFIED BY 'keystone';"

{one} 安装

yum install openstack-keystone httpd mod_wsgi -y

{one}配置

openstack-config --set /etc/keystone/keystone.conf database connection mysql+pymysql://keystone:keystone@${myip}/keystone
openstack-config --set /etc/keystone/keystone.conf token provider fernet

{one}同步数据库

su -s /bin/sh -c "keystone-manage db_sync" keystone

{one}初始化 fernet key

keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone

{one} bootstrap identity service

keystone-manage bootstrap --bootstrap-password admin \
  --bootstrap-admin-url http://${vip}:35357/v3/ \
  --bootstrap-internal-url http://${vip}:35357/v3/ \
  --bootstrap-public-url http://${vip}:5000/v3/ \
  --bootstrap-region-id RegionOne

{one} 配置http

/etc/httpd/conf/httpd.conf
ServerName 10.0.10.61

/etc/httpd/conf.d/wsgi-keystone.conf
修改监听地址加上IP地址

ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/

{one}启动http

systemctl enable httpd.service
systemctl start httpd.service

{two} 安装

yum install openstack-keystone httpd mod_wsgi -y

{two}配置

openstack-config --set /etc/keystone/keystone.conf database connection mysql+pymysql://keystone:keystone@${myip}/keystone
openstack-config --set /etc/keystone/keystone.conf token provider fernet

{two}初始化 fernet key

copy 第一个节点/etc/keystone/下的fernet目录和credential目录

{two} 配置http

/etc/httpd/conf/httpd.conf
ServerName 10.0.10.62

/etc/httpd/conf.d/wsgi-keystone.conf
修改监听地址加上IP地址

ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/

{two}启动http

systemctl enable httpd.service
systemctl start httpd.service

haproxy配置

yum install haproxy

listen status
    bind :1080
    mode http
    log global
    stats refresh 30s
    stats uri /admin?stats
    stats auth admin:admin

listen keystone_35357
    bind :35357
    balance source
    mode http
    server op61 10.0.10.61:35357 check inter 2000 rise 3 fall 2 weight 1
    server op62 10.0.10.62:35357 check inter 2000 rise 3 fall 2 weight 1

listen keystone_5000
    bind :5000
    balance source
    mode http
    server op61 10.0.10.61:5000 check inter 2000 rise 3 fall 2 weight 1
    server op62 10.0.10.62:5000 check inter 2000 rise 3 fall 2 weight 1

{one} 创建endpoint

export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://${vip}:35357/v3
export OS_IDENTITY_API_VERSION=3

openstack project create --domain default  --description "Service Project" service        
openstack project create --domain default  --description "Demo Project" demo   
openstack user create --domain default demo --password demo
openstack role create user                                           
openstack role add --project demo --user demo user

{all} 验证

unset OS_URL
unset OS_USERNAME
unset OS_PASSWORD
unset OS_PROJECT_NAME
unset OS_USER_DOMAIN_NAME
unset OS_PROJECT_DOMAIN_NAME
unset OS_AUTH_URL
openstack --os-auth-url http://${vip}:35357/v3 \
  --os-project-domain-name default --os-user-domain-name default \
  --os-project-name admin --os-username admin token issue
  
openstack --os-auth-url http://${vip}:5000/v3 \
  --os-project-domain-name default --os-user-domain-name default \
  --os-project-name demo --os-username demo token issue

{all} 创建环境变量脚本

vi admin-openrc.sh
export vip=10.0.10.63
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_AUTH_URL=http://${vip}:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2

vi demo-openrc.sh
export vip=10.0.10.63
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=demo
export OS_AUTH_URL=http://${vip}:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2

glance

{mysql} mysql

mysql -uroot -pmysql -e "CREATE DATABASE glance;"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost'   IDENTIFIED BY 'glance';"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glance';"

{one} 创建endpoint

source admin-openrc.sh
openstack user create --domain default glance --password glance
openstack role add --project service --user glance admin
openstack service create --name glance --description "OpenStack Image" image
openstack endpoint create --region RegionOne  image public http://${vip}:9292
openstack endpoint create --region RegionOne  image internal http://${vip}:9292
openstack endpoint create --region RegionOne  image admin http://${vip}:9292

{one}安装

yum install openstack-glance -y

{one}配置

openstack-config --set /etc/glance/glance-api.conf database connection mysql+pymysql://glance:glance@${myip}/glance
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken memcached_servers ${con1}:11211
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_type password
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken project_name service
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken username glance
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken password glance
openstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystone
openstack-config --set /etc/glance/glance-api.conf glance_store stores file,http
openstack-config --set /etc/glance/glance-api.conf glance_store default_store file
openstack-config --set /etc/glance/glance-api.conf glance_store filesystem_store_datadir /var/lib/glance/images/
openstack-config --set /etc/glance/glance-registry.conf database connection mysql+pymysql://glance:glance@${myip}/glance
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken memcached_servers ${con1}:11211
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_type password
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken project_name service
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken username glance
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken password glance
openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone

{one}同步数据库

su -s /bin/sh -c "glance-manage db_sync" glance

{one}启动

systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service

{two}安装

yum install openstack-glance -y

{two}配置

openstack-config --set /etc/glance/glance-api.conf database connection mysql+pymysql://glance:glance@${myip}/glance
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken memcached_servers ${con2}:11211
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_type password
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken project_name service
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken username glance
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken password glance
openstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystone
openstack-config --set /etc/glance/glance-api.conf glance_store stores file,http
openstack-config --set /etc/glance/glance-api.conf glance_store default_store file
openstack-config --set /etc/glance/glance-api.conf glance_store filesystem_store_datadir /var/lib/glance/images/
openstack-config --set /etc/glance/glance-registry.conf database connection mysql+pymysql://glance:glance@${myip}/glance
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken memcached_servers ${con2}:11211
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_type password
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken project_name service
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken username glance
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken password glance
openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone

{two}启动

systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service

{one,two}下载测试镜像

wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img

haproxy配置

listen glance_9292
    bind :9292
    balance source
    mode http
    server op61 10.0.10.61:9292 check inter 2000 rise 3 fall 2 weight 1
    server op62 10.0.10.62:9292 check inter 2000 rise 3 fall 2 weight 1

listen glance_9191
    bind :9191
    balance source
    mode http
    server op61 10.0.10.61:9191 check inter 2000 rise 3 fall 2 weight 1
    server op62 10.0.10.62:9191 check inter 2000 rise 3 fall 2 weight 1

{one,two}验证

{one}上传镜像

openstack image create "cirros-1"  --file cirros-0.3.4-x86_64-disk.img   --disk-format qcow2 --container-format bare   --public

{two}上传镜像

openstack image create "cirros-2"  --file cirros-0.3.4-x86_64-disk.img   --disk-format qcow2 --container-format bare   --public

{one,two}

openstack image list

nova

{mysql}mysql

mysql -uroot -pmysql -e "CREATE DATABASE nova_api;"
mysql -uroot -pmysql -e "CREATE DATABASE nova;"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost'   IDENTIFIED BY 'nova';"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%'   IDENTIFIED BY 'nova';"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost'   IDENTIFIED BY 'nova';"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%'   IDENTIFIED BY 'nova';"

{one}创建endpoint

openstack user create --domain default nova  --password nova
openstack role add --project service --user nova admin
openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --region RegionOne   compute public http://${vip}:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region RegionOne   compute internal http://${vip}:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region RegionOne   compute admin http://${vip}:8774/v2.1/%\(tenant_id\)s

{one}安装

yum install -y openstack-nova-api openstack-nova-conductor  openstack-nova-console openstack-nova-novncproxy   openstack-nova-scheduler

{one}配置

openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
openstack-config --set /etc/nova/nova.conf api_database connection mysql+pymysql://nova:nova@${myip}/nova_api
openstack-config --set /etc/nova/nova.conf database connection mysql+pymysql://nova:nova@${myip}/nova
openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host ${rabip}
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password openstack
openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers ${con1}: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 nova
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip ${con1}
openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron  True
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
openstack-config --set /etc/nova/nova.conf vnc vncserver_listen ${con1}
openstack-config --set /etc/nova/nova.conf vnc vncserver_proxyclient_address ${con1}
openstack-config --set /etc/nova/nova.conf glance api_servers http://${vip}:9292
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp

{one}同步数据库

su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage db sync" nova

{one}启动服务

systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service  openstack-nova-conductor.service openstack-nova-novncproxy.service

nova 计算服务(控制节点也作为计算节点)

{one}安装

yum install -y openstack-nova-compute

{one}配置(因为该节点也是控制节点所有有些配置上面已经配置过了)

openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host ${rabip}
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password openstack
openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers ${con1}: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 nova
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip ${con1}
openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron  True
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
openstack-config --set /etc/nova/nova.conf vnc enable True
openstack-config --set /etc/nova/nova.conf vnc vncserver_listen 0.0.0.0
openstack-config --set /etc/nova/nova.conf vnc vncserver_proxyclient_address ${con1}
openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://${vip}:6080/vnc_auto.html
openstack-config --set /etc/nova/nova.conf glance api_servers http://${vip}:9292
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp

{one}配置虚拟类型

若是虚拟机环境则

openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu

若是物理机则

openstack-config --set /etc/nova/nova.conf libvirt virt_type kvm

{one}启动

systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
systemctl status libvirtd.service openstack-nova-compute.service

{two}安装

yum install -y openstack-nova-api openstack-nova-conductor  openstack-nova-console openstack-nova-novncproxy   openstack-nova-scheduler

{two}配置

openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
openstack-config --set /etc/nova/nova.conf api_database connection mysql+pymysql://nova:nova@${myip}/nova_api
openstack-config --set /etc/nova/nova.conf database connection mysql+pymysql://nova:nova@${myip}/nova
openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host ${rabip}
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password openstack
openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers ${con2}: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 nova
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip ${con2}
openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron  True
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
openstack-config --set /etc/nova/nova.conf vnc vncserver_listen ${con2}
openstack-config --set /etc/nova/nova.conf vnc vncserver_proxyclient_address ${con2}
openstack-config --set /etc/nova/nova.conf glance api_servers http://${vip}:9292
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp

{two}启动服务

systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service  openstack-nova-conductor.service openstack-nova-novncproxy.service

nova 计算服务(控制节点也作为计算节点)

{two}安装

yum install -y openstack-nova-compute

{two}配置(因为该节点也是控制节点所有有些配置上面已经配置过了)

openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host ${rabip}
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password openstack
openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers ${con2}: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 nova
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip ${con2}
openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron  True
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
openstack-config --set /etc/nova/nova.conf vnc enable True
openstack-config --set /etc/nova/nova.conf vnc vncserver_listen 0.0.0.0
openstack-config --set /etc/nova/nova.conf vnc vncserver_proxyclient_address ${con2}
openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://${vip}:6080/vnc_auto.html
openstack-config --set /etc/nova/nova.conf glance api_servers http://${vip}:9292
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp

{two}配置虚拟类型

若是虚拟机环境则

openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu

若是物理机则

openstack-config --set /etc/nova/nova.conf libvirt virt_type kvm

{two}启动

systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
systemctl status libvirtd.service openstack-nova-compute.service

haproxy配置

listen nova_8774
    bind :8774
    balance source
    mode http
    server op61 10.0.10.61:8774 check inter 2000 rise 3 fall 2 weight 1
    server op62 10.0.10.62:8774 check inter 2000 rise 3 fall 2 weight 1

listen vnc_6080
    bind :6080
    balance source
    mode http
    server op61 10.0.10.61:6080 check inter 2000 rise 3 fall 2 weight 1
    server op62 10.0.10.62:6080 check inter 2000 rise 3 fall 2 weight 1

{one,two}验证

openstack compute service list

dashboard

{one}安装

yum install -y openstack-dashboard

{one}配置

/etc/openstack-dashboard/local_settings
OPENSTACK_HOST = "10.0.10.61"
ALLOWED_HOSTS = ['*', ]
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

CACHES = {
    'default': {
         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
         'LOCATION': '10.0.10.61:11211',
    }
}

OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST

OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True

OPENSTACK_API_VERSIONS = {
    "identity": 3,
    "image": 2,
    "volume": 2,
}

OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "default"

OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"

TIME_ZONE = "TIME_ZONE"

{one}重启

systemctl restart httpd.service memcached.service

{two}安装

yum install -y openstack-dashboard

{two}配置

/etc/openstack-dashboard/local_settings
OPENSTACK_HOST = "10.0.10.62"
ALLOWED_HOSTS = ['*', ]
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

CACHES = {
    'default': {
         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
         'LOCATION': '10.0.10.62:11211',
    }
}

OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST

OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True

OPENSTACK_API_VERSIONS = {
    "identity": 3,
    "image": 2,
    "volume": 2,
}

OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "default"

OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"

TIME_ZONE = "TIME_ZONE"

如果是copy另一个节点的配置文件不要忘了改下权限

{two}重启

systemctl restart httpd.service memcached.service

haproxy配置

listen dashboard_80
    bind :80
    balance source
    mode http
    server op61 10.0.10.61:80 check inter 2000 rise 3 fall 2 weight 1
    server op62 10.0.10.62:80 check inter 2000 rise 3 fall 2 weight 1

cinder

{mysql} mysql

mysql -uroot -pmysql -e "CREATE DATABASE cinder;"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost'  IDENTIFIED BY 'cinder';"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%'  IDENTIFIED BY 'cinder';"

{one}创建endpoint

openstack user create --domain default cinder --password cinder
openstack role add --project service --user cinder admin
openstack service create --name cinder   --description "OpenStack Block Storage" volume
openstack service create --name cinderv2   --description "OpenStack Block Storage" volumev2
openstack endpoint create --region RegionOne   volume public http://${vip}:8776/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne   volume internal http://${vip}:8776/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne   volume admin http://${vip}:8776/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne   volumev2 public http://${vip}:8776/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne   volumev2 internal http://${vip}:8776/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne   volumev2 admin http://${vip}:8776/v2/%\(tenant_id\)s

{one}安装

yum install -y openstack-cinder  

{one}配置

openstack-config --set /etc/cinder/cinder.conf database connection mysql+pymysql://cinder:cinder@${myip}/cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_host ${rabip}
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_password openstack
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken memcached_servers ${con1}:11211
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_type password
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_name service
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken username cinder
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken password cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip ${con1}
openstack-config --set /etc/cinder/cinder.conf oslo_concurrency lock_path /var/lib/cinder/tmp

{one}同步数据

su -s /bin/sh -c "cinder-manage db sync" cinder

{one}配置nova

openstack-config --set /etc/nova/nova.conf cinder os_region_name RegionOne

{one}重启nova,启动服务

systemctl restart openstack-nova-api.service
systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

{two}安装

yum install -y openstack-cinder  

{two}配置

openstack-config --set /etc/cinder/cinder.conf database connection mysql+pymysql://cinder:cinder@${myip}/cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_host ${rabip}
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_password openstack
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken memcached_servers ${con2}:11211
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_type password
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_name service
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken username cinder
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken password cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip ${con2}
openstack-config --set /etc/cinder/cinder.conf oslo_concurrency lock_path /var/lib/cinder/tmp

{two}配置nova

openstack-config --set /etc/nova/nova.conf cinder os_region_name RegionOne

{two}重启nova,启动服务

systemctl restart openstack-nova-api.service
systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

haproxy配置

listen cinder_8776
    bind :8776
    balance source
    mode http
    server op61 10.0.10.61:8776 check inter 2000 rise 3 fall 2 weight 1
    server op62 10.0.10.62:8776 check inter 2000 rise 3 fall 2 weight 1

cinder storage node

本例安装一个存储节点,采用lvm,暂时不考虑后端存储高可用

安装

yum -y install lvm2
systemctl enable lvm2-lvmetad.service
systemctl start lvm2-lvmetad.service

创建pv,vg

pvcreate /dev/sdb
vgcreate cinder-volumes /dev/sdb

修改lvm.conf过滤规则

/etc/lvm/lvm.conf
devices {
...
filter = [ "a/sdb/", "r/.*/"]

warning:若system in LVM disk 则
filter = [ "a/sda/", "a/sdb/", "r/.*/"]

安装包

yum install -y openstack-cinder targetcli python-keystone

配置

/etc/cinder/cinder.conf
openstack-config --set /etc/cinder/cinder.conf database connection mysql+pymysql://cinder:cinder@${myip}/cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_host ${rabip}
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_rabbit rabbit_password openstack
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken memcached_servers ${con1}:11211
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_type password
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_name service
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken username cinder
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken password cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip ${cin}
openstack-config --set /etc/cinder/cinder.conf oslo_concurrency lock_path /var/lib/cinder/tmp
openstack-config --set /etc/cinder/cinder.conf lvm volume_driver cinder.volume.drivers.lvm.LVMVolumeDriver
openstack-config --set /etc/cinder/cinder.conf lvm volume_group cinder-volumes
openstack-config --set /etc/cinder/cinder.conf lvm iscsi_protocol iscsi
openstack-config --set /etc/cinder/cinder.conf lvm iscsi_helper lioadm
openstack-config --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm
openstack-config --set /etc/cinder/cinder.conf DEFAULT glance_api_servers http://${vip}:9292

启动

systemctl enable openstack-cinder-volume.service target.service
systemctl start openstack-cinder-volume.service target.service

{one,two}验证

cinder service-list

neutron

{mysql}mysql

mysql -uroot -pmysql -e "CREATE DATABASE neutron;"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost'   IDENTIFIED BY 'neutron';"
mysql -uroot -pmysql -e "GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%'   IDENTIFIED BY 'neutron';"

{one}创建挂载点

openstack user create --domain default neutron --password neutron
openstack role add --project service --user neutron admin
openstack service create --name neutron   --description "OpenStack Networking" network
openstack endpoint create --region RegionOne   network public http://${vip}:9696
openstack endpoint create --region RegionOne   network internal http://${vip}:9696
openstack endpoint create --region RegionOne   network admin http://${vip}:9696

{one}安装

yum install -y openstack-neutron openstack-neutron-ml2  openstack-neutron-linuxbridge ebtables

{one}修改内核配置

/etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
sysctl -p

{one}配置

注意替换其中的网卡名

openstack-config --set /etc/neutron/neutron.conf database connection mysql+pymysql://neutron:neutron@${myip}/neutron
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 allow_overlapping_ips True
openstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_host ${rabip}
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_password openstack
openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers ${con1}: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 neutron
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 nova auth_url http://${vip}:35357
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 nova
openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers flat,vlan,vxlan
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,l2population
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
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset True
#openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings provider:ens160
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 ${con1}
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 True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
openstack-config --set /etc/neutron/l3_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
openstack-config --set /etc/neutron/l3_agent.ini DEFAULT external_network_bridge
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
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
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_ip ${vip}
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret metadata
openstack-config --set /etc/neutron/neutron.conf DEFAULT l3_ha True
openstack-config --set /etc/neutron/neutron.conf DEFAULT max_l3_agents_per_router 3
openstack-config --set /etc/neutron/neutron.conf DEFAULT min_l3_agents_per_router 2
openstack-config --set /etc/neutron/neutron.conf DEFAULT dhcp_agents_per_network 2

{one}nova

openstack-config --set /etc/nova/nova.conf neutron url http://${vip}:9696
openstack-config --set /etc/nova/nova.conf neutron auth_url http://${vip}:35357
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 neutron
openstack-config --set /etc/nova/nova.conf neutron service_metadata_proxy True
openstack-config --set /etc/nova/nova.conf neutron metadata_proxy_shared_secret metadata

{one}同步数据

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

{one}启动服务

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

********************************************************************************8

{two}安装

yum install -y openstack-neutron openstack-neutron-ml2  openstack-neutron-linuxbridge ebtables

{two}修改内核配置

/etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
sysctl -p

{two}配置

注意替换其中的网卡名

openstack-config --set /etc/neutron/neutron.conf database connection mysql+pymysql://neutron:neutron@${myip}/neutron
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 allow_overlapping_ips True
openstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_host ${rabip}
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_password openstack
openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers ${con2}: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 neutron
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 nova auth_url http://${vip}:35357
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 nova
openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers flat,vlan,vxlan
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,l2population
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
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset True
#openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings provider:ens160
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 ${con2}
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 True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
openstack-config --set /etc/neutron/l3_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
openstack-config --set /etc/neutron/l3_agent.ini DEFAULT external_network_bridge
openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
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
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_ip ${vip}
openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret metadata
openstack-config --set /etc/neutron/neutron.conf DEFAULT l3_ha True
openstack-config --set /etc/neutron/neutron.conf DEFAULT max_l3_agents_per_router 3
openstack-config --set /etc/neutron/neutron.conf DEFAULT min_l3_agents_per_router 2
openstack-config --set /etc/neutron/neutron.conf DEFAULT dhcp_agents_per_network 2

{two}nova

openstack-config --set /etc/nova/nova.conf neutron url http://${vip}:9696
openstack-config --set /etc/nova/nova.conf neutron auth_url http://${vip}:35357
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 neutron
openstack-config --set /etc/nova/nova.conf neutron service_metadata_proxy True
openstack-config --set /etc/nova/nova.conf neutron metadata_proxy_shared_secret metadata

{two}

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

{two}启动服务

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

haproxy配置

listen neutron_9696
    bind :9696
    balance source
    mode http
    server op61 10.0.10.61:9696 check inter 2000 rise 3 fall 2 weight 1
    server op62 10.0.10.62:9696 check inter 2000 rise 3 fall 2 weight 1

neutron compute node

安装

yum install -y openstack-neutron-linuxbridge ebtables ipset

{one}修改内核配置

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

配置

openstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_host ${rabip}
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_password openstack
openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://${vip}:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://${vip}:35357
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers ${con1}: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 neutron
openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp
#openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings provider:ens160
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 ${MYIP}
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 True
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_drive neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
openstack-config --set /etc/nova/nova.conf neutron url http://${vip}:9696
openstack-config --set /etc/nova/nova.conf neutron auth_url http://${vip}:35357
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 neutron

启动

systemctl restart openstack-nova-compute.service
systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service

验证

neutron ext-list
neutron agent-list
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,332评论 6 493
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,508评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,812评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,607评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,728评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,919评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,071评论 3 410
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,802评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,256评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,576评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,712评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,389评论 4 332
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,032评论 3 316
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,798评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,026评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,473评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,606评论 2 350

推荐阅读更多精彩内容

  • Nova Nova,即计算服务,是OpenStack计算的弹性控制器。Nova可以说是整个云平台最重要的组件,Op...
    邵胜奥阅读 4,145评论 0 8
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,637评论 18 139
  • Openstack Mitaka安装部署教程 一、实验环境: 系统:centos7.2-minimal 网络:管理...
    指间_流年阅读 2,190评论 0 0
  • 一、安装 Nova 前的准备 1. 为KeyStone配置数据库 提示:以下操作在控制节点完成,为计算服务创建数据...
    野狗子嗷嗷嗷阅读 1,147评论 0 1
  • 辗转难眠的夜晚,淅沥的雨声,就是惆怅的,注定无法安睡的,本是一个极其容易入睡的人,天性乐观,大哭大笑的人,随着时间...
    憨豆妹阅读 147评论 0 0