欢迎来真孝善网,为您提供真孝善正能量书籍故事!

Ubuntu 16.04 Newton OpenStack环境配置指南

时间:11-02 神话故事 提交错误

大家好,如果您还对Ubuntu 16.04 Newton OpenStack环境配置指南不太了解,没有关系,今天就由本站为大家分享Ubuntu 16.04 Newton OpenStack环境配置指南的知识,包括的问题都会给大家分析到,还望可以解决大家的问题,下面我们就开始吧!

图片.png

2. 单击用户帐户

图片.png

3.点击Unlock进行解锁,并将Automatic Login设置为ON

image.png下载vnc4server apt-get install xrdp vnc4server xbase-clients

apt-get install dconf-editorubuntu 搜索你的电脑=桌面左上角的dconf编辑器

image.pngorg=gnome=desktop=remote-access=取消选中需要加密

image.png

2. 配置网卡(所有节点)

将默认的ens更改为eth(通过ifconfig命令可以看到默认网卡是ens格式,现在需要更改为eth) gedit /etc/default/grubGRUB_CMDLINE_LINUX_DEFAULT="quiet Splash "

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

image.png 重新生成grub 文件

更新grub

grub-mkconfig -o /boot/grub/grub.cfg 添加eth0网卡/etc/network/interfacesauto eth0

iface eth0 inet 静态

地址192.168.0.200

网络掩码255.255.255.0

网关192.168.0.1

dns 名称服务器192.168.0.1

注意:controller节点使用192.168.0.200,compute1节点使用192.168.0.203。

重启

3. 设置 hosts 和 hostname (所有节点)

设置hostsgedit /etc/hosts 并注销127.0.1.1

192.168.0.200 控制器

192.168.0.203 计算1

image.png 设置主机名gedit /etc/hostname

控制器节点为controller,compute1节点为compute1。

image.png 重启

4. 换源

更改阿里源gedit /etc/apt/sources.list

注意: 删除文件deb-src 中的所有其他内容http://archive.ubuntu.com/ubuntu xenial main stricted

deb http://mirrors.aliyun.com/ubuntu/xenial 主要受限制

deb-src http://mirrors.aliyun.com/ubuntu/xenial 主要受限多元宇宙

deb http://mirrors.aliyun.com/ubuntu/xenial-updates 主要受限

deb-src http://mirrors.aliyun.com/ubuntu/xenial-updates 主要受限多元宇宙

deb http://mirrors.aliyun.com/ubuntu/xenial 宇宙

deb http://mirrors.aliyun.com/ubuntu/xenial-updates Universe

deb http://mirrors.aliyun.com/ubuntu/xenial 多元宇宙

deb http://mirrors.aliyun.com/ubuntu/xenial-updates 多元宇宙

deb http://mirrors.aliyun.com/ubuntu/xenial-backports 主要受限宇宙多元宇宙

deb-src http://mirrors.aliyun.com/ubuntu/xenial-backports 主要受限宇宙多元宇宙

deb http://archive.canonical.com/ubuntuxenialpartner

deb-src http://archive.canonical.com/ubuntu xenialpartner

deb http://mirrors.aliyun.com/ubuntu/xenial-security 主受限制

deb-src http://mirrors.aliyun.com/ubuntu/xenial-security 主要受限多元宇宙

deb http://mirrors.aliyun.com/ubuntu/xenial-security Universe

deb http://mirrors.aliyun.com/ubuntu/xenial-security 多元宇宙

更新

易于更新

易于升级

apt dist 升级

apt autoremove restart restart(您现在可以通过vnc查看器连接这些节点)

5. 时间服务器 ntp

控制器节点下载和配置

apt 安装chrony

gedit /etc/chrony/chrony.confallow 192.168.0.0/24

服务器ntp1.aliyun.com iburst

image.png 重新启动ntp

服务chrony重启验证

慢性来源

image.png 下载并配置其他节点

apt 安装chrony

gedit /etc/chrony/chrony.conf 注释掉pool 2.debian.pool.ntp.org 离线iburst

服务器控制器突发

image.png 重新启动ntp

服务chrony重启验证

慢性来源

image.png

5. OpenStack 所需要的包(所有节点)

所有节点apt install software-properties-common

添加apt-存储库云存档:newton

apt update apt dist-upgrade

apt install python-openstackclient

6. 配置数据库(仅controller 节点)

控制节点下载和配置

apt 安装mariadb-server python-pymysql

gedit /etc/mysql/mariadb.conf.d/99-openstack.cnf

注意:99-openstack.cnf不存在,这一步创建一个新文件[mysqld]

绑定地址=192.168.0.200

默认存储引擎=innodb

innodb_file_per_table

最大连接数=4096

排序规则服务器=utf8_general_ci

字符集服务器=utf8

重启服务mysql restart

7. 配置消息队列(仅controller 节点)

控制器节点下载

apt installrabbitmq-server添加openstack用户

rabbitmqctl add_user openstack 123456

图片.png

注意:是openstack的用户,123456是为openstack用户读写访问权限设置的密码

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

image.png

8. 配置 Memcached(仅controller 节点)

控制器节点下载

apt install memcached python-memcache 配置

gedit /etc/memcached.conf -l 192.168.0.200

image.png 重启服务memcached restart

9. 配置身份服务(仅 Controller 节点)

创建数据库keystone1。登录sql:mysql -uroot -p123456

创建数据库基石;

将keystone.* 上的所有权限授予由“123456”标识的“keystone”@“localhost”;

将keystone.* 上的所有权限授予由“123456”标识的“keystone”@“%”;

退出sql:exit

下载并配置keystone1.下载

apt安装梯形校正

配置

gedit /etc/keystone/keystone.conf[数据库]

.

连接=mysql+pymysql: //keystone:123456@controller/keystone

[代币]

.

提供商=fernet

注: 注释掉[数据库]中的其他连接。有多个提供商。请注意,它们必须位于[token] 中。

image.png 根据配置填充数据库keystone数据

su -s /bin/sh -c "keystone-manage db_sync" keystone 初始化Fernet 密钥存储:

keystone-管理fernet_setup --keystone-用户keystone --keystone-group keystone

keystone-manage credential_setup --keystone-user keystone --keystone-group keystone 初始化身份服务

keystone-manage bootstrap --bootstrap-password 123456 --bootstrap-admin-url http://controller:35357/v3/--bootstrap-internal-url http://controller:35357/v3/--bootstrap-public-url http://controller:5000/v3/--bootstrap-region-id区域一

注:123456是apache配置的自定义密码配置

gedit /etc/apache2/apache2.conf服务器名称控制器

image.png 重启服务apache2 restart 配置管理账户删除默认数据库rm -f /var/lib/keystone/keystone.db 配置管理账户(通过设置环境变量)

导出OS_USERNAME=admin

导出OS_PASSWORD=123456

导出OS_PROJECT_NAME=admin

导出OS_USER_DOMAIN_NAME=默认

导出OS_PROJECT_DOMAIN_NAME=默认

导出OS_AUTH_URL=http://controller:35357/v3

导出OS_IDENTITY_API_VERSION=3

注:123456是之前身份服务初始化中的密码创建域、项目、用户、角色创建服务项目。

openstack 项目创建--domain default --description "服务项目" 服务

image.png 创建demo(因为admin账号不能用于openstack的常规操作)

创建演示项目: openstack project create --domain default --description "演示项目" demo

图片.png

创建demouser:openstack user create --domain default --password-prompt demo

图片.png

创建用户角色:openstack角色创建用户

图片.png

将用户角色与demoproject 和demouser 关联

openstack role add --project demo --user demo 用户配置gedit /etc/keystone/keystone-paste.ini 删除[pipeline:public_api]、[pipeline:admin_api]、[pipeline:api_v3] 中的admin_token_auth

image.png 验证清除环境变量

取消设置OS_AUTH_URL OS_PASSWORD 验证管理员身份

openstack --os-auth-url http://controller:35357/v3 --os-project-domain-name 默认--os-user-domain-name 默认--os-project-name admin --os-username 管理令牌问题

image.png3.验证演示

openstack --os-auth-url http://controller:5000/v3 --os-project-domain-name 默认--os-user-domain-name 默认--os-project-name demo --os-username 演示令牌问题

image.png配置登录脚本配置管理

在当前用户目录下

图片.png

gedit admin-openrcexport OS_PROJECT_DOMAIN_NAME=默认

导出OS_USER_DOMAIN_NAME=默认

导出OS_PROJECT_NAME=admin

导出OS_USERNAME=admin

导出OS_PASSWORD=123456

导出OS_AUTH_URL=http://controller:35357/v3

导出OS_IDENTITY_API_VERSION=3

导出OS_IMAGE_API_VERSION=2

配置演示

在当前用户目录下

gedit demo-openrcexport OS_PROJECT_DOMAIN_NAME=默认

导出OS_USER_DOMAIN_NAME=默认

导出OS_PROJECT_NAME=演示

导出OS_USERNAME=演示

导出OS_PASSWORD=123456

导出OS_AUTH_URL=http://controller:5000/v3

导出OS_IDENTITY_API_VERSION=3

导出OS_IMAGE_API_VERSION=2

核实

登录.admin-openrc 或.demo-openrc

验证openstack 令牌问题

image.png

9. 配置镜像服务(仅 Controller 节点)

创建数据库glance1。登录sql:mysql -uroot -p123456

创建数据库一目了然;

授予所有特权ONlance.* 至"glance"@"localhost" IDENTIFIED BY "123456";

授予扫视所有权限。* 授予由“123456”标识的“扫视”@“%”;

退出sql:exit

创建glance帐户登录:admin-openrc创建glance

创建glanceuser:openstack user create --domain default --password-promptlance

图片.png

将admin 角色与serviceproject 和lanceuser 关联:

openstack角色添加--项目服务--用户浏览管理

创建一览服务:

openstack服务创建--名称一目了然--描述“OpenStack镜像”图像

图片.png

创建镜像服务API(公共内部管理):

openstack端点创建--region RegionOne图像公共http://controller:9292

图片.png

openstack端点创建--region RegionOne图像内部http://controller:9292

图片.png

openstack端点创建--region RegionOne图像管理http://controller:9292

image.png下载和配置一览下载

apt安装glanceconfig

gedit /etc/glance/glance-api.conf[数据库]

.

连接=mysql+pymysql: //glance:123456@controller/glance

[keystone_authtoken]

auth_uri=http://controller:5000

auth_url=http://controller:35357

memcached_servers=控制器:11211

身份验证类型=密码

项目域名=默认

用户域名称=默认

项目名称=服务

用户名=一目了然

密码=123456

[粘贴_部署]

.

味道=基石

[浏览商店]

.

商店=文件,http

默认存储=文件

filesystem_store_datadir=/var/lib/glance/images/

Note : [keystone_authtoken]的所有其他选项必须删除

图片.png

图片.png

gedit /etc/glance/glance-registry.conf[数据库]

.

连接=mysql+pymysql: //glance:123456@controller/glance

[keystone_authtoken]

auth_uri=http://controller:5000

auth_url=http://controller:35357

memcached_servers=控制器:11211

身份验证类型=密码

项目域名=默认

用户域名称=默认

项目名称=服务

用户名=一目了然

密码=123456

[粘贴_部署]

.

味道=基石

Note : [keystone_authtoken]的所有其他选项必须删除

填充图像服务数据库

su -s /bin/sh -c "glance-manage db_sync" 一瞥重新启动服务

服务概览-注册表重新启动

服务glance-api重启验证

登录:admin-openrc

下载:wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img 注:可以通过openssh从其他主机导入镜像

apt-get 安装openssh-server

服务ssh 启动

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

图片.png

查看:openstack镜像列表

image.png

9. 配置计算服务(Controller 节点)

创建数据库nova1。登录sql:mysql -uroot -p123456

创建数据库nova_api;

创建数据库nova;

将nova_api.* 上的所有权限授予由“123456”标识的“nova”@“localhost”;

将nova_api.* 上的所有权限授予由“123456”标识的“nova”@“%”;

将nova.* 上的所有权限授予由“123456”标识的“nova”@“localhost”;

将nova.* 上的所有权限授予由“123456”标识的“nova”@“%”;

退出sql:退出

创建nova账号登录:admin-openrcCreate nova

创建novauser:openstack user create --domain default --password-prompt nova

图片.png

将admin 角色与novauser 关联:

openstack角色添加--project serv

ice --user nova admin 创建novaservice: openstack service create --name nova --description "OpenStack Compute" compute image.png 创建计算服务服务API(public internal admin ): openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%(tenant_id)s image.png openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%(tenant_id)s image.png openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%(tenant_id)s image.png下载和配置nova下载 apt install nova-api nova-conductor nova-consoleauth nova-novncproxy nova-scheduler配置 gedit /etc/nova/nova.conf注释掉[DEFAULT]中的log-dir [api_database] ... connection = mysql+pymysql://nova:123456@controller/nova_api [database] ... connection = mysql+pymysql://nova:123456@controller/nova [DEFAULT] ... transport_url = rabbit://openstack:123456@controller auth_strategy = keystone my_ip = 192.168.0.200 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver [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 = 123456 [vnc] ... vncserver_listen = $my_ip vncserver_proxyclient_address = $my_ip [glance] ... api_servers = http://controller:9292 [oslo_concurrency] ... lock_path = /var/lib/nova/tmp 注:[keystone_authtoken]的所有其他选项都要删掉 image.png填充数据库 su -s /bin/sh -c "nova-manage api_db sync" nova su -s /bin/sh -c "nova-manage db sync" nova重启服务 service nova-api restart service nova-consoleauth restart service nova-scheduler restart service nova-conductor restart service nova-novncproxy restart

10. 配置计算服务( compute1 节点)

下载和配置nova下载 apt install nova-compute配置 gedit /etc/nova/nova.conf注释掉[DEFAULT]中的log-dir [DEFAULT] ... transport_url = rabbit://openstack:123456@controller auth_strategy = keystone my_ip = 192.168.0.203 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver [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 = 123456 [vnc] ... enabled = True vncserver_listen = 0.0.0.0 vncserver_proxyclient_address = $my_ip novncproxy_base_url = http://controller:6080/vnc_auto.html [glance] ... api_servers = http://controller:9292 [oslo_concurrency] ... lock_path = /var/lib/nova/tmp 注:[keystone_authtoken]的所有其他选项都要删掉 image.png重启服务 service nova-compute restart验证(controller 节点) 登录:. admin-openrc 查看服务列表:openstack compute service list image.png

11. 配置网络服务(Controller 节点)

创建数据库 neutron1.登入sql:mysql -uroot -p123456 CREATE DATABASE neutron; GRANT ALL PRIVILEGES ON neutron.* TO "neutron"@"localhost" IDENTIFIED BY "123456"; GRANT ALL PRIVILEGES ON neutron.* TO "neutron"@"%" IDENTIFIED BY "123456"; 退出sql:exit 创建 nova账户登录 :. admin-openrc创建neutron 创建neutronuser:openstack user create --domain default --password-prompt neutron image.png 把admin角色 和neutronuser 关联起来: openstack role add --project service --user neutron admin 创建neutronservice: openstack service create --name neutron --description "OpenStack Networking" network image.png 创建计算网络服务API(public internal admin ): openstack endpoint create --region RegionOne network public http://controller:9696 image.png openstack endpoint create --region RegionOne network internal http://controller:9696 image.png openstack endpoint create --region RegionOne network admin http://controller:9696 image.png下载和配置neutron下载 apt install neutron-server neutron-plugin-ml2 neutron-linuxbridge-agent neutron-dhcp-agent neutron-metadata-agent配置(Provider networks) gedit /etc/neutron/neutron.conf[database] ... connection = mysql+pymysql://neutron:123456@controller/neutron [DEFAULT] ... core_plugin = ml2 service_plugins = transport_url = rabbit://openstack:123456@controller auth_strategy = keystone notify_nova_on_port_status_changes = True notify_nova_on_port_data_changes = True [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 = 123456 [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 = 123456 注:transport_url有2个 ,一定要选[DEFAULT]中的;[keystone_authtoken]的所有其他选项都要删掉 image.png image.pnggedit /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 = provider [securitygroup] ... enable_ipset = True gedit /etc/neutron/plugins/ml2/linuxbridge_agent.ini [linux_bridge] physical_interface_mappings = provider:eth0 [vxlan] enable_vxlan = False [securitygroup] ... enable_security_group = True

firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver gedit /etc/neutron/dhcp_agent.ini [DEFAULT] ... interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq enable_isolated_metadata = True 配置gedit /etc/neutron/metadata_agent.ini [DEFAULT] ... nova_metadata_ip = controller metadata_proxy_shared_secret = 123456 gedit /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 = 123456 service_metadata_proxy = True metadata_proxy_shared_secret = 123456 填充数据库 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重启服务 service nova-api restart service neutron-server restart service neutron-linuxbridge-agent restart service neutron-dhcp-agent restart service neutron-metadata-agent restart

12. 配置网络服务( compute1 节点)

下载和配置neutron下载 apt install neutron-linuxbridge-agent配置 gedit /etc/neutron/neutron.conf[DEFAULT] ... transport_url = rabbit://openstack:123456@controller auth_strategy = keystone [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 = 123456 注:transport_url有2个 ,一定要选[DEFAULT]中的;[keystone_authtoken]的所有其他选项都要删掉 配置(Provider networks) gedit /etc/neutron/plugins/ml2/linuxbridge_agent.ini[linux_bridge] physical_interface_mappings = provider:eth0 [vxlan] enable_vxlan = False [securitygroup] ... enable_security_group = True firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver 配置 gedit /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 = 123456 重启服务 service nova-compute restart service neutron-linuxbridge-agent restart验证(controller 节点) 登录:. admin-openrc 查看服务列表:openstack network agent list image.png

13. 配置仪表盘(仅 controller 节点)

下载和配置dashboard下载 apt install openstack-dashboard配置 gedit /etc/openstack-dashboard/local_settings.pyOPENSTACK_HOST = "controller" OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user" ALLOWED_HOSTS = ["*", ] SESSION_ENGINE = "django.contrib.sessions.backends.cache" CACHES = { "default": { "BACKEND": "django.core.cache.backends.memcached.MemcachedCache", "LOCATION": "controller:11211", } } OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True OPENSTACK_API_VERSIONS = { "identity": 3, "image": 2, "volume": 2, } OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "default" OPENSTACK_NEUTRON_NETWORK = { ... "enable_router": False, "enable_quotas": False, "enable_ipv6": False, "enable_distributed_router": False, "enable_ha_router": False, "enable_lb": False, "enable_firewall": False, "enable_vpn": False, "enable_fip_topology_check": False, } TIME_ZONE = "UTC" image.pnggedit /etc/apache2/conf-available/openstack-dashboard.conf WSGIApplicationGroup %{GLOBAL} image.png重启service apache2 reload访问http://192.168.0.200/horizon image.png

14. 开始一个 instance(仅 controller 节点)

创建虚拟网络(Provider network)登录:. admin-openrc创建网络:openstack network create --share --external --provider-physical-network provider --provider-network-type flat provider image.png子网:openstack subnet create --network provider --allocation-pool start=192.168.0.220,end=192.168.0.229 --dns-nameserver 192.168.0.1 --gateway 192.168.0.1 --subnet-range 192.168.0.0/24 provider image.png创建 flavoropenstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano image.png 注:flavor 可以在 dashboard 中创建 image.png生成一个密钥登录:. demo-openrc创建: ssh-keygen -q -N "" image.png openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey image.png查看秘钥:openstack keypair list image.png添加安全组规则(security group rules)允许ICMP openstack security group rule create --proto icmp default image.png允许SSH openstack security group rule create --proto tcp --dst-port 22 default image.png创建一个 instance登录: image.png创建 image.png image.png image.png查看 image.png image.png 注:因为查看的时候url用的 是http://controller:6080/,所以需要修改C:WindowsSystem32driversetchosts,添加192.168.0.200 controller

15. 块存储(Controller 节点)

创建数据库 cinder1.登入sql:mysql -uroot -p123456 CREATE DATABASE cinder; GRANT ALL PRIVILEGES ON cinder.* TO "cinder"@"localhost" IDENTIFIED BY "123456"; GRANT ALL PRIVILEGES ON cinder.* TO "cinder"@"%" IDENTIFIED BY "123456"; 退出:exit 创建cinder登录:. admin-openrc 创建cinderuser: openstack user create --domain default --password-prompt cinder 关联admin角色 与cinderuser openstack role add --project service --user cinder admin创建cinder和cinderv2service openstack service create --name cinder --description "OpenStack Block Storage" volume openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2创建API openstack endpoint create --region RegionOne volume public http://controller:8776/v1/%(tenant_id)s openstack endpoint create --region RegionOne volume internal http://controller:8776/v1/%(tenant_id)s openstack endpoint create --region RegionOne volume admin http://controller:8776/v1/%(tenant_id)s openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%(tenant_id)s openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%(tenant_id)s openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%(tenant_id)s安装和配置 安装:apt install cinder-api cinder-scheduler 配置:gedit /etc/cinder/cinder.conf[database] ... connection = mysql+pymysql://cinder:123456@controller/cinder [DEFAULT] ... transport_url = rabbit://openstack:123456@controller auth_strategy = keystone my_ip = 192.168.0.200 [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 = cinder password = 123456 [oslo_concurrency] ... lock_path = /var/lib/cinder/tmp 创建数据库表:su -s /bin/sh -c "cinder-manage db sync" cinder 配置nova gedit /etc/nova/nova.conf[cinder] os_region_name = RegionOne 重启 service nova-api restart service cinder-scheduler restart service cinder-api restart

16. 块存储(block 节点 192.168.0.204)

配置安装lvm2 apt install lvm2创建volume pvcreate /dev/sda4创建group vgcreate cinder-volumes /dev/sda4配置lvm gedit /etc/lvm/lvm.confdevices { ... filter = [ "a/sda4/", "r/.*/"] 下载和配置cinder 下载:apt install cinder-volume 配置:gedit /etc/cinder/cinder.conf[database] ... connection = mysql+pymysql://cinder:123456@controller/cinder [DEFAULT] ... transport_url = rabbit://openstack:123456@controller auth_strategy = keystone my_ip = 192.168.0.204 enabled_backends = lvm glance_api_servers = http://controller:9292 [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 = cinder password = 123456 [lvm] ... volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver volume_group = cinder-volumes iscsi_protocol = iscsi iscsi_helper = tgtadm [oslo_concurrency] ... lock_path = /var/lib/cinder/tmp 重启:service tgt restart service cinder-volume restart 验证(controller 节点) 登录:. admin-openrc 验证:openstack volume service list image.png 7.使用 (controller 节点) 登录:. demo-openrc 创建卷:openstack volume create --size 1 volume1 或者用dashboard: image.png连接volume到instance上: image.png 在instance (192.168.0.218)中查看: fdisk -l image.png

17. 对象存储(Controller 节点)

创建创建swift 登录:. admin-openrc 创建swiftuser: openstack user create --domain default --password-prompt swift 关联swift用户和admin角色:openstack role add --project service --user swift admin 创建swiftservice:openstack service create --name swift --description "OpenStack Object Storage" object-store 创建api: openstack endpoint create --region RegionOne object-store public http://controller:8080/v1/AUTH_%(tenant_id)s openstack endpoint create --region RegionOne object-store internal http://controller:8080/v1/AUTH_%(tenant_id)s openstack endpoint create --region RegionOne object-store admin http://controller:8080/v1安装和配置安装: apt-get install swift swift-proxy python-swiftclient python-keystoneclient python-keystonemiddleware memcached从git获取配置文件 创建/etc/swift目录: mkdir /etc/swift 获取配置文件proxy-server.conf: curl -o /etc/swift/proxy-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/proxy-server.conf-sample 注:安装curl用apt install curl配置 gedit /etc/swift/proxy-server.conf[DEFAULT] ... bind_port = 8080 user = swift swift_dir = /etc/swift 在[pipeline:main]中删除tempurl和tempauth模块,添加authtoken和keystoneauth模块 [pipeline:main] pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk ratelimit authtoken keystoneauth container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-server [app:proxy-server] use = egg:swift#proxy ... account_autocreate = True [filter:keystoneauth] use = egg:swift#keystoneauth ... operator_roles = admin,user [filter:authtoken] paste.filter_factory = keystonemiddleware.auth_token:filter_factory ... 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 = swift password = 123456 delay_auth_decision = True [filter:cache] use = egg:swift#memcache ... memcache_servers = controller:11211

17. 对象存储(object 节点 192.168.0.205)

安装和配置rsync注:分区工具 apt-get install gparted gparted 安装:apt-get install xfsprogs rsync 格式化盘: mkfs.xfs /dev/sda5 mkfs.xfs /dev/sda6 创建mount目录: mkdir -p /srv/node/sda5 mkdir -p /srv/node/sda6 配置/etc/fstab: gedit /etc/fstab... /dev/sda5 /srv/node/sda5 xfs noatime,nodiratime,nobarrier,logbufs=8 0 2 /dev/sda6 /srv/node/sda6 xfs noatime,nodiratime,nobarrier,logbufs=8 0 2 挂载: mount /srv/node/sd5 mount /srv/node/sd6 创建/etc/rsyncd.conf: gedit /etc/rsyncd.conf uid = swift gid = swift log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid address = 192.168.0.205 [account] max connections = 2 path = /srv/node/ read only = False lock file = /var/lock/account.lock [container] max connections = 2 path = /srv/node/ read only = False lock file = /var/lock/container.lock [object] max connections = 2 path = /srv/node/ read only = False lock file = /var/lock/object.lock 配置/etc/default/rsync: gedit /etc/default/rsync RSYNC_ENABLE=true 开始:service rsync start 安装和配置swift安装:apt-get install swift swift-account swift-container swift-object下载配置文件: curl -o /etc/swift/account-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/account-server.conf-sample?h=stable/mitaka curl -o /etc/swift/container-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/container-server.conf-sample?h=stable/mitaka curl -o /etc/swift/object-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/object-server.conf-sample?h=stable/mitaka配置/etc/swift/account-server.conf gedit /etc/swift/account-server.conf[DEFAULT] ... bind_ip = 192.168.0.205 bind_port = 6202 user = swift swift_dir = /etc/swift devices = /srv/node mount_check = True [pipeline:main] pipeline = healthcheck recon account-server [filter:recon] use = egg:swift#recon ... recon_cache_path = /var/cache/swift 配置/etc/swift/container-server.conf gedit /etc/swift/container-server.conf[DEFAULT] ... bind_ip = 192.168.0.205 bind_port = 6201 user = swift swift_dir = /etc/swift devices = /srv/node mount_check = True [pipeline:main] pipeline = healthcheck recon container-server [filter:recon] use = egg:swift#recon ... recon_cache_path = /var/cache/swift 配置/etc/swift/object-server.conf gedit /etc/swift/object-server.conf[DEFAULT] ... bind_ip = 192.168.0.205 bind_port = 6200 user = swift swift_dir = /etc/swift devices = /srv/node mount_check = True [pipeline:main] pipeline = healthcheck recon object-server [filter:recon] use = egg:swift#recon ... recon_cache_path = /var/cache/swift recon_lock_path = /var/lock

用户评论

熟悉看不清

终于找到一份详细的 Ubuntu 16.04 搭建 OpenStack Newton 环境的教程了,准备开始实验!

    有6位网友表示赞同!

半梦半醒半疯癫

OpenStack Newton 啊,已经是老版本了吧,我还打算体验一下它。

    有19位网友表示赞同!

念初

学习Ubuntu下部署OpenStack 的小伙伴们可以参考这篇教程!

    有7位网友表示赞同!

莫阑珊

这个环境搭建教程会不会比较复杂?

    有6位网友表示赞同!

墨城烟柳

希望教程有详细的步骤说明,方便新手学习。

    有20位网友表示赞同!

灬一抹丶苍白

想把 OpenStack Newton 环境用在自己本地机器上测试一下,这教程挺合适的!

    有12位网友表示赞同!

龙吟凤

OpenStack 还是很酷的,但一直没机会尝试搭建...

    有18位网友表示赞同!

素衣青丝

Ubuntu 16.04 操作系统还是蛮顺手用的。

    有8位网友表示赞同!

颜洛殇

学习新的技术真是让人兴奋!期待完成 OpenStack 的部署!

    有12位网友表示赞同!

尘埃落定

分享一下体验?OpenStack 使用起来怎么样?

    有5位网友表示赞同!

惯例

看这篇教程好像要花不少时间,需要耐心和细心操作吧。

    有11位网友表示赞同!

巷口酒肆

这个 OpenStack 环境搭建能用于什么场景呢?

    有9位网友表示赞同!

追忆思域。

最近学习云计算相关知识,这个教程很有帮助!

    有6位网友表示赞同!

我一个人

希望能找到完整的镜像文件或部署包方便下载。

    有13位网友表示赞同!

巷陌繁花丶

Ubuntu 系统的配置步骤可能有些区别吧,需要注意一下。

    有18位网友表示赞同!

执念,爱

OpenStack 的使用其实蛮广泛的,可以提供很多云计算服务。

    有6位网友表示赞同!

青墨断笺み

这个教程覆盖了哪些主要的 OpenStack 服务?

    有7位网友表示赞同!

惦着脚尖摘太阳

希望这个教程能够能详细讲解每一项操作的原理,这样对学习更深层知识 有帮助!

    有13位网友表示赞同!

歇火

搭建完成 OpenStack 环境后,可以使用哪种工具进行管理操控呢?

    有5位网友表示赞同!

鹿叹

这篇文章应该会解答很多关于 Ubuntu 16.04 和 OpenStack Newton 搭建的问题吧。

    有5位网友表示赞同!

【Ubuntu 16.04 Newton OpenStack环境配置指南】相关文章:

1.蛤蟆讨媳妇【哈尼族民间故事】

2.米颠拜石

3.王羲之临池学书

4.清代敢于创新的“浓墨宰相”——刘墉

5.“巧取豪夺”的由来--米芾逸事

6.荒唐洁癖 惜砚如身(米芾逸事)

7.拜石为兄--米芾逸事

8.郑板桥轶事十则

9.王献之被公主抢亲后的悲惨人生

10.史上真实张三丰:在棺材中竟神奇复活