Ansible安装(ubuntu14.04环境)

一、安装环境

虚拟机1Ansible管理节点,操作系统ubuntu14.04IP192.168.1.101

 

二、安装

2.1、获取安装包的服务器进行替换

sudo sed  -i  -re  's/\w+\.archive\.ubuntu\.com/archive.ubuntu.com/g'  /etc/apt/sources.list

2.2、更新安装库

apt-get update

2.3、开始进行安装

sudo apt-get install software-properties-common

sudo apt-add-repository ppa:ansible/ansible

sudo apt-get update

sudo apt-get install ansible

 

2.4、至此,安装完成

F0B6F290CCCF4533A669F2A33519D127

 



本文转自 TtrToby 51CTO博客,原文链接:http://blog.51cto.com/freshair/1868218

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
安装OpenGauss的步骤如下: 1. 首先需要在Ubuntu安装Ansible。使用以下命令安装Ansible: ``` sudo apt update sudo apt install ansible ``` 2. 然后需要创建Ansible的inventory文件,用于指定需要安装OpenGauss的主机。inventory文件的格式如下: ``` [opengauss] opengauss-server ansible_host=server_ip_address ``` 其中,`opengauss-server`是主机名,`server_ip_address`是主机的IP地址。 3. 接下来需要编写Ansible playbook,用于安装OpenGauss。以下是一个简单的playbook示例: ``` --- - hosts: opengauss become: yes vars: opengauss_version: "2.0.0" opengauss_install_dir: "/usr/local/opengauss" opengauss_data_dir: "/var/lib/opengauss/data" opengauss_port: 5432 opengauss_charset: "UTF8" opengauss_init_password: "opengauss" tasks: - name: "Create OpenGauss installation directory" file: path: "{{ opengauss_install_dir }}" state: directory - name: "Install OpenGauss dependencies" apt: name: ["libreadline-dev", "zlib1g-dev", "libossp-uuid-dev", "libxml2-dev", "libxslt-dev"] state: present - name: "Download OpenGauss package" get_url: url: "https://opengauss.obs.cn-north-4.myhuaweicloud.com/2.0.0/opengauss-{{ opengauss_version }}-linux-x86_64.tar.gz" dest: "/tmp/opengauss-{{ opengauss_version }}-linux-x86_64.tar.gz" - name: "Extract OpenGauss package" unarchive: src: "/tmp/opengauss-{{ opengauss_version }}-linux-x86_64.tar.gz" dest: "{{ opengauss_install_dir }}" copy: no - name: "Create OpenGauss data directory" file: path: "{{ opengauss_data_dir }}" state: directory - name: "Initialize OpenGauss database" command: "{{ opengauss_install_dir }}/bin/gs_initdb -D {{ opengauss_data_dir }} -E {{ opengauss_charset }} --nodename=OpenGauss --locale=C --auth=trust --encoding={{ opengauss_charset }}" - name: "Start OpenGauss database" command: "{{ opengauss_install_dir }}/bin/gs_ctl start -D {{ opengauss_data_dir }} -o \"-p {{ opengauss_port }}\"" - name: "Change OpenGauss password" command: "{{ opengauss_install_dir }}/bin/gsql -d postgres -p {{ opengauss_port }} -c \"alter user postgres with password '{{ opengauss_init_password }}';\"" ``` 在playbook中,我们指定了OpenGauss的版本、安装路径、数据目录等信息。然后依次执行了创建安装目录、安装依赖、下载OpenGauss包、解压OpenGauss包、创建数据目录、初始化数据库、启动数据库和修改密码等任务。 4. 运行playbook,执行安装OpenGauss的操作。 ``` ansible-playbook -i inventory_file install_opengauss.yml ``` 以上是在Ubuntu上使用Ansible安装OpenGauss的简单步骤和示例。如果您有任何问题,请随时提出。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值