美文网首页
Kolla-Ansible部署Q版OpenStack

Kolla-Ansible部署Q版OpenStack

作者: 孙广宁 | 来源:发表于2018-07-02 21:22 被阅读0次

    当前为all-in-one测试步骤

    准备条件

    • 部署机 centos 1511

    步骤

    • centos源配置
    vim /etc/yum.repo.d/CentOS-Base.repo
    
    # CentOS-Base.repo
    #
    # The mirror system uses the connecting IP address of the client and the
    # update status of each mirror to pick mirrors that are updated to and
    # geographically close to the client.  You should use this for CentOS updates
    # unless you are manually picking other mirrors.
    #
    # If the mirrorlist= does not work for you, as a fall back you can try the
    # remarked out baseurl= line instead.
    #
    #
    
    [base]
    name=CentOS-$releasever - Base
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    
    #released updates
    [updates]
    name=CentOS-$releasever - Updates
    # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus
    # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    
    • pip源配置
    vim ~/.pip/pip.conf
    [global]
    trusted-host=mirrors.aliyun.com
    index-url=http://mirrors.aliyun.com/pypi/simple/
    
    科大源
    [global]
    index-url = https://mirrors.ustc.edu.cn/pypi/web/simple
    format = columns
    
    • 安装基础软件
    yum install epel-release
    yum install python-pip
    pip install -U pip
    yum install git vim net-tools -y
    yum install python-devel libffi-devel gcc openssl-devel libselinux-python
    
    • 安装ansible
    yum install ansible
    pip install -U ansible
    
    • 配置ansible相关参数/etc/ansible/ansible.cfg(可选)
    [defaults]
    host_key_checking=False
    pipelining=True
    forks=100
    
    • 安装kolla-ansible
    pip install kolla-ansible
    
    • 将配置文件globa.yml、password.yml和主机文件all-in-one、multinode拷贝到/etc/kolla
    cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/
    cp /usr/share/kolla-ansible/ansible/inventory/* .
    
    • 开发代码下载
    git clone https://github.com/openstack/kolla
    git clone https://github.com/openstack/kolla-ansible
    
    • 安装依赖
    pip install -r kolla/requirements.txt
    pip install -r kolla-ansible/requirements.txt
    

    单机版AIO环境部署

    • 修改globals配置文件
    kolla_install_type: "source"
    openstack_release: "pike"
    openstack_release: "master"
    network_interface: "eth0"
    neutron_external_interface: "eth1"
    kolla_internal_vip_address: "10.1.0.250"
    
    • 部署前基础检查
    kolla-ansible -i ./multinode bootstrap-servers
    kolla-ansible -i ./multinode prechecks
    
    • 开始安装AIO环境
    kolla-ansible -i ./multinode deploy
    
    AIO环境需创建一个虚拟的块设备来支撑cinder服务,步骤如下
    • 在当前目录新建一个20G的新文件
    dd if=/dev/zero of=cinder_volumes bs=1M count=20K
    
    • 将该文件虚拟成一个loop块设备
    losetup loop2 cinder_volumes
    
    • 创建名称为cinder_volumes的vg
    pvcreate /dev/loop2
    vgcreate cinder_volumes /dev/loop2
    
    • 查看vg是否创建出来
    vgs
    

    多机版MultiNode环境部署


    规划多机环境拓扑
    • 3 控制节点
      • 4张网卡,两两绑定bond0和bond1
    • 2 计算节点
      • 2张网卡,绑定为bond0
    • 2 网络节点
      • 2张网卡,绑定为bond0
    • 1 存储节点
      • 2张网卡,绑定为bond0
    • 1 Monitoring节点
      • 2张网卡,绑定为bond0
    • 3 Ceph节点
      • 暂时和控制节点合用

    搭建部署节点
    • 安装操作系统
    • 配置ntp
    yum install ntp
    systemctl start ntpd
    systemctl enable ntpd
    
    • 配置防火墙
    systemctl stop firewalld
    setenforce 0
    
    • 配置yum源
    • 配置pypi源
    • 安装依赖
    • 安装cobbler
    构建所有服务器的cobbler system
    
    • 安装kolla、kolla-ansible
      • 修改multinode配置
    haproxy更改到control
    bifrost安装节点讨论
    
    • 构建registry docker仓库
    docker pull registry
    
    • 编辑inventory文件
    将所有主机的管理ip地址写入multinode(需要脚本化)
    
    • 编辑global.yml文件
    需要确定要enable的值以及其它参数配置
    
    • 安装ara
    按照ara安装手册选择安装
    
    • 快照

    虚拟机配置
    • 网卡模拟
    • 硬盘模拟
    • CPU模拟

    安装ARA

    • 安装基础软件
    yum install gcc python-devel libffi-devel openssl-devel redhat-rpm-config
    
    • For Development
    yum install python-setuptools libselinux-python libxml2-devel libxslt-devel
    easy_install pip
    pip install tox
    
    • 安装ARA
    pip install ara
    

    或者

    pip install git+https://git.openstack.org/openstack/ara
    
    • 配置ansible.cfg
    python -m ara.setup.ansible | tee ansible.cfg
    python -m ara.setup.env
    
    • 启动ARA
    ara-manage runserver -h 0.0.0.0 -p 8088
    

    相关文章

      网友评论

          本文标题:Kolla-Ansible部署Q版OpenStack

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