Openstak(M版)控制节点安装
#############修改hosts文件
# controller
10.0.0.11 controller
# compute1
10.0.0.31 compute1
# block1
10.0.0.41 block1
# object1
10.0.0.51 object1
# object2
10.0.0.52 object2
#############关闭selinux及防火墙#############
systemctl stop firewalld
systemctl disable firewalld
#############下载openstack软件包#############
yum install centos-release-openstack-mitaka
yum upgrade
yum install python-openstackclient
##############安装mysql#############
yum install mariadb mariadb-server python2-PyMySQL
#############修改mysql配置文件#############
vi /etc/my.cnf.d/openstack.cnf #创建并编辑
[mysqld]
bind-address = 10.0.0.11
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
启动mysql
systemctl enable mariadb.service
systemctl start mariadb.service
mysql_secure_installation
创建用户并赋予权限:
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'glance';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glance';
CREATE DATABASE nova_api;
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova';
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron';
####################安装rabbitmq#############
yum install rabbitmq-server
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
rabbitmqctl add_user openstack openstack
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
##################安装memcached#############
yum install memcached python-memcached
systemctl enable memcached.service
systemctl start memcached.service
#################安装keystone#############
yum install openstack-keystone httpd mod_wsgi
openssl rand -hex 10
#############修改keystone文件#############
vi /etc/keystone/keystone.conf #修改keystone
[DEFAULT]
admin_token =e0d582ae70634bca79ba
[database]
connection = mysql+pymysql://keystone:keystone@controller/keystone
[memcache]
servers = 10.0.0.11:11211
[token]
provider = fernet
driver = memcache
初始化keystone数据库:
su -s /bin/sh -c "keystone-manage db_sync" keystone
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
修改apache配置文件:
vi /etc/httpd/conf/httpd.conf
ServerName controller #修改httpd
vi /etc/httpd/conf.d/wsgi-keystone.conf #创建并增加
Listen 5000
Listen 35357
<VirtualHost *:5000>
WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-public
WSGIScriptAlias / /usr/bin/keystone-wsgi-public
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
ErrorLogFormat "%{cu}t %M"
ErrorLog /var/log/httpd/keystone-error.log
CustomLog /var/log/httpd/keystone-access.log combined
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:35357>
WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-admin
WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
ErrorLogFormat "%{cu}t %M"
ErrorLog /var/log/httpd/keystone-error.log
CustomLog /var/log/httpd/keystone-access.log combined
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>
启动apache
systemctl enable httpd.service
systemctl start httpd.service
配置认证令牌,端点URL,API 版本:
export OS_TOKEN=e0d582ae70634bca79ba
export OS_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
创建域、项目、用户和角色:
openstack service create --name keystone --description "OpenStack Identity" identity
openstack endpoint create --region RegionOne identity public http://controller:5000/v3
openstack endpoint create --region RegionOne identity internal http://controller:5000/v3
openstack endpoint create --region RegionOne identity admin http://controller:35357/v3
openstack domain create --description "Default Domain" default
openstack project create --domain default --description "Admin Project" admin
openstack user create --domain default --password-prompt admin
openstack role create admin
openstack role add --project admin --user admin admin
openstack project create --domain default --description "Service Project" service
openstack project create --domain default --description "Demo Project" demo
openstack user create --domain default --password-prompt demo
openstack role create user
openstack role add --project demo --user demo user
验证keystone:
unset OS_TOKEN OS_URL
openstack --os-auth-url http://controller:35357/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name admin --os-username admin token issue
#############安装镜像服务##############
在keystone注册服务:
source admin-openrc
openstack user create --domain default --password-prompt 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://controller:9292
openstack endpoint create --region RegionOne image internal http://controller:9292
openstack endpoint create --region RegionOne image admin http://controller:9292
下载glance:
yum install openstack-glance
修改glance-api文件:
vi /etc/glance/glance-api.conf
[database]
...
connection = mysql+pymysql://glance:glance@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
[paste_deploy]
...
flavor = keystone
[glance_store]
...
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
修改glance-registry文件:
vi /etc/glance/glance-registry.conf
[database]
...
connection = mysql+pymysql://glance:glance@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
[paste_deploy]
...
flavor = keystone
启动glance:
su -s /bin/sh -c "glance-manage db_sync" glance
systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service
验证操作:
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
source admin-openrc
openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public
openstack image list
#########################安装nova####################
在keystone上注册nova:
openstack user create --domain default --password-prompt 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://controller:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)s
下载nova:
yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler
修改nova配置文件:
vi /etc/nova/nova.conf
[DEFAULT]
...
my_ip = 10.0.0.11
enabled_apis = osapi_compute,metadata
auth_strategy = keystone
rpc_backend = rabbit
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api_database]
...
connection = mysql+pymysql://nova:nova@controller/nova_api
[database]
...
connection = mysql+pymysql://nova:nova@controller/nova
[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = openstack
[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
[vnc]
...
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[glance]
...
api_servers = http://controller:9292
[oslo_concurrency]
...
lock_path = /var/lib/nova/tmp
同步数据库:
su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage db sync" nova
启动nova:
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
#######################安装neutron#######################
在keystone注册:
openstack user create --domain default --password-prompt 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://controller:9696
openstack endpoint create --region RegionOne network internal http://controller:9696
openstack endpoint create --region RegionOne network admin http://controller:9696
安装neutron组件:
yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables
配置neutron.conf
vi /etc/neutron/neutron.conf
[DEFAULT]
...
core_plugin = ml2
service_plugins =
rpc_backend = rabbit
auth_strategy = keystone
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
[database]
...
connection = mysql+pymysql://neutron:neutron@controller/neutron
[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = openstack
[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
[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
[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp
配置(ML2) 插件:
vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
...
type_drivers = flat,vlan
tenant_network_types =vlan,gre,vxlan,geneve
mechanism_drivers = linuxbridge
extension_drivers = port_security
[ml2_type_flat]
...
flat_networks = provider
[securitygroup]
...
enable_ipset = True
配置Linuxbridge代理:
vi /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
配置DHCP代理:
vi /etc/neutron/dhcp_agent.ini
[DEFAULT]
...
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
配置nova的neutron:
vi /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
...
service_metadata_proxy = True
metadata_proxy_shared_secret = neutron
配置元数据代理:
vi /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_ip = 10.0.0.11
metadata_proxy_shared_secret = neutron
创建链接
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
启动neutron:
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
#######################安装dashboar#######################
安装dashboard:
yum install openstack-dashboard
修改dashboard文件:
vi /etc/openstack-dashboard/local_settings
OPENSTACK_HOST = "controller" #配置仪表盘以使用 OpenStack 服务:
ALLOWED_HOSTS = ['*'] #允许所有主机访问仪表板
配置 memcached 会话存储服务:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': 'controller:11211',
}
}
启用第3版认证API:
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
启用对域的支持:
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
配置API版本:
OPENSTACK_API_VERSIONS = {
"identity": 3,
"image": 2,
"volume": 2,
}
通过仪表盘创建用户时的默认域配置为 default :
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "default"
通过仪表盘创建的用户默认角色配置为 user :
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
如果您选择网络参数1,禁用支持3层网络服务:
OPENSTACK_NEUTRON_NETWORK = {
...
'enable_router': False,
'enable_quotas': 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 = "TIME_ZONE"
重启web服务器以及会话存储服务:
systemctl restart httpd.service memcached.service
##################启动实例###################
创建提供者网络:
neutron net-create --shared --provider:physical_network provider --provider:network_type flat provider
neutron subnet-create --name provider --allocation-pool start=10.0.0.100,end=10.0.0.200 \--dns-nameserver 8.8.8.8 --gateway 10.0.0.1 provider 10.0.0.0/24
创建m1.nano规格的主机
openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano
生成一个键值对:
ssh-keygen -q -N ""
openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey
openstack keypair list
增加安全组规则
openstack security group rule create --proto icmp default
openstack security group rule create --proto tcp --dst-port 22 default
确定实例选项:
openstack flavor list
openstack image list
openstack network list
openstack security group list
创建实例:
openstack server create --flavor m1.tiny --image cirros --nic net-id= f94bf624-31b6-441a-b628-4683390d04c7 --security-group default --key-name mykey provider-instance
openstack server list
openstack console url show provider-instance
Openstak(M版)控制节点安装的更多相关文章
- openstack grizzly版cloud控制节点安装
openstack-ubuntu-create 参考官方文档 三个节点:cloud :控制节点内网:10.10.10.10外网:172.16.56.252 network:网络节点内网:10.10.1 ...
- Kubernetes控制节点安装配置
#环境安装Centos 7 Linux release 7.3.1611网络: 互通配置主机名设置各个服务器的主机名hosts#查找kubernetes支持的docker版本Kubernetes v1 ...
- openstack ocata版(脚本)控制节点安装
一.初始化环境: 1.更换yum源: yum install -y wget mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS- ...
- CentOS7安装OpenStack(Rocky版)-01.控制节点的系统环境准备
分享一下Rocky版本的OpenStack安装管理经验: OpenStack每半年左右更新一版,目前是版本是201808月发布的版本-R版(Rocky),目前版本安装方法优化较好,不过依然是比较复杂 ...
- CentOS7安装OpenStack(Rocky版)-06.安装Neutron网络服务(控制节点)
上一章介绍了独立的nova计算节点的安装方法,本章分享openstack的网络服务neutron的安装配制方法 ------------------- 完美的分割线 ----------------- ...
- 安装Rocky版OpenStack 1控制节点+1计算节点环境部署脚本
在上一篇文章中叙述了具体的安装部署过程,在这里把相应的部署脚本写出来,供大家参考: 一.执行部署的setup.sh脚本: #!/bin/bash ########################### ...
- CentOS7安装OpenStack(Rocky版)-02.安装Keyston认证服务组件(控制节点)
本文分享openstack的认证服务组件keystone --------------- 完美的分割线 ---------------- 2.0.keystone认证服务 1)用户与认证:用户权限与用 ...
- CentOS7安装OpenStack(Rocky版)-09.安装Cinder存储服务组件(控制节点)
本文分享openstack的Cinder存储服务组件,cinder服务可以提供云磁盘(卷),类似阿里云云盘 ----------------------- 完美的分隔线 -------------- ...
- CentOS7安装OpenStack(Rocky版)-04.安装Nova计算服务(控制节点)
上一篇文章分享了glance镜像服务的安装配置,本文主要分享openstack的计算服务Nova的安装和配制方法 ------------------ 完美的分割线 ----------------- ...
随机推荐
- c++ 请抛弃匈牙利命名法 - 变量命名代码风格的建议。
我只针对c++码农们讲,其他语言不了解不过应该大同小异.曾几何时翻开21天学通c++系列等脑残入门书,都以匈牙利命名法示人(DWORD dwXXX, int nXXX, string strXXX). ...
- iOS 学习笔记一【屏幕截图,并显示当前View】
// 直接上代码: // // ViewController.h // 屏幕截图测试 // // Created by 博爱之家 on 15/11/11. // Copyright © 2015年 博 ...
- tic-tac-toe游戏代码
package com.p4f.tictactoe.demo; import javax.swing.border.Border; public class Board { /** * positio ...
- PHP基础之Autoload
PHP的自动加载autoload机制很重要,这里做2个小练习 原创文章,转载请注明:http://www.cnblogs.com/phpgcs 文件结构如下,2种方式实现自动加载 1,自定义函数 2, ...
- er图 画图工具
http://www.oschina.net/project/tag/83/db-model
- 【转】在Eclipse中使用JUnit4进行单元测试(高级篇)
http://blog.csdn.net/andycpp/article/details/1329218 通过前2篇文章,您一定对JUnit有了一个基本的了解,下面我们来探讨一下JUnit4中一些高级 ...
- Linux gdb调试器
gdb的启动 --gdb 程序名 [corefile] --corefile是可选的,但能增强gdb的调试能力 --强调:启动gdb必须在编译命里加上"-g"参数,"-g ...
- jQuery一步一步实现跨浏览器的可编辑表格,支持IE、Firefox、Safari、
脚 本 之 家 www.jb51.net 脚本云 专题 素材下载 电子书 软件下载 源码下载 服务器常用软件 a5交易 首页 网页制作 脚本专栏 脚本下载 网络编程 数据库 CMS教程 电子书籍 平面 ...
- 第一百八十六节,jQuery,验证表单插件,Ajax 表单插件,验证和提交表单
jQuery,验证表单插件,Ajax 表单插件,验证和提交表单 HTML <form id="reg" method="post" action=&quo ...
- 第一百七十一节,jQuery,高级事件,模拟操作,命名空间,事件委托,on、off 和 one
jQuery,高级事件,模拟操作,命名空间,事件委托,on.off 和 one 学习要点: 1.模拟操作 2.命名空间 3.事件委托 4.on.off 和 one jQuery 不但封装了大量常用的事 ...