从ansible安装greenplum中学到的

有兴趣看了一篇文章,如果用ansible安装greenplum,而且看到了官方的ansible脚本,又看到新奇的东西(对我而言)。

国内一博客,自己制作的安装脚本 基于Ansible的分布式MPP数据库Greenplum一键部署安装包的设计实现_IT- 研究者-CSDN博客

该博主的博客 IT- 研究者_inrgihc_CSDN博客-JAVA,Linux,C Plus Plus领域博主

该博主的github tangyibo (Yibo) (github.com)

该博主的码云 inrgihc (inrgihc) - Gitee.com

Pivotal-gpdb 官方的安装脚本 Example Ansible Playbook | Tanzu Greenplum Docs (pivotal.io)

习得:打开NTP和做时间同步

    - name: 05. be sure ntp is installed
      yum: name=ntp state=installed
      tags: ntp
    - name: 06. configure sync time using aliyun server
      when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
      cron: name="sync time" minute='*/5' hour=* day=* month=* weekday=* job="/usr/sbin/ntpdate -u ntp1.aliyun.com >/dev/null 2>&1"

习得:ansible对/etc/hosts文件的操作方法

   - name: 07. update configure file for etc-hosts
      copy: src=gpnodes/hosts dest=/etc/hosts
    - name: 08. change host name to etc-hostname
      raw: 'echo {{hostname|quote}} > /etc/hostname'
    - name: 09. change host name by command hostname
      shell: hostname {{hostname|quote}}

————————————————
版权声明:本文为CSDN博主「inrgihc」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/inrgihc/article/details/105824388

习得:根据内存等信息去修改systemctl的默认参数

    - name: 13. get shmall 
      shell: echo $(expr $(getconf _PHYS_PAGES) / 2) 
      register: shmall
    - name: 14. get shmmax
      shell: echo $(expr $(getconf _PHYS_PAGES) / 2 \* $(getconf PAGE_SIZE))
      register: shmmax
    - name: 15. get min_free_kbytes
      shell: awk 'BEGIN {OFMT = "%.0f";} /MemTotal/ {print $2 * .03;}' /proc/meminfo
      register: min_free_kbytes
    - name: 16. set shmall
      sysctl:
        name: kernel.shmall
        value: '{{ shmall.stdout }}'
        reload: yes

习得:查找软件的安装目录并递归重新赋值用户权限

    - name: 23. find install directory
      find:
        paths: '{{ greenplum_install_directory }}'
        patterns: 'greenplum-db*'
        file_type: directory
      register: installed_dir
    - name: 24. change install directory ownership
      file:
        path: '{{ item.path }}'
        owner: '{{ greenplum_admin_user }}'
        group: '{{ greenplum_admin_user }}'
        recurse: yes
      with_items: '{{ installed_dir.files }}'
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值