Openstack的环境的Mitaka部署环境服务,实例(1)
一.openstack介绍二.配置环境
server1:172.25.29.11 控制节点,内存最少>2GB
server2:172.25.29.12 计算节点,内存最少>1GB
1.配置server1双网卡,eth1启用网卡,不设置ip,各主机提前做好解析
2.配置时间同步
server1,server2同步物理机172.25.29.250,物理机同步服务器172.25.254.250
server1:
3.配置mitakayum源
4.关闭selinux,升级,安装 OpenStack 客户端
5.配置安装数据库
在 部分,设置 ``bind-address``值为控制节点的管理网络IP地址以使得其它节点可以通过管理网络访问数据库:
启动并设置密码
OpenStack 身份认证服务前,你必须创建一个数据库和管理员令牌,创建keystone、glance、nova_api、nova、neutron、cinder用户,并授权
6.配置消息队列
安装启动
添加 openstack 用户,给``openstack``用户配置写和读权限
7.认证服务认证缓存使用Memcached缓存
将监听端口设置为全部
三.认证服务keystone配置
1.创建数据库,之前已经创建完毕
2.安装
3.生成随机key
4.编辑文件 /etc/keystone/keystone.conf
5.初始化身份认证服务的数据库
6.初始化Fernet keys
7.配置 Apache HTTP 服务器
编辑``/etc/httpd/conf/httpd.conf`` 文件
用下面的内容创建文件 /etc/httpd/conf.d/wsgi-keystone.conf
8.配置认证令牌,配置端点URL,配置认证 API 版本
9.创建服务实体和API端点
在你的Openstack环境中,认证服务管理服务目录。服务使用这个目录来决定您的环境中可用的服务。创建服务实体和身份认证服务
身份认证服务管理了一个与您环境相关的 API 端点的目录。服务使用这个目录来决定如何与您环境中的其他服务进行通信。
10.创建域、项目、用户和角色
创建域``default``
在你的环境中,为进行管理操作,创建管理的项目、用户和角色:
本指南使用一个你添加到你的环境中每个服务包含独有用户的service 项目。创建``service``项目:
常规(非管理)任务应该使用无特权的项目和用户。作为例子,本指南创建 demo 项目和用户
11.验证操作
四.创建 OpenStack 客户端环境脚本
使用脚本,通过source开启不同的admin和demo环境脚本,获得不同的权限
五.镜像服务glance
1.创建glance数据库,之前已经创建
2.安装服务
3.编辑文件 /etc/glance/glance-api.conf
4.编辑文件 ``/etc/glance/glance-registry.conf
5.写入镜像服务数据库,启动服务
6.要创建服务证书,完成这些步骤:创建 glance 用户,添加 admin 角色到 glance 用户和 service 项目上
source admin-openrc
7.创建镜像服务的 API 端点
8.验证操作,使用 QCOW2 磁盘格式, bare 容器格式上传镜像到镜像服务并设置公共可见,这样所有的项目都可以访问它
确认镜像的上传并验证属性
六.计算服务nova
1.创建数据nova和nova_api,之间已经创建完毕
2.安装服务
3.编辑``/etc/nova/nova.conf
4.同步Compute 数据库启动服务
5.要创建服务证书,完成这些步骤:创建 nova 用户
https://s1.51cto.com/oss/201711/06/1e91dbc6bbdfd76853016874471e09e2.png
给 nova 用户添加 admin 角色,创建 nova 服务实体
https://s1.51cto.com/oss/201711/06/8fb25901498828e14aea339eb4ab2163.png
6.创建 Compute 服务 API 端点
https://s5.51cto.com/oss/201711/06/3269022f278b21e983ee0aaa7a689522.png
https://s5.51cto.com/oss/201711/06/74065faa37c58a45e7631ae85e8e1cd8.png
https://s5.51cto.com/oss/201711/06/6171f8f1ba24a713919bb66fd701a7f6.png
7.配置计算节点server2
网卡与控制节点server1一致
https://s1.51cto.com/oss/201711/06/5e091555990dc6e4e6466ac92ca3ca30.png
https://s1.51cto.com/oss/201711/06/8c7a8f13fb26c1a97274e61ee42826ea.png
配置好时间同步
https://s1.51cto.com/oss/201711/06/0021c051942eb76ab1457cca14cb0551.png
https://s1.51cto.com/oss/201711/06/6966da86e7400f1fcfef32fdf1270e39.png
配置好yum源
https://s5.51cto.com/oss/201711/06/69bcb1c63ef999b6f32da9e582b0b72a.png
安装好nova计算节点
https://s1.51cto.com/oss/201711/06/b26b3691d2132e37088cfa8185a43cdd.png
编辑``/etc/nova/nova.conf
https://s2.51cto.com/oss/201711/06/382fcd9328248093132152326ea707b9.png
https://s1.51cto.com/oss/201711/06/7d1e2917f45b8f00b8aeb6eeb0def805.png
https://s5.51cto.com/oss/201711/06/c653268b251db930f34e24a1c32e8ad3.png
https://s3.51cto.com/oss/201711/06/4c083d5b5776fc606585c9dcb94901d0.png
https://s5.51cto.com/oss/201711/06/bf696cc2c1f1a4e76490285ac688d50e.png
https://s5.51cto.com/oss/201711/06/b1cf091650fc0b048593d7913fb5f8be.png
https://s2.51cto.com/oss/201711/06/ce62222694cb402d89ba35d1637fc80a.png
https://s3.51cto.com/oss/201711/06/3172a1bc1228acf131ce33a869547001.png
https://s3.51cto.com/oss/201711/06/6c6bad89045eab889f214b193b359f79.png
在 /etc/nova/nova.conf 文件的 区域做出如下的编辑
https://s3.51cto.com/oss/201711/06/0021537122c6a162754e4a08fe0e9b1e.png
启动服务,计算节点server启动成功
https://s2.51cto.com/oss/201711/06/b456e8d9dad2b0212cbea7453e0ddd59.png
https://s2.51cto.com/oss/201711/06/491191754e1368e19e681a4f419639ef.png
七.Networking 服务neutron
1.创建数据库neutron,之前已经创建完毕
2.安装服务
https://s1.51cto.com/oss/201711/06/489b457af9683c6ca8a5a94ef0e780b0.png
3.配置公有网络,编辑``/etc/neutron/neutron.conf
https://s4.51cto.com/oss/201711/06/eb39c9f372dcf060d56722fa30156b67.png
https://s1.51cto.com/oss/201711/06/0d7c4052a2d2c45572a1c0f065ec4292.png
https://s1.51cto.com/oss/201711/06/643297ebe4ef117cfc4f64a1f27c8733.png
https://s1.51cto.com/oss/201711/06/ba256a022fe3b7fb0404f31e6f540cbd.png
https://s1.51cto.com/oss/201711/06/7fd5f13eb3e5b6f4d0fbd4bd32983062.png
https://s4.51cto.com/oss/201711/06/80e0b75dfada975d8eb0446e1e386e1e.png
https://s4.51cto.com/oss/201711/06/3ea904a4085e6b6e162ae0d107948194.png
https://s4.51cto.com/oss/201711/06/174b9140199b002daa905ac750614ddd.png
https://s4.51cto.com/oss/201711/06/6873de451f9622e43d993e04ab0bcf57.png
4.编辑``/etc/neutron/plugins/ml2/ml2_conf.ini``
https://s4.51cto.com/oss/201711/06/8e20b4378fe3647853c6ac390d309c8c.png
https://s5.51cto.com/oss/201711/06/7d9ba6c74be87e53991db91c3ffa774a.png
https://s5.51cto.com/oss/201711/06/5241d3d8e5abc4ac554caa199aff218e.png
https://s5.51cto.com/oss/201711/06/a391d4aad953b1aff17860e369ae171c.png
5.编辑``/etc/neutron/plugins/ml2/linuxbridge_agent.ini
https://s5.51cto.com/oss/201711/06/9f4fc8afebd199daf43f21c8490f68e5.png
https://s5.51cto.com/oss/201711/06/3d1ce0cb944c5587d324ef515769cc65.png
https://s4.51cto.com/oss/201711/06/a37da43f51c087653e45fc7a15627aae.png
6.编辑``/etc/neutron/dhcp_agent.ini
https://s4.51cto.com/oss/201711/06/61606c4ca04b9d8a5fd2883182a513e9.png
7.编辑``/etc/neutron/metadata_agent.ini
https://s1.51cto.com/oss/201711/06/15c14d0ef6cd413b7bcc3efad8f5307a.png
https://s4.51cto.com/oss/201711/06/96d4852f40c7abac4a0d28508e156650.png
8.编辑``/etc/nova/nova.conf
https://s1.51cto.com/oss/201711/06/9016a235e7aed4346384217dccaab1ee.png
https://s1.51cto.com/oss/201711/06/adaeaccb0ccd383721ad9930527adfb3.png
https://s1.51cto.com/oss/201711/06/e23fbbc85db538984b60c51586d0c961.png
9.网络服务初始化脚本需要一个超链接,启动服务
https://s1.51cto.com/oss/201711/06/ad4bd9f2f0b8aa9c412c56067611a555.png
https://s5.51cto.com/oss/201711/06/b031d976abe7cb258f43bd2a816ca51f.png
https://s2.51cto.com/oss/201711/06/3e071f44c286c797dd5ee833221bddcb.png
10.创建服务证书,完成这些步骤:创建``neutron``用户:
https://s2.51cto.com/oss/201711/06/4329f233a9bbee49fa95a9e26addf276.png
添加``admin`` 角色到``neutron`` 用户,创建``neutron``服务实体https://s2.51cto.com/oss/201711/06/936e25a7cc75317e07d86c0ed35539c8.png
11.创建网络服务API端点
https://s2.51cto.com/oss/201711/06/17784ee1d4c251bfcc8dedf5600f64c6.png
https://s2.51cto.com/oss/201711/06/b4382f957c5cba992f3af0d23b52dd7e.png
https://s2.51cto.com/oss/201711/06/c4e90265c25535f9f96151061e4b1c90.png
12.server2安装计算节点组件
https://s2.51cto.com/oss/201711/06/ba29162d3804c634db7b4336b77e4160.png
编辑``/etc/neutron/neutron.conf``
https://s1.51cto.com/oss/201711/06/9326c1f6b27f6b4730d8b68f14809197.png
https://s2.51cto.com/oss/201711/06/2878770a5cb35841542585f07bdb833b.png
https://s1.51cto.com/oss/201711/06/a5a43fcc0c9160ad6f8dc69e71120e4c.png
https://s2.51cto.com/oss/201711/06/fc3cf93d9172f7a8a6921d47fed201f7.png
https://s2.51cto.com/oss/201711/06/766a85f5b8e0bcbe3d55cc7adfa3affa.png
https://s1.51cto.com/oss/201711/06/2575699358536ef849beec6dd5514d6f.png
编辑``/etc/neutron/plugins/ml2/linuxbridge_agent.ini``
https://s2.51cto.com/oss/201711/06/b226692624b0d3c81d1e48db0b49e6dd.png
https://s1.51cto.com/oss/201711/06/ade5a999a4cf32d4e22afab0073559a6.png
https://s1.51cto.com/oss/201711/06/aad4a5e8d394651a3ec66d1cdea31c84.png
https://s1.51cto.com/oss/201711/06/b19b94714c41e40ef4d3a24d48162fe1.png
编辑``/etc/nova/nova.conf``
https://s2.51cto.com/oss/201711/06/9ba6e752a642b87485e13f6315c2c381.png
https://s4.51cto.com/oss/201711/06/091ae30cc5bd2e1a3f01c31571a73d58.png
重启计算服务
https://s2.51cto.com/oss/201711/06/97dc57f95833706a9db7ef739161e326.png
https://s5.51cto.com/oss/201711/06/dcdc4352b63a9b904879043e3e746c4b.png
八.启动一个实例
1.创建提供者网络
https://s5.51cto.com/oss/201711/06/ed2aa8650d09662b849cedf25f354a9c.png
2.在网络上创建一个子网
https://s5.51cto.com/oss/201711/06/8392b53ca3fd2019f30a3800b2ebe0fd.png
3.创建m1.nano规格的主机
https://s4.51cto.com/oss/201711/06/727520c560202d286671f5afae0ea83a.png
4.生成一个键值对
https://s5.51cto.com/oss/201711/06/cb3631202c4e6f8c7252f0143814a036.png
5.添加规则到 default 安全组
https://s5.51cto.com/oss/201711/06/3afc2f3dfa4da29c2dae361125e67bd9.png
https://s4.51cto.com/oss/201711/06/353c365a9ac23e8194f2a85caa994c4d.png
列出可用镜像:
https://s4.51cto.com/oss/201711/06/4200a5b119ff00b68b3e94bfc7cd5d14.png
6.启动实例
https://s4.51cto.com/oss/201711/06/5ecd4d9e24db5673b1207a13c5d250dd.png
检查实例的状态
https://s1.51cto.com/oss/201711/06/e2c9fbe4ffabe4c3e7ee6e435faa697d.png
7.使用虚拟控制台访问实例
https://s4.51cto.com/oss/201711/06/5f783b460117bd4d99507484e4c3207e.png
8.远程登陆镜像测试
https://s4.51cto.com/oss/201711/06/f31dc3bb55f49cec2504a5d8d2961525.png
https://s4.51cto.com/oss/201711/06/a755c3b6fd2b9905976ef42c7e2f95e5.png
页:
[1]