zoukankan      html  css  js  c++  java
  • Openstack:ice-house安装过程

    #apt-get install ntp
    dpkg-reconfigure tzdata --> Asia -->Shuanghai

    #apt-get install python-mysqldb mysql-server
    Edit the /etc/mysql/my.cnf file:
    [mysqld]
    ...
    bind-address = 10.0.0.11
    [mysqld]
    ...
    default-storage-engine = innodb
    innodb_file_per_table
    collation-server = utf8_general_ci
    init-connect = 'SET NAMES utf8'
    character-set-server = utf8

    #service mysql restart

    #mysql_install_db
    #mysql_secure_installation

    --------------------------------------

    # apt-get install python-software-properties
    # add-apt-repository cloud-archive:icehouse
    # apt-get update
    # apt-get dist-upgrade
    # apt-get install linux-image-generic-lts-saucy linux-headers-generic-lts-saucy
    # reboot

    --------------------------------------
    # apt-get install rabbitmq-server
    # rabbitmqctl change_password guest openstack

    --------------------------------------

    create database keystone default character set utf8;
    grant all on keystone.* to 'keystone'@'%' identified by 'openstack';

    #Install Identity
    apt-get install keystone
    rm /var/lib/keystone/keystone.db
    vi /etc/keystone/keystone.conf
    connection = mysql://keystone:openstack@keystone/keystone
    su -s /bin/sh -c "keystone-manage db_sync" keystone
    vi /etc/keystone/keystone.conf
    [DEFAULT]
    # A "shared secret" between keystone and other openstack services
    admin_token = ADMIN_TOKEN
    log_dir = /var/log/keystone
    (crontab -l -u keystone 2>&1 | grep -q token_flush) ||
    echo '@hourly /usr/bin/keystone-manage token_flush >/var/log/keystone/keystone-tokenflush.log 2>&1' >> /var/spool/cron/crontabs/keystone

    --------------------------------------

    vi keystone-super
    $ export OS_SERVICE_TOKEN=ADMIN_TOKEN
    $ export OS_SERVICE_ENDPOINT=http://controller:35357/v2.0
    keystone user-create --name=admin --pass=openstack
    keystone role-create --name=admin
    keystone tenant-create --name=admin --description="Admin Tenant"
    keystone user-role-add --user=admin --tenant=admin --role=admin
    keystone user-role-add --user=admin --role=_member_ --tenant=admin
    -----------------
    keystone tenant-create --name=service --description="Service Tenant"
    -----------------
    keystone user-create --name=demo --pass=openstack
    keystone tenant-create --name=demo --description="Demo Tenant"
    keystone user-role-add --user=demo --role=_member_ --tenant=demo

    ---------------------------------------

    keystone service-create --name=keystone --type=identity --description="OpenStack Identity"
    keystone endpoint-create
      --service-id=$(keystone service-list | awk '/ identity / {print $2}')
      --publicurl=http://keystone:5000/v2.0
      --internalurl=http://keystone:5000/v2.0
      --adminurl=http://keystone:35357/v2.0

    -------------------------------------
      apt-get install python-pip
    -------------------------------------
    #Instacll Image Service
    apt-get install glance python-glanceclient
    rm /var/lib/glance/glance.sqlite
    vi /etc/glance/glance-api.conf
    [database]
    connection = mysql://glance:openstack@glance/glance
    [keystone_authtoken]
    auth_uri = http://keystone:5000
    auth_host = keystone
    auth_port = 35357
    auth_protocol = http
    admin_tenant_name = service
    admin_user = glance
    admin_password = openstack
    [paste_deploy]
    ...
    flavor = keystone

    vi /etc/glance/glance-registry.conf
    [database]
    connection = mysql://glance:openstack@glance/glance
    [keystone_authtoken]
    auth_uri = http://keystone:5000
    auth_host = keystone
    auth_port = 35357
    auth_protocol = http
    admin_tenant_name = service
    admin_user = glance
    admin_password = openstack
    [paste_deploy]
    ...
    flavor = keystone

    su -s /bin/sh -c "glance-manage db_sync" glance
    keystone user-create --name=glance --pass=openstack
    keystone user-role-add --user=glance --tenant=service --role=admin
    keystone service-create --name=glance --type=image
      --description="OpenStack Image Service"
    keystone endpoint-create
      --service-id=$(keystone service-list | awk '/ image / {print $2}')
      --publicurl=http://glance:9292
      --internalurl=http://glance:9292
      --adminurl=http://glance:9292

    service glance-registry restart
    service glance-api restart

    -----------------------------------
    mkdir /tmp/images
    cd /tmp/images/
    wget http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img

    glance image-create --name='cirros-0.3.2-x86_64' --disk-format=qcow2
      --container-format=bare  --is-public=True --progress < cirros-0.3.2-x86_64-disk.img

    -----------------------------------
    #Install Compute

    1. 创建DB
    create database nova;
    grant all on nova.* to 'nova'@'%' identified by 'openstack';

    2. 创建keystone帐号
    keystone user-create --name=nova --pass=openstack
    keystone user-role-add --user=nova --tenant=service --role=admin

    3. 安装
    apt-get install nova-api nova-cert nova-conductor nova-consoleauth
      nova-novncproxy nova-scheduler python-novaclient

    apt-get install nova-compute-qemu python-guestfs

    rm /var/lib/nova/nova.sqlite

    4. 配置
    vi /etc/nova/nova.conf

    [DEFAULT]
    ...
    auth_strategy = keystone

    rpc_backend = rabbit
    rabbit_host = controller
    rabbit_password = openstack

    my_ip = 10.0.0.3
    vnc_enabled = True
    vncserver_listen = 0.0.0.0
    vncserver_proxyclient_address = 10.0.0.3
    novncproxy_base_url = http://nova:6080/vnc_auto.html

    #glance
    glance_host = glance
    image_service = nova.image.glance.GlanceImageService
    glance_api_servers = glance:9292

    #livirt
    libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver

    #neutron
    network_api_class = nova.network.neutronv2.api.API
    neutron_url = http://neutron:9696
    neutron_auth_strategy = keystone
    neutron_admin_tenant_name = service
    neutron_admin_username = neutron
    neutron_admin_password = openstack
    neutron_admin_auth_url = http://keystone:35357/v2.0
    linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
    firewall_driver = nova.virt.firewall.NoopFirewallDriver
    security_group_api = neutron

    #meta-secret
    service_neutron_metadata_proxy = true
    neutron_metadata_proxy_shared_secret = openstack

    #异常关系
    vif_plugging_timeout = 10
    vif_plugging_is_fatal = False

    [database]
    connection = mysql://nova:openstack@controller/nova

    [keystone_authtoken]
    ...
    auth_uri = http://nova:5000
    auth_host = controller
    auth_port = 35357
    auth_protocol = http
    admin_tenant_name = service
    admin_user = nova
    admin_password = openstack

    --------------
    vi /etc/nova/nova-compute.conf
    [libvirt]
    ...
    virt_type = qemu

    5. 注册keystone服务
    keystone service-create --name=nova --type=compute --description="OpenStack Compute"
    keystone endpoint-create
      --service-id=$(keystone service-list | awk '/ compute / {print $2}')
      --publicurl=http://nova:8774/v2/%(tenant_id)s
      --internalurl=http://nova:8774/v2/%(tenant_id)s
      --adminurl=http://nova:8774/v2/%(tenant_id)s

    6. 同步数据库
    su -s /bin/sh -c "nova-manage db sync" nova

    7. 重启服务&验证
    service nova-api restart
    service nova-cert restart
    service nova-consoleauth restart
    service nova-scheduler restart
    service nova-conductor restart
    service nova-novncproxy restart
    service nova-compute restart

    nova image-list

    -----------------------------------
    #Install Neutron

    1. 创建DB
    create database neutron;
    grant all on neutron.* to 'neutron'@'%' identified by 'openstack';

    2. 创建帐号
    keystone user-create --name neutron --pass openstack
    keystone user-role-add --user neutron --tenant service --role admin

    3. 安装neutron
    apt-get install neutron-server neutron-plugin-ml2
    rm /var/lib/neutron/neutron.sqlite

    4. 配置
    vi /etc/neutron/neutron.conf

    [DEFAULT]
    core_plugin = ml2
    service_plugins = router
    allow_overlapping_ips = True

    auth_strategy=keystone
    control_exchange = neutron

    rpc_backend = neutron.openstack.common.rpc.impl_kombu
    rabbit_host = controller
    rabbit_password = openstack

    [database]
    connection = mysql://neutron:openstack@controller/neutron

    [keystone_authtoken]
    auth_uri = http://keystone:35357
    auth_host = keystone
    auth_port = 35357
    auth_protocol = http
    admin_tenant_name = service
    admin_user = neutron
    admin_password = openstack
    -----------------------
    vi /etc/neutron/plugins/ml2/ml2_conf.ini

    [ml2]
    type_drivers = gre
    tenant_network_types = gre
    mechanism_drivers = openvswitch

    [ml2_type_gre]
    ...
    tunnel_id_ranges = 1:1000

    [ovs]
    ...
    local_ip = 10.0.0.3 #INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS
    tunnel_type = gre
    enable_tunneling = True

    [securitygroup]
    ...
    firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
    enable_security_group = True

    ----------------------
    配置nova.conf
    参见#与neutron关系

    5. 同步DB
    neutron不需要

    6. 注册服务
    keystone service-create --name neutron --type network --description "OpenStack Networking"
    keystone endpoint-create
      --service-id $(keystone service-list | awk '/ network / {print $2}')
      --publicurl http://neutron:9696
      --adminurl http://neutron:9696
      --internalurl http://neutron:9696

    7. 重启服务&验证
    service neutron-server restart
    service nova-api restart
    service nova-scheduler restart
    service nova-conductor restart

    ----------------------------------------
    #配置网络结点
    apt-get install neutron-plugin-ml2 neutron-plugin-openvswitch-agent
      neutron-l3-agent neutron-dhcp-agent

    apt-get install neutron-common neutron-plugin-ml2 neutron-plugin-openvswitch-agent

    1. 配置内核
    vi /etc/sysctl.conf

    net.ipv4.ip_forward=1
    net.ipv4.conf.all.rp_filter=0
    net.ipv4.conf.default.rp_filter=0

    sysctl -p

    3. 配置L3
    vi /etc/neutron/l3_agent.ini
    [DEFAULT]
    ...
    interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
    use_namespaces = True
    verbose = True

    4. 配置DHCP
    vi /etc/neutron/dhcp_agent.ini
    [DEFAULT]
    ...
    interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
    dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
    use_namespaces = True
    verbose = True
    dnsmasq_config_file = /etc/neutron/dnsmasq-neutron.conf

    vi /etc/neutron/dnsmasq-neutron.conf
    dhcp-option-force=26,1454

    killall dnsmasq

    5. 配置meta-data
    vi /etc/neutron/metadata_agent.ini
    [DEFAULT]
    ...
    auth_url = http://controller:5000/v2.0
    auth_region = regionOne
    admin_tenant_name = service
    admin_user = neutron
    admin_password = openstack
    nova_metadata_ip = nova
    metadata_proxy_shared_secret = openstack

    vi /etc/nova/nova.conf
    [DEFAULT]
    ...
    service_neutron_metadata_proxy = true
    neutron_metadata_proxy_shared_secret = openstack

    ------------------------------------
    #配置OVS, 关联之前的启动, 可能导致网络不通
    1. 设置网卡: 必须加2张NAT
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet manual
            up ifconfig eth0 0.0.0.0 promisc up
            down ifconfig eth0 down

    auto br-eth0
    iface br-eth0 inet static
            address 192.168.2.3
            netmask 255.255.255.0
            gateway 192.168.2.2
            dns-nameservers 192.168.2.2

    auto eth1
    iface eth1 inet manual
            up ifconfig eth1 0.0.0.0 promisc up
            down ifconfig eth1 down

    auto br-eth1
    iface br-eth1 inet static
            address 10.0.0.3
            netmastk 255.255.255.0

    2. 关闭gro
    ethtool -k eth0
    ethtool -K eth0 gro off
    ethtool -k eth1
    ethtool -K eth1 gro off

    3. 设置OVS
    service openvswitch-switch restart
    ovs-vsctl add-br br-eth0
    ovs-vsctl add-port br-eth0 eth0
    ovs-vsctl add-br br-eth1
    ovs-vsctl add-port br-eth1 eth1

    ===================================
    ===================================
    #修改自动重启
    root@ubuntu:/etc/init# ll keystone*
    -rw-r--r-- 1 root root 284 Aug 11 23:04 keystone.conf

    root@ubuntu:/etc/init# ll glance-*
    -rw-r--r-- 1 root root 278 Aug 11 22:15 glance-api.conf
    -rw-r--r-- 1 root root 293 Aug 11 22:15 glance-registry.conf

    root@ubuntu:/etc/init# ll nova*
    -rw-r--r-- 1 root root 391 Aug 13 21:18 nova-api.conf
    -rw-r--r-- 1 root root 386 Aug 13 21:18 nova-cert.conf
    -rw-r--r-- 1 root root 679 Aug 13 21:18 nova-compute.conf
    -rw-r--r-- 1 root root 395 Aug 13 21:18 nova-conductor.conf
    -rw-r--r-- 1 root root 412 Aug 13 21:18 nova-consoleauth.conf
    -rw-r--r-- 1 root root 416 Aug 13 21:18 nova-novncproxy.conf
    -rw-r--r-- 1 root root 396 Aug 13 21:18 nova-scheduler.conf

    root@ubuntu:/etc/init# ll neutron-*
    -rw-r--r-- 1 root root 730 Aug 13 03:15 neutron-dhcp-agent.conf
    -rw-r--r-- 1 root root 772 Aug 13 03:15 neutron-l3-agent.conf
    -rw-r--r-- 1 root root 539 Aug 13 03:15 neutron-metadata-agent.conf
    -rw-r--r-- 1 root root 439 Aug 13 03:15 neutron-ovs-cleanup.conf
    -rw-r--r-- 1 root root 556 Aug 13 03:15 neutron-plugin-openvswitch-agent.conf
    -rw-r--r-- 1 root root 633 Aug 13 03:15 neutron-server.conf

    =========================================
    service mysql restart
    service rabbitmq-server restart

    #keystone
    service keystone restart

    #glance
    service glance-registry restart
    service glance-api restart

    #nova
    service nova-scheduler restart
    service nova-cert restart
    service nova-api restart
    service nova-compute restart
    service nova-conductor restart
    service nova-consoleauth restart

    #neutron
    service neutron-plugin-openvswitch-agent restart
    service neutron-server restart
    service neutron-dhcp-agent restart
    service neutron-metadata-agent restart
    //service neutron-ovs-cleanup restart

    {"message": "Virtual Interface creation failed", "code": 500, "details": "  File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 290, in decorated_function |

    ----------------------------------------
    #安装glance

    [DEFAULT]
    rabbit_host = controller
    rabbit_port = 5672
    rabbit_use_ssl = false
    rabbit_userid = guest
    rabbit_password = openstack
    rabbit_virtual_host = /
    rabbit_notification_exchange = glance
    rabbit_notification_topic = notifications
    rabbit_durable_queues = False

    [keystone_authtoken]
    auth_uri = http://keystone:5000
    auth_host = keystone
    auth_port = 35357
    auth_protocol = http
    admin_tenant_name = service
    admin_user = glance
    admin_password = openstack

    [paste_deploy]
    ...
    flavor = keystone

    --------------------------------------------------
    创建网络:

    vi /etc/neutron/plugins/ml2/ml2_conf.ini

    [ml2_type_flat]
    flat_networks = * 

    [ovs]
    network_vlan_ranges = br-eth0
    bridge_mappings = br-eth0:br-eth0

    neutron net-create NAME --tenant_id TENANT_ID --provider:network_type flat --provider:physical_network br-eth0

    neutron net-create eth0
    --shared
    --router:external True
    --provider:network_type flat
    --provider:physical_network br-eth0

    neutron net-create eth1
    --shared
    --router:external True
    --provider:network_type flat
    --provider:physical_network br-eth1

    neutron subnet-create eth0 --name eth0-subnet0
      --allocation-pool start=192.168.2.10,end=192.168.2.250
      --gateway 192.168.2.2 192.168.2.0/24

    neutron subnet-create eth1 --name eth1-subnet0
      --allocation-pool start=10.0.0.10,end=10.0.0.250
      --gateway 10.0.0.1 10.0.0.0/24

    nova secgroup-create admin "admin secgroup"
    nova secgroup-add-rule admin icmp -1 -1 0.0.0.0/0
    nova secgroup-add-rule admin tcp 22 22 0.0.0.0/0

    nova boot
    --flavor 1
    --image 96a1ab97-b954-4816-a004-2d2c95bd5a3d
    --key-name mykey
    --security-groups game
    --nic net-id=1fac7d39-601c-4b9b-b317-3ced11b19899
    --nic net-id=871a5cdd-e15c-466d-a1ca-0394244862c1
    cirros01

    nova secgroup-create game "admin secgroup"
    nova secgroup-add-rule game icmp -1 -1 0.0.0.0/0
    nova secgroup-add-rule game tcp 22 22 0.0.0.0/0

  • 相关阅读:
    数据查询
    泰勒展开及其应用
    搜索排序算法
    因子分解机 FM
    偏差方差分解
    Softmax 损失-梯度计算
    目标检测网络之 Mask R-CNN
    目标检测网络之 R-FCN
    深度学习-conv卷积
    目标检测网络之 YOLOv3
  • 原文地址:https://www.cnblogs.com/zolo/p/5849072.html
Copyright © 2011-2022 走看看