代码拉取完成,页面将自动刷新
#!/usr/bin/env ansible-playbook
---
#==============================================================#
# File : node.yml
# Desc : init node for pigsty
# Ctime : 2020-05-12
# Mtime : 2023-02-20
# Path : node.yml
# Author : Ruohang Feng ([email protected])
# License : AGPLv3
#==============================================================#
- name: NODE
hosts: all
become: yes
gather_facts: no
roles:
- { role: node_id , tags: id } # get node identity (always)
- { role: node , tags: node } # prepare node for pigsty
- { role: haproxy , tags: haproxy } # init haproxy optional
- { role: node_monitor , tags: monitor } # init node monitor
#---------------------------------------------------------------
# Usage
#---------------------------------------------------------------
# 1. make sure you have nopass ssh & sudo access to target node
# 2. make sure you have defined these nodes in your inventory
# 3. run ./node.yml -l <selector> to finish node provisioning
#
# Add node to pigsty:
# node.yml -l <cls> # add groups
# node.yml -l <ip> # add single node
#
# Bootstrap with another admin user: (Create admin with another admin)
# node.yml -t node_admin # create admin user for nodes
# node.yml -t node_admin -k -K -e ansible_user=<another admin>
#
#--------------------------------------------------------------#
# Utils
#--------------------------------------------------------------#
#
# bin/node-add pg-meta # init nodes of group `pg-meta`
# bin/node-add pg-meta pg-test # init multiple node groups
# bin/node-add 10.10.10.10 # init node with ip `10.10.10.10`
# bin/node-add 10.10.10.1* # init node with pattern `10.10.10.1*`
# bin/node-add 1.2.3.4 5.6.7.8 # init multiple nodes
#
#---------------------------------------------------------------
# Identity
#---------------------------------------------------------------
# nodename : optional, used as node identity, default to existing name
# node_cluster : optional, used as node identity, default to `nodes`
#
# cls: node_cluster (explicit) > pg_cluster (when node_id_from_pg) > 'nodes'
# ins: nodename (explicit) > pg_instance (when node_id_from_pg) > node.hostname
#
# you can overwrite node identity with pgsql identity on 1:1 deployment
# with option `node_id_from_pg: true`
#
# 1. node identity can be specified by nodename or node_cluster explicitly (override all)
# 2. if node identity is not specified and node_id_from_pg is set, it will use pg's instance identity if applicable
# 3. otherwise, node_cluster will fall back to `nodes` and nodename will fall back to node's current hostname
#---------------------------------------------------------------
# Tasks
#---------------------------------------------------------------
# node-id : generate node identity
# node_name : setup hostname
# node_hosts : setup /etc/hosts records
# node_resolv : setup dns resolver
# node_firewall : setup firewall & selinux
# node_ca : add & trust ca certificate
# node_repo : add upstream repo
# node_pkg : install yum packages
# node_feature : setup numa, grub, static network
# node_kernel : enable kernel modules
# node_tune : setup tuned profile
# node_sysctl : setup additional sysctl parameters
# node_profile : write /etc/profile.d/node.sh
# node_ulimit : setup resource limits
# node_data : setup main data dir
# node_admin : setup admin user and ssh key
# node_timezone : setup timezone
# node_ntp : setup ntp server/clients
# node_crontab : add/overwrite crontab tasks
# node_vip : setup optional l2 vrrp vip for node cluster
# - vip_install
# - vip_config
# - vip_launch
# - vip_reload
# haproxy : setup haproxy on node to expose services
# - haproxy_install
# - haproxy_config
# - haproxy_launch
# - haproxy_reload
# monitor : setup node_exporter & promtail for metrics & logs
# - haproxy_register
# - vip_dns
# - node_exporter
# - node_exporter_config
# - node_exporter_launch
# - vip_exporter
# - vip_exporter_config
# - vip_exporter_launch
# - node_register
# - promtail
# - promtail_install
# - promtail_clean
# - promtail_config
# - promtail_launch
#---------------------------------------------------------------
...
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。