`
haoningabc
  • 浏览: 1478156 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

openstack的M版本安装

阅读更多
参考
http://docs.openstack.org/mitaka/install-guide-rdo


三台机器同步时间
ntpdate  cn.ntp.org.cn

两台机器controller节点mcon   compute节点mcom
配置
vim /etc/hosts
######
192.168.139.251 mcon
192.168.139.252 mcom
#####
/etc/sysconfig/network-scripts/ifcfg-eth0
#############
NAME="eth0"
DEVICE="eth0"
ONBOOT="yes"
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.139.251
NETMASK=255.255.240.0
GATEWAY=192.168.128.1
DNS1=114.114.114.114
#####################


systemctl stop firewalld.service
systemctl disable firewalld.service

vim /etc/hostname
vim /etc/selinux/config
########
SELINUX=disabled
########
yum install centos-release-openstack-mitaka -y
yum install https://rdoproject.org/repos/rdo-release.rpm -y
yum upgrade -y
yum install python-openstackclient -y
yum install openstack-selinux -y
yum install mariadb mariadb-server python2-PyMySQL -y

vim /etc/my.cnf.d/mariadb-server.cnf
###########################
[mysqld]
bind-address = 192.168.139.251
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
############################

systemctl enable mariadb.service
systemctl start mariadb.service

mysql_secure_installation
配置密码

yum install mongodb-server mongodb -y
/etc/mongod.conf
########
bind_ip = 192.168.139.251
smallfiles = true
##########
systemctl enable mongod.service
systemctl start mongod.service

yum install rabbitmq-server -y

systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service

rabbitmqctl add_user openstack haoning
rabbitmqctl set_permissions openstack ".*" ".*" ".*"

yum install memcached python-memcached -y
systemctl enable memcached.service
systemctl start memcached.service
@@@@@@@@@@@@@@@@在controller节点安装keystone@@@@@@@@@@@@@@@@@@
mysql -u root -p
CREATE DATABASE keystone;

GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost'  IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%'  IDENTIFIED BY 'haoning';
flush privileges;

openssl rand -hex 10 得到3b4cc857a2c7ba154ee3
yum install openstack-keystone httpd mod_wsgi -y

/etc/keystone/keystone.conf
##########
[DEFAULT]
admin_token = 3b4cc857a2c7ba154ee3
[database]
connection = mysql+pymysql://keystone:haoning@mcon/keystone
[token]
provider = fernet
#############

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

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

/etc/httpd/conf/httpd.conf
########################
ServerName mcon
########################
/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>
#########################
systemctl enable httpd.service
systemctl start httpd.service

export OS_TOKEN=3b4cc857a2c7ba154ee3
export OS_URL=http://mcon:35357/v3
export OS_IDENTITY_API_VERSION=3

openstack service create  --name keystone --description "OpenStack Identity" identity
openstack endpoint create --region wuhan  identity public http://mcon:5000/v3
openstack endpoint create --region wuhan  identity internal http://mcon:5000/v3
openstack endpoint create --region wuhan  identity admin http://mcon:35357/v3
如果建错
openstack endpoint list
#openstack endpoint delete edc8611dda794bffb8221d4e794f214b

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

openstack token issue


unset OS_TOKEN OS_URL
openstack --os-auth-url http://mcon:5000/v3  --os-project-domain-name default --os-user-domain-name default  --os-project-name demo --os-username demo token issue

o_admin.sh
##########################
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=haoning
export OS_AUTH_URL=http://mcon:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
##########################

demo.sh
##########################
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=haoning
export OS_AUTH_URL=http://mcon:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
########################

. demo.sh
openstack token issue


@@@@@@@@@@@@@@@glance@@@@@@@@@@@@@@@@
mysql -u root -p
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'haoning';
flush PRIVILEGES;
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 wuhan image public http://mcon:9292
openstack endpoint create --region wuhan  image internal http://mcon:9292
openstack endpoint create --region wuhan image admin http://mcon:9292

yum install openstack-glance -y

/etc/glance/glance-api.conf
#########################
[database]
connection = mysql+pymysql://glance:haoning@mcon/glance
[keystone_authtoken]
auth_uri = http://mcon:5000
auth_url = http://mcon:35357
memcached_servers = mcon:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = haoning
[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
#########################

/etc/glance/glance-registry.conf
#####################
[database]
connection = mysql+pymysql://glance:haoning@mcon/glance
[keystone_authtoken]
auth_uri = http://mcon:5000
auth_url = http://mcon:35357
memcached_servers = mcon:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = haoning
[paste_deploy]
flavor = keystone
####################

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
. o_admin.sh
wget http://download.cirros-cloud.net/0.3.4/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
openstack image list

@@@@@@@@@@@@@@@@@@@nova controller节点@@@@@@@@@@@@@

mysql -u root -p
CREATE DATABASE nova_api;
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'haoning';

#GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'zouhuiying';
#GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'zouhuiying';
#GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'zouhuiying';
#GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'zouhuiying';
flush privileges;
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 wuhan compute public http://mcon:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region wuhan compute internal http://mcon:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region wuhan compute admin http://mcon:8774/v2.1/%\(tenant_id\)s

yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler -y
/etc/nova/nova.conf

api_database
database
都要配置,容易漏

######################
[DEFAULT]
enabled_apis = osapi_compute,metadata
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.139.251
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[oslo_messaging_rabbit]
rabbit_host = mcon
rabbit_userid = openstack
rabbit_password = haoning
[api_database]
connection = mysql+pymysql://nova:haoning@mcon/nova_api
[database]
connection = mysql+pymysql://nova:haoning@mcon/nova
[keystone_authtoken]
auth_uri = http://mcon:5000
auth_url = http://mcon:35357
memcached_servers = mcon:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = haoning
#Comment out or remove any other options in the [keystone_authtoken] section.
[vnc]
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[glance]
api_servers = http://mcon:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
#####################
#其实还要配置【neutron】 ,后面继续配置
su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage db sync" 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
openstack service list

@@@@@@@@@@@@@@@nova compute节点@@@@@@@@@@@@@@@@@@@@@@@
yum install openstack-nova-compute -y

/etc/nova/nova.conf
################
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.139.252
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[oslo_messaging_rabbit]
rabbit_host = mcon
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://mcon:5000
auth_url = http://mcon:35357
memcached_servers = mcon:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = haoning
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://mcon:6080/vnc_auto.html
[glance]
api_servers = http://mcon:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[libvirt]
virt_type = qemu
#####################
egrep -c '(vmx|svm)' /proc/cpuinfo

systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
. o_admin.sh
openstack service list
openstack compute service list

@@@@@@@@@@@@@@@@@@@@@@@@@@neutron controller@@@@@@
create database neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'haoning';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'haoning';
flush privileges;

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 wuhan network public http://mcon:9696
openstack endpoint create --region wuhan network internal http://mcon:9696
openstack endpoint create --region wuhan network admin http://mcon:9696

yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables -y
/etc/neutron/neutron.conf
###########################
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone

notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True

core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True

[keystone_authtoken]
auth_uri = http://mcon:5000
auth_url = http://mcon:35357
memcached_servers = mcon:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = haoning

[oslo_messaging_rabbit]
rabbit_host = mcon
rabbit_userid = openstack
rabbit_password = haoning
[database]
connection = mysql+pymysql://neutron:haoning@mcon/neutron
[nova]
auth_url = http://mcon:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = wuhan
project_name = service
username = nova
password = haoning
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
######################

/etc/neutron/plugins/ml2/ml2_conf.ini
###################################
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
[ml2_type_flat]
flat_networks = provider
[ml2_type_vxlan]
vni_ranges = 1:1000
[securitygroup]
enable_ipset = True
###################################

/etc/neutron/plugins/ml2/linuxbridge_agent.ini
#########################
[linux_bridge]
physical_interface_mappings = provider:eth0
[vxlan]
enable_vxlan = True
local_ip = 192.168.139.251
l2_population = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
############################

/etc/neutron/l3_agent.ini
############################
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
external_network_bridge =
############################



/etc/neutron/dhcp_agent.ini
#####################
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
###################


/etc/neutron/metadata_agent.ini
################
[DEFAULT]
nova_metadata_ip = mcon
metadata_proxy_shared_secret = METADATA_SECRET
#####################

/etc/nova/nova.conf
######################★★★★★★★★★★★★★★★★nova需要操作neutron,没有会报NoSuchOptError: no such option in group neutron: auth_plugin#####################
[neutron]
url = http://mcon:9696
auth_url = http://mcon:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = wuhan
project_name = service
username = neutron
password = haoning

service_metadata_proxy = True
metadata_proxy_shared_secret = METADATA_SECRET
#################################

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

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

systemctl enable neutron-l3-agent.service
systemctl start neutron-l3-agent.service

neutron agent-list
openstack service list



@@@@@@@@@@@@@@@@@@neutron compute节点@@@@@@@@@@@@@@@

yum install openstack-neutron-linuxbridge ebtables ipset -y

/etc/neutron/neutron.conf
##########################
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
[oslo_messaging_rabbit]
rabbit_host = mcon
rabbit_userid = openstack
rabbit_password = haoning
[keystone_authtoken]
auth_uri = http://mcon:5000
auth_url = http://mcon:35357
memcached_servers = mcon:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = haoning

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
############################

/etc/neutron/plugins/ml2/linuxbridge_agent.ini
########################
[linux_bridge]
physical_interface_mappings = provider:eth0
[vxlan]
enable_vxlan = True
local_ip = 192.168.139.252
l2_population = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
############################

/etc/nova/nova.conf
######################
[neutron]
url = http://mcon:9696
auth_url = http://mcon:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = wuhan
project_name = service
username = neutron
password = haoning
######################

systemctl restart openstack-nova-compute.service

systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service


neutron ext-list
neutron agent-list


openstack flavor list
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  list
#openstack security group rule create --proto tcp --dst-port 22 default

openstack image list
openstack network list

openstack security group list


nova service-list
neutron agent-list

neutron net-list



bridge fdb

分享到:
评论

相关推荐

    Openstack M版安装

    手动安装openstack Mitaka版

    Openstack M版本离线搭建

    ### OpenStack M 版本离线搭建详解 #### 一、概述 OpenStack M 版本,即 OpenStack Mitaka 版本,是 OpenStack 的一个成熟版本之一,广泛应用于私有云建设和管理中。然而,在很多企业的环境中,出于安全考虑,内部...

    openstack m 版本搭建

    以上就是关于OpenStack M版本搭建的相关知识点,包括环境准备、网络配置、时间同步、软件包安装、数据库配置以及消息队列服务等内容。在实际部署过程中,还需要根据具体的业务需求和技术栈进行调整和优化。

    openstack的essex安装

    ### OpenStack Essex 版本安装指南 #### 一、OpenStack Essex 概览 OpenStack Essex 是 OpenStack 发展过程中的一个里程碑版本,发布于2012年4月5日,它标志着 OpenStack 从早期阶段步入了一个相对成熟的阶段。...

    openstack 学习及安装笔记

    ### OpenStack学习及安装知识点概览 #### 一、OpenStack简介 - **定义与起源**:OpenStack是由NASA和Rackspace共同发起的一个开源云计算管理平台项目,以Apache许可证授权,旨在为用户提供一个自由、开放的云计算...

    openstack--L版本

    1.手动安装 liberty 版本 openstack 环境 2.手动安装 liberty 版本 openstack 环境(allinone)---安装数据库及 rabbitmq 3.手动安装liberty版本openstack环境(allinone)---安装keystone 4.手动安装 liberty 版本 ...

    Openstack M版安装步骤(Ubuntu 14.04 LTS)

    本文档是我自己参考官方文档搭建OpenStack Mitaka版本时整理总结的安装文档,希望对大家有用。

    openstack-M版一键安装包

    openstack-M资源包 |--cirros-0.3.4-x86_64-disk.img |--local_settings |--openstack_compute_install.sh |--openstack_rpm.tar.gz |--openstack-manuals_html.tar.gz |--openstack-mitaka-autoinstall.sh |--user_...

    openstack-M版安装教程

    openstack-M版安装教程

    Openstack支持FCSAN

    详细介绍了Openstack对接FCSAN的设计,以及虚拟机连接FCSAN的流程,值得推荐。

    OpenStack M版搭建指导文档

    OpenStack M版特指OpenStack的Mitaka版本,它于2016年发布,是OpenStack发展历史中的一个重要里程碑。Mitaka版本引入了许多新功能和改进,特别是在网络、存储、镜像和服务等方面进行了大量的优化。 #### 二、安装...

    华为FusionSphere Openstack云数据中心资料汇总集【视频 PDF】.rar

    fusionsphere openstack 云数据中心搭建36计-04.mp4,网盘文件,永久链接 fusionsphere openstack 云数据中心搭建36计-05.mp4 fusionsphere openstack...ManageOne ServiceCenter_V100R002C30SPC200_01_zh_YZF0118M.hdx

    openstack 概述,安装 fuel多节点方式

    4-1 openstack 概述——local模式,M 版本安装【完成安装】 4-2 openstack 简单操作.pdf 4-3 fuel多节点方式安装openstack.pdf openstack 供应商Mirantis fuel概述 使用fuel安装多结点openstack.pdf 好东西就要分享...

    openstack部署笔记+脚本

    1. **基础环境准备**:首先,确保两台Ubuntu服务器已安装最新版本,并配置了静态IP地址。安装必要的包管理工具,如`apt`,并更新软件源。 2. **安装依赖**:OpenStack依赖于一系列库和服务,例如Keystone(身份服务...

    openstack-neutron-lbaas-14.0.0-1.el7.noarch.rpm

    官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装

    openstack实训报告(超详细,附实训所需要的代码,文档在手,实训不愁)本文件可免费下载,给作者点个赞

    在这一阶段,主要任务是配置虚拟机的基础环境,包括网络设置、系统更新、安装必要的工具等,以确保OpenStack组件能够顺利安装和运行。 ### 第三章 yum源制作 在CentOS中,yum是默认的包管理器,用于安装、升级和...

    OpenstackMitaka本地源

    用于Centos7的OpenstackMitaka版的包,全部下载到本地了,传进去设置好yum源就能用。

    openstack双节点部署.docx

    - **版本M**指的是**Mitaka**版本,发布于2016年4月6日。 - **CentOS 7**是基于Red Hat Enterprise Linux 7的一个免费且开源的Linux发行版。 #### 二、基础环境配置 ##### 2.1 节点硬件规划 - 使用**VMware ...

    openstack install guide zypper kilo英文版

    这份文档主要针对的是Kilo版本,并且特别提到了如何在openSUSE 13.2和SUSE Linux Enterprise Server 12上进行安装。下面我们将从架构、基本环境准备、添加身份服务等几个方面进行详细的解读。 ### 一、架构 #### ...

Global site tag (gtag.js) - Google Analytics