Shunze ¾Ç¶é >¹q¸£¸ê°T¾Ç¨t >OpenStack > ¡m¤À¨É¡nUbuntu³z¹LDevStack¨Ó¦w¸ËOpenStack «¢Åo¡AÁÙ¨S¦³µù¥U©ÎªÌµn¤J¡C½Ð§A[µù¥U|µn¤J]
« ¤W¤@½g¥DÃD Åã¥Ü¦¨¦C¦L¼Ò¦¡ | ¼W¥[¨ì§Úªº³Ì·R
µoªí·s¥DÃD µoªí¦^ÂÐ
§@ªÌ
¥DÃD
shunze
¤u¤Í§B§B


µù¥U¤é´Á: 2002 04
¨Ó¦Û: ¼é¦Á²×¤î¤§¦a
¤å³¹: 2380

shunze Â÷½u
¡m¤À¨É¡nUbuntu³z¹LDevStack¨Ó¦w¸ËOpenStack¤Þ¥Î¦^ÂÐ ½s¿è/§R°£¤å³¹ ·j´M¥Ñ  µoªíªº¨ä¥L¤å³¹ ¦^³øµ¹ª©¥D IP ¦ì¸m ¦^¦¹­¶³Ì¤W¤è

¦bCentOS 7¤W¦¨¥\¦w¸ËOpenStack«á¡A¯à§_¦bUbuntu 14.04¤W¤]§âOpenStack¸Ë°_¨Ó¡I¡H

¦bºô¸ô¤W·j´M«áµo²{¡AUbuntu¤W¥i³z¹LDevStack¦w¸Ë¥]¨Ó¦w¸ËOpenStack¡C
ªá¤FÂI®É¶¡´ú¸Õ«á¡A¦n¤£®e©ö§âOpenStack¸Ë°_¨Ó¡A
¤£¹L¡A³z¹L³o­Ó¦w¸Ë¥]¦w¸Ë¦nOpenStack«á¦³­Ó­P©Rªº°ÝÃD¡A
¨º´N¬O ­«¶}¾÷«á¡AOpenStackªººô¸ôªA°È·|¦³°ÝÃD¡AµLªk¶¶§Q¹B§@¡A
¥B¤w«Ø¥ßªºinstance·|¤£¨£¡I


¾Ú»¡­ì©l¦w¸Ë¥]¤¤ÁÙ¦³ rejoin_stack.sh ³o¤äscript¡A
¯à¦b­«¶}¾÷«á¡A«ì´_OpenStack©Ò¦³ªA°Èªº¥¿±`¹B§@¡I

¦Ó²{¦bªº¦w¸Ë¥]ùØ¡A¤w¸g¨S¦³³o¤äscript¡C
³o¨Ã¤£¬Obug¡A¦Ó¬O¶}µo¤p²Õ»{¬°³o¤äscriptµLªk¾A¥Î©ó¦UºØ±¡§Î¡A
¦Ó¥B¦³¥i¯à·|¯}Ãa¨ä¥¦¥\¯à¡A©Ò¥H§â¥¦¦Û¦w¸Ë¥]¤¤²¾°£¤F...


¦ýºô¸ô¤W¤]§ä¤£¨ìÅýOpenStack«ì´_¥¿±`¹B§@ªº¤èªk¡I¡H
©Ò¥H­nÅéÅç¬Ý¬Ý¦p¦ó¦bUbuntu¤W¦w¸ËOpenStack¬O¥i¥Hªº¡A
¤£¹L­n¤p¤ß³á¡A­«¶}¾÷«á¥i¬O·|Åý±z¶Ì²´ªº¡I
(¯uªº­n¦n¦nÅéÅçOpenStack¡AÁÙ¬O¦bCentOS 7¤W³z¹LRDO¦w¸Ë¥]¨Ó¶i¦æ§a¡ã)


¦w¸ËÀô¹Ò
¦p¦P¥ý«eCentOS 7¤¤ªºÀô¹Ò¤@¯ë¡A¦P¼Ë«Ø¸m©óµêÀÀ¾÷¤W°µ´ú¸Õ
°t¸m¤FCPU 2Áû¡A°O¾ÐÅé4G¤Îºô¥d¤@±i
ºô¤ººô¬q¬°192.168.0.0/24¡A¹w³]¹h¹D¬°192.168.0.254
OpenStack¦Û¤wªº¨p¦³ºô¬q¬°10.0.0.0/24¡Aµ¹¨p¦³¶³ùتºInstance¨Ï¥Î




¥H¤U¬°¦w¸Ëµ§°O¡C
  • ±Nºô¥d³]©w¬°¾ô±µ¼Ò¦¡
    ¦]¬°¦w¸ËÀô¹Ò¬°³æ¤@¤@±iºô¥d¡A©Ò¥H¸òCentOS 7¨º½gªº³]©w¬Û¦P¡A­n§â³o±i eth0 ªººô¥d³]©w¬°¾ô±µ¼Ò¦¡¡A
    Åýpublic»Pprivateºô¬q«Ê¥]³£¯à©ó¦¹±iºô¥d¤¤¹B¦æ¡C

    ¤Á´«¨ìrootÅv­­¡A©óºô¥d³]©w¤¤¡A±Neth0§ï¬°manual¡A¨Ã¥[¤Jbridgeºô¥dbr-exªºIP³]©w¡C
    sudo -s -H
    vim /etc/network/interfaces

    # The primary network interface
    auto eth0
    iface eth0 inet manual

    # Open vSwitch
    auto br-ex
    iface br-ex inet static
    address 192.168.0.92
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.254
    dns-nameservers 8.8.8.8
    ovs_type OVSBridge
    ovs_ports eth0


    ¦w¸Ëopenvswitch-switch®M¥ó
    apt-get install openvswitch-switch
    ovs-vsctl add-br br-ex
    ovs-vsctl add-port br-ex eth0

    ­Y¬O¥HSSH³s½u¨ìUbuntu¡A¦b³o¦æ¥[¤J«áºô¸ô´N·|Â_½u¡A
    ½Ð¥Hconsoleµn¤J«á¡A­«±Ò¹q¸£¡A³o¼Ëºô¥dªº¾ô±µ¥\¯à´Nµo´§®ÄªG¡C
    ¥i¥H¥H¤U«ü¥O¬d¬Ýºô¥d¾ô±µª¬ºA¡C
    sudo -s -H
    ovs-vsctl show
    ifconfig



  • ¦w¸Ëª`·N¨Æ¶µ
    DevStack¦b¦w¸Ë®É¡A¥²»Ý¨Ï¥Î¨ãsudoÅv­­ªº¤@¯ë±b¸¹¡A
    ­Yª½±µ¥HrootÅv­­¦w¸Ë·|µo¥Íĵ§i´£¥Ü¦Ó¤¤¤î¡C



    ¾ã­Ó¦w¸Ë¹Lµ{¡A½Ð¥H¤@¯ë±b¸¹¨Ó¶i¦æ¡A
    »ÝrootÅv­­®É¡A¦A³z¹Lsudo«ü¥O¨Ó´£¤ÉÅv­­¡A
    §_«h«Ü®e©ö¥X²{¸ê®Æ§¨Åv­­ªº°ÝÃD¦Ó¥¢±Ñ¡I



  • ³z¹Lgit«ü¥O¤U¸üDevStack¦w¸Ë¥]
    ¥H¨ãsudoÅv­­ªº¤@¯ë±b¸¹¨Ó¶i¦æ¾Þ§@(¶¶¤l«Ø¥ßªº±b¸¹¬Oshunze)¡C
    ­º¥ý¤U¸ügit®M¥ó¡AµM«á³z¹Lgit«ü¥O±qgithub¤W§âDevStackªº¦w¸Ë¥]¤U¸ü¤U¨Ó¡C
    sudo apt-get install git
    git clone https://github.com/openstack-dev/devstack.git

    ±µµÛ¤Á´«¨ìdevstack¥Ø¿ý¡A·Ç³Æ¶}©l¦w¸Ë¡C
    cd devstack


  • ³]©w¦w¸Ë°Ñ¼ÆÀÉlocal.conf
    ³z¹Ldevstack¥Ø¿ý¤Uªºscript stack.sh ¦w¸Ë«e¡A½Ð¥ý¶i¦æ«Ø¥ß°Ñ¼ÆÀÉ local.conf¡C
    ­Y¤£«Ø¥ß¦¹°Ñ¼ÆÀÉ¡A¹w³]ªº¦w¸Ë±¡¹Ò·|¤Ö¤Fºô¸ô¥\¯à¡C



    ¤Ö¤Fºô¸ô¥\¯à¥i¬OµLªkÅéÅçOpenStack public/privateªººô¸ôÃö«Y³á¡I
    vim local.conf

    [[local|localrc]]
    # Credentials
    DATABASE_PASSWORD=password
    ADMIN_PASSWORD=password
    SERVICE_PASSWORD=password
    SERVICE_TOKEN=password
    RABBIT_PASSWORD=password

    # swift
    enable_service s-proxy s-object s-container s-account

    # Neutron
    enable_service n-net
    enable_service q-svc
    enable_service q-agt
    enable_service q-dhcp
    enable_service q-l3
    enable_service q-meta
    enable_service q-metering

    # Ceilometer
    # Enable the ceilometer metering services
    enable_service ceilometer-acompute ceilometer-acentral ceilometer-anotification ceilometer-collector

    # Enable the ceilometer alarming services
    enable_service ceilometer-alarm-evaluator ceilometer-alarm-notifier

    # Enable the ceilometer api services
    enable_service ceilometer-api


  • ¶}©l¦w¸Ëopenstack
    °Ñ¼ÆÀɫإ߫á¡A³z¹Ldevstack¥Ø¿ý¤Uªº stack.sh script¶}©l¦w¸Ë¡C
    ./stack.sh

    ¦w¸Ë®É¡A·|°ÝRANDOM SWIFT HASHªº±K½X¡A«öEnterÅý¥¦°Ñ¥Í¤@­Ó¶Ã¼Æ±K½X§Y¥i¡C



    ¥H¶¶¤lªº¹q¸£®Ä¯à³Æ°t¡A¦w¸Ë¨ì¦n®t¤£¦h¥b¤p®É¡A
    ¥i¥H¥ý¥h°µ¨ä¥¦¨Æ¡A¥b¤p®É«á¦A¨Ó¬Ý¦w¸Ë¶i«×¡C

    ¦w¸Ë§¹¦¨«á·|¥X²{¥H¤U°T®§¡A§iª¾Àô¹Ò³]©w¬ÛÃö¸ê°T¡A
    ±µµÛ´N¥i¥H³z¹LÂsÄý¾¹¨Óµn¤JOpenstack¤F¡ã



  • µn¤JOpenStack½Õ®Õ¨t²ÎÀô¹Ò
    ¹w³]ªºµn¤J±b¸¹¤@¼Ë¤º«Ø¤Fadmin»Pdemo¨â­Ó±b¸¹¡A
    ±b¸¹ªº±K½X´N¬O°Ñ¼ÆÀÉlocal.conf¤¤ªº ADMIN_PASSWORD °Ñ¼Æ­È¡C

    ¥Hadmin±b¸¹³z¹LÂsÄý¾¹¨Óµn¤JOpenStack«á¡A´N¥i¥H¶}©l½Õ¾ã³]©w¡C



    ¤¶­±¸òCentOS³z¹LRDO¦w¸Ë¥]©Ò¸Ë¦nªºOpenStack¦³¤@¨Ç¤£¦P¡A¦ý¸Ó¦³ªº¡A°ò¥»¤W³£ÁÙ¬O¦³¡C

    ¹w³]ªºpublicºô¬q¬O172.24.4.0/24¡Aprivateºô¬q¬O10.0.0/24¡A
    ¥i¥H°Ñ¦Ò¶¶¤lOpenStackªº¨ä¥¦¤å³¹¨Ó­×§ïºô¬q»P«Ø¥ßinstance¡C

    ¡m¤T¡n­×§ïpublic¹ï¥~ºô¬q
    ¡m¥|¡n«Ø¥ßInstanceªº«e¸m§@·~
    ¡m¤­¡n«Ø¥ß²Ä¤@­ÓInstance

    ¦b½Õ¾ã¦npublicºô¬q¡Brouter»P¦w¥þ©Ê°t¸m¡A¨ÃÁpµ²¦n¯B°ÊIP«á¡A
    Instance¤£¶È¥i¥H³s¥~¡A¤]¥i¥H³z¹Lpublic¶i¦æºÞ²z¡A
    ¸ò³z¹LRDO©Ò«ØªºOpenStack¬O§¹¥þ¤@¼Ëªº¡ã


¥Ñ©ó­«¶}¾÷«á¡AOpenStack´N¤äÂ÷¯}¸H¤F¡I
©Ò¥H¶¶¤l¤]¨S¥´ºâªá¤Ó¦h¤ß«ä¦b³o...
Ubuntu³z¹LDevStack¦w¸Ë¥]¦w¸ËOpenStackªº¤¶²Ð´N¨ì¦¹§i¤@¬q¸¨¡ã



♥¶¶¤l¦Ñ±Cªººô©ç¡A½Ð¦hÃö·Ó¡ã

If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!




2016-05-11, 16:12 shunze ªº­Ó¤H¸ê®Æ §â shunze ¥[¤J¦n¤Í¦Cªí µo°eEmailµ¹ shunze ÂsÄý shunze ªººô¯¸ MSN : shunze@gmail.com
  « ¤W¤@½g¥DÃD
µoªí·s¥DÃD µoªí¦^ÂÐ
¸õ¨ì:

Powered by: Burning Board 1.1.1 2001 WoltLab GbR