美文网首页云计算程序员阿里云
devstack多节点靠谱安装

devstack多节点靠谱安装

作者: simon_2017 | 来源:发表于2018-01-05 17:04 被阅读1017次

    devstack默认安装过程要访问国外网站,安装软件,clone代码等,由于网络原因,经常失败。

    经笔者总结,通过一下设置,基本半个过小时 就可安装控制节点
    15分钟左右可安装计算节点。

    在每个节点上执行一下操作
    (笔者用的是Ubuntu16.04,openstack是stable/pike)

    wget http://www.alidns.com/static/soft/SetAliDNS.sh -O SetAliDNS.sh && chmod +x SetAliDNS.sh && sudo ./SetAliDNS.sh
    

    虽然ali大名鼎鼎,但毕竟也受到审查,有事也莫名其妙解析不到某些网站,故建议添加8.8.8.8

    root@compute1:~# vim /etc/resolvconf/resolv.conf.d/head
    options attempts=2 timeout=2 rotate
    nameserver 8.8.8.8
    nameserver 223.5.5.5
    nameserver 223.6.6.6
    

    然后重启生效

    • 修改apt源
    root@compute2:~# apt edit-sources
    deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
    
    • 添加pip.conf
    root@compute2:~# vim /etc/pip.conf
    [global]
    no-binary = libvirt-python
    index-url = http://mirrors.aliyun.com/pypi/simple/
    extra-index-url = https://pypi.douban.com/simple
    timeout = 60
    
    [install]
    trusted-host=http://mirrors.aliyun.com
    #ignore-installed = true
    #no-dependencies = yes
    #upgrade-strategy = only-if-needed
    #no-compile = yes
    #retries = 10
    #disable-pip-version-check = yes
    
    • 更新重启
    root@compute2:~# apt update && apt -y upgrade && reboot
    
    • 准备devstack安装
      clone devstack代码
    git clone http://git.trystack.cn/openstack-dev/devstack -b stable/pike
    

    创建stack用户

    devstack/tools/create-stack-user.sh
    

    移动代码(同后续安装目标目录放在一起)

    mv devstack /opt/stack
    chown -R stack:stack /opt/stack/devstack
    

    切换到 stack 用户

    su - stack
    cd devstack
    

    编辑local.conf,接下来每个节点的local.conf不一样

    stack@compute2:~/devstack$ vim local.conf
    

    控制节点

    [[local|localrc]]
    #---------------common section even some node role may not use this setting
    # use TryStack git mirror
    GIT_BASE=http://git.trystack.cn
    NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
    SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git
    #LIBVIRT_TYPE=kvm
    
    DEST=/opt/stack
    LOGFILE=$DEST/logs/stack.sh.log
    VERBOSE=True
    LOGDAYS=1
    LOG_COLOR=True
    RECLONE=false
    PIP_UPGRADE=Flase
    DOWNLOAD_DEFAULT_IMAGES=False
    IMAGE_URLS="http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img"
    IP_VERSION=4
    SERVICE_IP_VERSION=4
    ENABLE_IDENTITY_V2=False
    
    DATABASE_TYPE=mysql
    
    SERVICE_HOST=192.168.254.2
    MYSQL_HOST=$SERVICE_HOST
    RABBIT_HOST=$SERVICE_HOST
    GLANCE_HOSTPORT=$SERVICE_HOST:9292
    ADMIN_PASSWORD=admin
    MYSQL_PASSWORD=admin
    RABBIT_PASSWORD=admin
    SERVICE_PASSWORD=admin
    
    # Neutron options
    NEUTRON_CREATE_INITIAL_NETWORKS=False
    
    MULTI_HOST=1
    
    #---------------node special section
    HOST_IP=192.168.254.2
    FLAT_INTERFACE=enp4s0f0
    #RECLONE=True
    enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas stable/pike
    enable_plugin octavia https://git.openstack.org/openstack/octavia stable/pike
    enable_plugin neutron-lbaas-dashboard https://git.openstack.org/openstack/neutron-lbaas-dashboard stable/pike
    #enable_plugin neutron-lbaas http://git.trystack.cn/openstack/neutron-lbaas stable/pike
    #enable_plugin octavia http://git.trystack.cn/openstack/octavia stable/pike
    #enable_plugin neutron-lbaas-dashboard http://git.trystack.cn/openstack/neutron-lbaas-dashboard stable/pike
    
    #disable_service n-cpu q-agt n-api-meta c-vol n-net
    disable_service n-cpu c-vol
    enable_service q-fwaas,q-vpn
    enable_service q-lbaasv2,octavia,o-cw,o-hk,o-hm,o-api
    

    计算节点

    [[local|localrc]]
    #---------------common section even some node role may not use this setting
    # use TryStack git mirror
    GIT_BASE=http://git.trystack.cn
    NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
    SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git
    #LIBVIRT_TYPE=kvm
    
    DEST=/opt/stack
    LOGFILE=$DEST/logs/stack.sh.log
    VERBOSE=True
    LOGDAYS=1
    LOG_COLOR=True
    RECLONE=false
    PIP_UPGRADE=Flase
    DOWNLOAD_DEFAULT_IMAGES=False
    IMAGE_URLS="http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img"
    IP_VERSION=4
    SERVICE_IP_VERSION=4
    ENABLE_IDENTITY_V2=False
    
    DATABASE_TYPE=mysql
    
    SERVICE_HOST=192.168.254.2
    MYSQL_HOST=$SERVICE_HOST
    RABBIT_HOST=$SERVICE_HOST
    GLANCE_HOSTPORT=$SERVICE_HOST:9292
    ADMIN_PASSWORD=admin
    MYSQL_PASSWORD=admin
    RABBIT_PASSWORD=admin
    SERVICE_PASSWORD=admin
    
    # Neutron options
    NEUTRON_CREATE_INITIAL_NETWORKS=False
    
    MULTI_HOST=1
    
    #---------------compute node common section
    ENABLED_SERVICES=n-cpu,q-agt,n-api-meta,placement-client,n-novnc
    
    NOVA_VNC_ENABLED=True
    NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html"
    
    #---------------compute node special section
    HOST_IP=192.168.254.11
    FLAT_INTERFACE=enp0s25
    VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP
    VNCSERVER_LISTEN=$HOST_IP
    #ENABLED_SERVICES+=,c-vol
    

    编写好local.conf后,执行安装,先安装控制节点,再安装计算节点。

    stack@compute2:~/devstack$ ./stack.sh 
    

    安装结束显示
    控制节点

    =========================
    Total runtime    2234
    
    run_process       13
    test_with_retry    2
    apt-get-update    16
    pip_install       76
    osc              111
    wait_for_service   9
    git_timed         42
    dbsync           427
    apt-get            5
    =========================
    
    
    
    This is your host IP address: 192.168.254.2
    This is your host IPv6 address: ::1
    Horizon is now available at http://192.168.254.2/dashboard
    Keystone is serving at http://192.168.254.2/identity/
    The default users are: admin and demo
    The password: admin
    
    WARNING: 
    Using lib/neutron-legacy is deprecated, and it will be removed in the future
    
    
    Services are running under systemd unit files.
    For more information see: 
    https://docs.openstack.org/devstack/latest/systemd.html
    
    DevStack Version: pike
    Change: 4a85d5d6e040b08e085f9f5752de90a2346df6d1 Move remove_uwsgi_config to cleanup_placement 2017-12-06 11:31:12 +0000
    OS Version: Ubuntu 16.04 xenial
    

    计算节点

    =========================
    DevStack Component Timing
    =========================
    Total runtime    1007
    
    run_process        4
    apt-get-update     8
    pip_install      200
    osc                0
    wait_for_service   5
    git_timed        552
    apt-get          163
    =========================
    
    
    
    This is your host IP address: 192.168.254.11
    This is your host IPv6 address: ::1
    
    WARNING: 
    Using lib/neutron-legacy is deprecated, and it will be removed in the future
    
    
    Services are running under systemd unit files.
    For more information see: 
    https://docs.openstack.org/devstack/latest/systemd.html
    
    DevStack Version: pike
    Change: 4a85d5d6e040b08e085f9f5752de90a2346df6d1 Move remove_uwsgi_config to cleanup_placement 2017-12-06 11:31:12 +0000
    OS Version: Ubuntu 16.04 xenial
    

    最后,要让计算节点注册,在控制节点上运行

    root@controller1:~# /opt/stack/devstack/tools/discover_hosts.sh
    

    登录horizon,查看服务


    image.png
    image.png
    image.png
    image.png

    都正常启动了,暂时看来一切都很美好。。。

    相关文章

      网友评论

        本文标题:devstack多节点靠谱安装

        本文链接:https://www.haomeiwen.com/subject/aclsnxtx.html