Giter Site home page Giter Site logo

ansible-for-opengauss's Introduction

Ansible role for openGauss

本项目基于 openGauss 的官方安装脚本,结合 Ansible 自动化编排流程,实现自动部署 openGauss。

使用者只需给目标机器编排好集群角色,即可通过一行命令,自适应部署单点、一主一备、一主多备以及级联节点等架构模式。

本项目适用于以下场景或用户:

  1. 同一网络环境下的快速部署以及扩容。
  2. 需要多次重新部署数据库集群的测试工程师。

已适配的系统

  • x86_64
    • CentOS 7.6/7.9
    • openEuler 20.03 LTS SP3

已适配的 openGauss 版本

  • 5.1.0
  • 5.0.0

不足之处

  1. 暂不支持 DCF 模式的集群部署。
  2. 暂不支持离线部署。
  3. 暂不支持多地容灾部署。
  4. 暂不提供部署后的数据库或数据库用户的创建流程。

优势特点

  1. 自带 Dockerfile,可通过 docker-compose 在本地启动一个 Ansible 容器,免除不同系统安装 Ansible 所带来的兼容性问题。

  2. 部署完成后自动生成部署报告,markdown 格式。

  3. 以 1 主 4 备 1 级联的架构为例,十分钟内部署完成(不含 openGauss 压缩包及 Linux 系统安装包的下载时间)。

  4. 支持从 1 主单节点,逐步扩展为多节点集群。

  5. 自动匹配 CPU 架构以及操作系统。

  6. 支持自定义 cluster_config.xml.j2 模板,优先使用 {{ inventory_dir }}/templates/openGauss/cluster_config.xml.j2

  7. 默认自动生成数据库管理员密码,也可自定义变量进行替换。全程自动化,无交互步骤。

  8. 部署完成后,从 /root/.ssh/authorized_keys 里移除相关公钥,而非删除 /root/.ssh 目录。

  9. 本地生成的公密钥、账号密码,均存放在 {{ inventory_dir }}/credentials 目录内。

  10. 支持自定义变量,自动与 defaults/main.yml 变量合并使用。例如

    默认变量

    opengauss_env:
      user_name: omm
      user_group: dbgrp
    

    自定义变量文件 {{ inventory_dir }}/group_vars/openGauss.yml

    opengauss_env:
      user_name: ommo
    

    合并后的可用变量

    combined_vars:
      opengauss_env:
        user_name: ommo
        user_group: dbgrp
    

使用指南

git clone --depth 1 https://gitee.com/opengauss/ansible-for-opengauss.git

cd ansible-for-opengauss

更新日志

  • 2023-11-10:优化流程,解决扩容难点,可直接从单节点扩容到多节点。

  • 2023-10-26: 大量修复和优化,可完美实现从单点部署,到扩容为 1 主 4 备 4 级联的架构。

    已测试的扩容场景如下
    
    1 主
      -> 1 主 1 备
        -> 1 主 1 备 1 级联
          -> 1 主 2 备 2 级联
            -> 1 主 4 备 4 级联
    
  • 2023-10-18: 支持 openEuler 20.03 LTS SP3。

  • 2023-10-13: 支持集群扩容。

待开发功能

  1. 提供 DCF 模式的部署。
  2. 基于 gs_guc 批量配置自动修改功能。

开发指南

(待补充)

问题反馈

请提交 issue,或电邮与我联系 [email protected]

ansible-for-opengauss's People

Contributors

bottlelee avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.