OpenStack技术:介绍及安装(ocata版本安装)

openstack私有云

1.虚拟化管理平台

kvm宿主机 500台

kvm虚拟机 5000台

kvm虚拟机的特点: 虚拟机内部不是透明的,容器内部是透明的

统计centos7.6 系统的虚拟机有多少台?

每个虚拟机的ip地址

统计4c8g 虚拟机数量 2c4g 虚拟机数量

资产表 excel文件

kvm管理平台: 小规模:ovirt WebVirtMgr cloudstack zstack Proxmox VE…

大规模:openstack 阿里专有云 腾讯专有云 青云 ucloud…

2.云计算发展历史

kvm管理平台 + 计费系统 == 公有云

亚马逊 2006年上线aws 公有云

阿里云 2011年上线

openstack 2012年 飞速发展 2017年 国内云厂商大规模倒闭

openstack 基于apache 2.0

3.openstack介绍

一开始模仿aws,后来加入自己的特色,兼容aws,开源,社区非常活跃

半年更新一次版本

A,B,C,D…K版L M N O Pike Q R S T U V W X Y Z版

L版的中文官方文档https://docs.openstack.org/liberty/zh_CN/install-guide-rdo/

M版的中文官方文档https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/

N版的中文官方文档https://docs.openstack.org/newton/zh_CN/install-guide-rdo/

最后一个中文版:https://docs.openstack.org/ocata/zh_CN/install-guide-rdo/

P版开始,官方文档大变样,不适合新手学习

T版以后,需要centos8的系统

4.openstack架构

模仿aws,大规模的云平台产品
在这里插入图片描述

5.openstack集群环境准备

在这里插入图片描述

5.1 yum源配置

openstack-ocata版清华源
rm  -fr  /etc/yum.repos.d/local.repo

yum源配置
[root@test yum.repos.d]# vim CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
baseurl=https://mirror.tuna.tsinghua.edu.cn/centos-vault/7.6.1810/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirror.tuna.tsinghua.edu.cn/centos-vault/7.6.1810/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirror.tuna.tsinghua.edu.cn/centos-vault/7.6.1810/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

yum makecache 
yum install centos-release-openstack-ocata.noarch -y

[root@test yum.repos.d]# vim CentOS-Ceph-Jewel.repo:
baseurl=https://mirror.tuna.tsinghua.edu.cn/centos-vault/7.6.1810/storage/x86_64/ceph-jewel/

[root@test yum.repos.d]# vim CentOS-OpenStack-ocata.repo:
baseurl=https://mirror.tuna.tsinghua.edu.cn/centos-vault/7.6.1810/cloud/x86_64/openstack-ocata/

[root@test yum.repos.d]# vim CentOS-QEMU-EV.repo:
baseurl=https://mirror.tuna.tsinghua.edu.cn/centos-vault/7.6.1810/virt/x86_64/kvm-common/

5.2安装基础服务

安装openstack客户端

#所有节点
yum install python-openstackclient -y

数据库安装

#控制节点
#安装
yum install mariadb mariadb-server python2-PyMySQL -y
​
#配置
vi /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 10.0.0.11
​
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
​
#启动
systemctl start mariadb
systemctl enable mariadb
​
#安全初始化
mysql_secure_installation
回车
n
y
y
y
y
​
#验证
[root@controller ~]# netstat -lntup|grep 3306
tcp        0      0 10.0.0.11:3306          0.0.0.0:*               LISTEN      23304/mysqld   

安装消息队列

#控制节点
#安装
yum install rabbitmq-server -y
#启动
systemctl start rabbitmq-server.service 
systemctl enable rabbitmq-server.service
#验证
[root@controller ~]# netstat -lntup|grep 5672
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      23847/beam          
tcp6       0      0 :::5672                 :::*                    LISTEN      23847/beam  
​
#创建用户并授权
rabbitmqctl add_user openstack RABBIT_PASS
rabbitmqctl set_permissions openstack ".*" ".*" ".*"

安装memcache缓存

#控制节点
#安装
yum install memcached python-memcached -y
#配置
vim /etc/sysconfig/memcached
OPTIONS="-l 10.0.0.11"
#启动
systemctl start memcached.service 
systemctl enable memcached.service
#验证
[root@controller ~]# netstat -lntup|grep 11211
tcp        0      0 10.0.0.11:11211         0.0.0.0:*               LISTEN      24519/memcached     
udp        0      0 10.0.0.11:11211         0.0.0.0:*                           24519/memcached 

5.3安装keystone

#控制节点
创建数据库

CREATE DATABASE keystone;
 GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
IDENTIFIED BY 'KEYSTONE_DBPASS';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
IDENTIFIED BY 'KEYSTONE_DBPASS';

安装keystone软件包

yum install openstack-keystone httpd mod_wsgi -y

修改配置文件

cp /etc/keystone/keystone.conf /etc/keystone/keystone.conf.bak
grep -Ev '^$|^#' /etc/keystone/keystone.conf.bak >/etc/keystone/keystone.conf
vim /etc/keystone/keystone.conf
[DEFAULT]
[assignment]
[auth]
[cache]
[catalog]
[cors]
[cors.subdomain]
[credential]
[database]
connection = mysql+pymysql://keystone:KEYSTONE_DBPASS@controller/keystone
[domain_config]
[endpoint_filter]
[endpoint_policy]
[eventlet_server]
[federation]
[fernet_tokens]
[healthcheck]
[identity]
[identity_mapping]
[kvs]
[ldap]
[matchmaker_redis]
[memcache]
[oauth1]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[paste_deploy]
[policy]
[profiler]
[resource]
[revoke]
[role]
[saml]
[security_compliance]
[shadow_users]
[signing]
[token]
provider = fernet
[tokenless_auth]
[trust]

同步数据库


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

初始化fernet

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

初始化keystone

keystone-manage bootstrap --bootstrap-password ADMIN_PASS \
  --bootstrap-admin-url http://controller:35357/v3/ \
  --bootstrap-internal-url http://controller:5000/v3/ \
  --bootstrap-public-url http://controller:5000/v3/ \
  --bootstrap-region-id RegionOne

配置httpd

echo "ServerName controller" >>/etc/httpd/conf/httpd.conf
ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/

启动httpd

systemctl start httpd
systemctl enable httpd

验证keystone

vim  admin-openrc
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
​
vim /root/.bashrc
source admin-openrc

获取token测试

openstack token issue

创建services项目

openstack project create --domain default \
  --description "Service Project" service

5.4安装glance

#控制节点
1:创建数据库,授权

CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
  IDENTIFIED BY 'GLANCE_DBPASS';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
  IDENTIFIED BY 'GLANCE_DBPASS';

2:在keystone创建服务用户,并关联角色

openstack user create --domain default --password GLANCE_PASS  glance
openstack role add --project service --user glance admin

3:在keystone上注册api访问地址

openstack service create --name glance \
  --description "OpenStack Image" image
openstack endpoint create --region RegionOne \
  image public http://controller:9292
openstack endpoint create --region RegionOne \
  image internal http://controller:9292
openstack endpoint create --region RegionOne \
  image admin http://controller:9292

4:安装软件包

yum install openstack-glance -y

5:修改配置文件

修改glance-api配置文件

cp /etc/glance/glance-api.conf /etc/glance/glance-api.conf.bak
grep -Ev '^$|^#' /etc/glance/glance-api.conf.bak >/etc/glance/glance-api.conf
vim /etc/glance/glance-api.conf
[DEFAULT]
[cors]
[cors.subdomain]
[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
[image_format]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = GLANCE_PASS
[matchmaker_redis]
[oslo_concurrency]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[paste_deploy]
flavor = keystone
[profiler]
[store_type_location_strategy]
[task]
[taskflow_executor]

修改glance-registry配置文件

cp /etc/glance/glance-registry.conf /etc/glance/glance-registry.conf.bak
grep -Ev '^$|^#' /etc/glance/glance-registry.conf.bak >/etc/glance/glance-registry.conf
vim /etc/glance/glance-registry.conf
[DEFAULT]
[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = GLANCE_PASS
[matchmaker_redis]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_policy]
[paste_deploy]
flavor = keystone
[profiler]

6:同步数据库

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

7:启动服务

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

8:验证

#上传镜像cirros-0.3.4-x86_64-disk.img
openstack image create "cirros"   --file cirros-0.3.4-x86_64-disk.img   --disk-format qcow2 --container-format bare   --public

5.5.安装nova

5.5.1控制节点

1:创建数据库,授权

CREATE DATABASE nova_api;
CREATE DATABASE nova;
CREATE DATABASE nova_cell0;
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
  IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
  IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
  IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
  IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' \
  IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \
  IDENTIFIED BY 'NOVA_DBPASS';

2:在keystone创建服务用户,并关联角色

openstack user create --domain default --password NOVA_PASS  nova
openstack role add --project service --user nova admin
openstack user create --domain default --password PLACEMENT_PASS placement
openstack role add --project service --user placement admin

3:在keystone上注册api访问地址

openstack service create --name nova \
  --description "OpenStack Compute" 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
openstack service create --name placement --description "Placement API" placement
openstack endpoint create --region RegionOne placement public http://controller:8778
openstack endpoint create --region RegionOne placement internal http://controller:8778
openstack endpoint create --region RegionOne placement admin http://controller:8778

4:安装软件包

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

5:修改配置文件

修改nova配置文件

cp /etc/nova/nova.conf /etc/nova/nova.conf.bak
grep -Ev '^$|^#' /etc/nova/nova.conf.bak >/etc/nova/nova.conf
vim /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:RABBIT_PASS@controller
my_ip = 10.0.0.11
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy = keystone
[api_database]
connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api
[barbican]
[cache]
[cells]
[cinder]
[cloudpipe]
[conductor]
[console]
[consoleauth]
[cors]
[cors.subdomain]
[crypto]
[database]
connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers = http://controller:9292
[guestfs]
[healthcheck]
[hyperv]
[image_file_url]
[ironic]
[key_manager]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = NOVA_PASS
[libvirt]
[matchmaker_redis]
[metrics]
[mks]
[neutron]
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:35357/v3
username = placement
password = PLACEMENT_PASS
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[ssl]
[trusted_computing]
[upgrade_levels]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled = true
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[workarounds]
[wsgi]
[xenserver]
[xvp]

修改placement配置


vim /etc/httpd/conf.d/00-nova-placement-api.conf
#在</VirtualHost>前插入以下内容
<Directory /usr/bin>
   <IfVersion >= 2.4>
      Require all granted
   </IfVersion>
   <IfVersion < 2.4>
      Order allow,deny
      Allow from all
   </IfVersion>
</Directory>

启动placement

systemctl restart httpd

6:同步数据库

su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
su -s /bin/sh -c "nova-manage db sync" nova

验证

nova-manage cell_v2 list_cells

7:启动服务

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

8:验证

nova service-list

5.5.2计算节点

1.安装

yum install openstack-nova-compute -y

2.配置

cp /etc/nova/nova.conf /etc/nova/nova.conf.bak
grep -Ev '^$|^#' /etc/nova/nova.conf.bak >/etc/nova/nova.conf
vim /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:RABBIT_PASS@controller
my_ip = 10.0.0.31
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy = keystone
[api_database]
[barbican]
[cache]
[cells]
[cinder]
[cloudpipe]
[conductor]
[console]
[consoleauth]
[cors]
[cors.subdomain]
[crypto]
[database]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers = http://controller:9292
[guestfs]
[healthcheck]
[hyperv]
[image_file_url]
[ironic]
[key_manager]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = NOVA_PASS
[libvirt]
[matchmaker_redis]
[metrics]
[mks]
[neutron]
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:35357/v3
username = placement
password = PLACEMENT_PASS
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[ssl]
[trusted_computing]
[upgrade_levels]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
[workarounds]
[wsgi]
[xenserver]
[xvp]

3.启动

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

重要步骤

控制节点

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

5.6安装neutron

5.6.1控制节点

1:创建数据库,授权

CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
  IDENTIFIED BY 'NEUTRON_DBPASS';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
  IDENTIFIED BY 'NEUTRON_DBPASS';

2:在keystone创建服务用户,并关联角色

openstack user create --domain default --password NEUTRON_PASS  neutron
openstack role add --project service --user neutron admin

3:在keystone上注册api访问地址

openstack service create --name neutron \
  --description "OpenStack Networking" network
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

4:安装软件包

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

5:修改配置文件

修改neutron配置文件

cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
grep -Ev '^$|^#' /etc/neutron/neutron.conf.bak >/etc/neutron/neutron.conf
vim /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins =
transport_url = rabbit://openstack:RABBIT_PASS@controller
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true
[agent]
[cors]
[cors.subdomain]
[database]
connection = mysql+pymysql://neutron:NEUTRON_DBPASS@controller/neutron
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = NEUTRON_PASS
[matchmaker_redis]
[nova]
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = NOVA_PASS
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[qos]
[quotas]
[ssl]

修改ml2_conf.in

cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
grep -Ev '^$|^#' /etc/neutron/plugins/ml2/ml2_conf.ini.bak >/etc/neutron/plugins/ml2/ml2_conf.ini
[DEFAULT]
[ml2]
type_drivers = flat,vlan
tenant_network_types =
mechanism_drivers = linuxbridge
extension_drivers = port_security
[ml2_type_flat]
flat_networks = provider
[ml2_type_geneve]
[ml2_type_gre]
[ml2_type_vlan]
[ml2_type_vxlan]
[securitygroup]
enable_ipset = true

修改linuxbridge-agent配置

cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak
grep -Ev '^$|^#' /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak >/etc/neutron/plugins/ml2/linuxbridge_agent.ini
vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[DEFAULT]
[agent]
[linux_bridge]
physical_interface_mappings = provider:eth0
[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[vxlan]
enable_vxlan = false

修改dhcp配置

vim /etc/neutron/dhcp_agent.ini
[DEFAULT]
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true

修改metadata-agent配置

vim /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_ip = controller
metadata_proxy_shared_secret = METADATA_SECRET

修改nova.conf配置

#控制节点
vim /etc/nova/nova.conf
[neutron]
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS
service_metadata_proxy = true
metadata_proxy_shared_secret = METADATA_SECRET

6:同步数据库

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

7:启动服务

systemctl restart openstack-nova-api.service
systemctl start neutron-server.service   neutron-linuxbridge-agent.service neutron-dhcp-agent.service   neutron-metadata-agent.service
systemctl enable neutron-server.service   neutron-linuxbridge-agent.service neutron-dhcp-agent.service   neutron-metadata-agent.service

5.6.2计算节点

1.安装

yum install openstack-neutron-linuxbridge ebtables ipset -y

2.配置

修改neutron.conf

cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
grep -Ev '^$|^#' /etc/neutron/neutron.conf.bak >/etc/neutron/neutron.conf
vim /etc/neutron/neutron.conf
[DEFAULT]
transport_url = rabbit://openstack:RABBIT_PASS@controller
auth_strategy = keystone
[agent]
[cors]
[cors.subdomain]
[database]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = NEUTRON_PASS
[matchmaker_redis]
[nova]
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[qos]
[quotas]
[ssl]

修改linuxbridge_agent.ini

vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[DEFAULT]
[agent]
[linux_bridge]
physical_interface_mappings = provider:eth0
[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[vxlan]
enable_vxlan = false

修改nova.conf

#计算节点
vim  /etc/nova/nova.conf
[neutron]
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS

3.启动

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

5.7安装horizon

1.安装

#计算节点
 yum install openstack-dashboard -y

2.配置

详情,参考官方文档   https://docs.openstack.org/ocata/zh_CN/install-guide-rdo/horizon-install.html

3.启动

systemctl start httpd
systemctl enable httpd

4:访问dashboard
http://10.0.0.31/dashboard

6…启动实例

验证命令

openstack token  issue
openstack image list
nova service-list
neutron  agent-list

1.创建网络
命令行创建

openstack network create --share --external \
--provider-physical-network provider \
--provider-network-type flat wan

web界面创建
在这里插入图片描述
创建子网

命令行

openstack subnet create --network wan \
--allocation-pool
start=10.0.0.100,end=10.0.0.200 \
--dns-nameserver 180.76.76.76 --gateway
10.0.0.254 \
--subnet-range 10.0.0.0/24 10.0.0.0

web界面
在这里插入图片描述
在这里插入图片描述
创建虚拟机硬件配置方案

命令行

openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano

web界面创建
在这里插入图片描述
创建键值对
在这里插入图片描述
在这里插入图片描述
启动实例

命令行

openstack server create --flavor m1.nano --image cirros \
--nic net-id=b571f3b4-cc7b-4f84-a582-889044fb5c04 --security-group default \
--key-name mykey oldboy

在这里插入图片描述
记得修改windows的host解析
在这里插入图片描述

故障解决

在这里插入图片描述

#计算节点
vim /etc/nova/nova.conf
[libvirt]
cpu_mode = none
virt_type = qemu
systemctl restart openstack-novacompute.service
硬重启虚拟机

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值