#############修改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

转载于:https://www.cnblogs.com/chimeiwangliang/p/6980226.html

Openstak(M版)控制节点安装相关推荐

  1. CentOS7安装OpenStack(Rocky版)-02.安装Keyston认证服务组件(控制节点)

    本文分享openstack的认证服务组件keystone --------------- 完美的分割线 ---------------- 2.0.keystone认证服务 1)用户与认证:用户权限与用 ...

  2. [Ubuntu 12.10] Openstack 多节点安装--前期准备网络拓扑

    为什么80%的码农都做不了架构师?>>>    研究openstack也有一段时间了,写了一大堆笔记都没整理,最近要把开发机迁移到openstack上试试,安装一个多节点玩玩,也方便 ...

  3. Openstack rocky 部署四: neutron 部署与验证(控制节点)

    Openstack 云计算(二): Openstack Rocky部署四 neutron 部署与验证 (控制节点) 标签(空格分隔): openstack系列 一:Neutron概述 二:Neutro ...

  4. 脚本安装Rocky版OpenStack 1控制节点+1计算节点环境部署

    视频安装指南请访问: http://39.96.203.138/wordpress/document/%E8%84%9A%E6%9C%AC%E5%AE%89%E8%A3%85rocky%E7%89%8 ...

  5. (九)OpenStack---M版---双节点搭建---Swift安装和配置(单存储节点)

    ↓↓↓↓↓↓↓↓视频已上线B站↓↓↓↓↓↓↓↓ >>>>>>传送门 本次搭建仅采用Compute单节点做swift组件 1.Controller安装并配置控制节点 ...

  6. (五)OpenStack---M版---双节点搭建---Nova安装和配置

    ↓↓↓↓↓↓↓↓视频已上线B站↓↓↓↓↓↓↓↓ >>>>>>传送门 1.创建nova 和 nova_api数据库 2.获得 admin 凭证来获取只有管理员能执行的 ...

  7. (二)OpenStack---M版---双节点搭建---数据库安装和配置

    ↓↓↓↓↓↓↓↓视频已上线B站↓↓↓↓↓↓↓↓ >>>>>>传送门 本章节只在Controller节点执行 1.安装Mariadb数据库来存储信息 2.NoSQL数 ...

  8. Hadoop介绍及最新稳定版Hadoop 2.4.1下载地址及单节点安装

     Hadoop介绍 Hadoop是一个能对大量数据进行分布式处理的软件框架.其基本的组成包括hdfs分布式文件系统和可以运行在hdfs文件系统上的MapReduce编程模型,以及基于hdfs和MapR ...

  9. (八)OpenStack---M版---双节点搭建---Cinder安装和配置

    ↓↓↓↓↓↓↓↓视频已上线B站↓↓↓↓↓↓↓↓ >>>>>>传送门 1.创建数据库并授权 2.获得admin凭证执行管理员命令并创建服务证书 3.创建块存储设备AP ...

最新文章

  1. c语言中和if语句作用相似的运算符,南开18秋学期(1709、1803、1809)《C语言程序设计》在线作业【答案】...
  2. python自学教程读书导图-自学Python第一天:起点读书自动领取经验值(附思路讲解)...
  3. usaco3.33Camelot(BFS)
  4. Angular In-memory Web API使用介绍
  5. vivo手机解锁工具_点燃解锁的多一份激情,vivo NEX双屏版解锁体验报告
  6. 在类中用class时数据是共有还是私有_jvm学习笔记之class文件的加载、初始化
  7. typra修改快捷键
  8. 百搭手绘卡通牛年吉祥生肖素材,萌到心里的小牛
  9. Dapper:The member of type SeoTKD cannot be used as a parameter Value
  10. MySql 性能调优策略
  11. linux如何删除镜像文件,linux 删除文件,小编教你linux如何删除文件
  12. 程序员修炼之道——读序
  13. 《虎胆龙威4》观后感
  14. 【多式联运】基于模拟退火优化遗传算法求解多式联运运输问题(含碳政策)含Matlab代码
  15. 战地1 - 概念艺术
  16. 前端开发中表格table单元格高度或者行高的设置
  17. 线程共享地址空间的问题
  18. Lesson 29 Come in, Amy
  19. 按钮自动发光用html怎么弄,HTML+CSS+JS发光开关按钮
  20. CSS、JS 使DIV水平 和 垂直居中的各种方法

热门文章

  1. 《机器学习实战》学习笔记
  2. C++_const修饰指针_指针和数组_指针和函数_指针配合数组和函数案例_用指针数组实现冒泡排序---C++语言工作笔记024
  3. 大数据之-Hadoop之HDFS的API操作_文件下载案例---大数据之hadoop工作笔记0058
  4. 大数据_MapperReduce_从CSV文件中读取数据到Hbase_测试---Hbase工作笔记0022
  5. Netty工作笔记0064---WebSocket长连接开发3
  6. python数据结构剑指offer-两个链表的第一个公共结点
  7. X3D 参数代码(一)
  8. 1002 C语言输入解决方案
  9. java 二叉树的各种遍历
  10. 杭电1799循环多少次?