在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:pigsty开源软件地址:https://gitee.com/mirrors/pigsty开源软件介绍:PigstyBattery-Included Open-Source PostgreSQL Distribution
Pigsty can be used both for large-scale pg clusters management in real-world prod-env, and for launching versatile local pgsql sandbox for dev, test, demo & data analysis purpose. TL;DRGet a fresh Linux x86_64 CentOS 7.8 node. with nopass curl -SL https://github.com/Vonng/pigsty/releases/download/v1.4.0-rc/pigsty.tgz | gzip -d | tar -xC ~cd pigsty && ./configuremake install Check public demo for what you will get, check Get Started for more detail. Highlights
DistributionsDistribution refers to the overall solution consisting of a kernel and peripheral software packages. For example, Linux is an OS kernel, while RedHat, Debian, and SUSE are OS distributions based on Linux kernel. Pigsty is an entire solution for using postgres in your production environment. It will setup everything for your with one-click:creating & scaling clusters, switchover & auto failover. manage databases, users, roles, hbas, schemas, hbas with configuration, connection pooling, load balancing, monitoring & logging & alerting, service discovery, etc... MonitoringPostgreSQL is the most advanced open source relational database, but its ecosystem lacks a open source monitoring system which is good enough. Pigsty aims to solve this by delivering the best Open Source Monitoring Solution for PostgreSQL. Pigsty comes with a professional-grade PostgreSQL monitoring system which is specially designed for large-scale postgres cluster management. Including 1200+ metrics, 20+ Dashboards, thousands of panels which covering detailed information from the biggest overview to the smallest individual object. Which brings irreplaceable value for professional users. Pigsty consists of three monitor apps: Pigsty is build upon popular open source components such as Prometheus & Grafana. There's no vendor locking, and the infra can be easily reused for other purpose. ProvisioningPostgreSQL cluster comes before monitoring system. That's why pigsty is shipping with a handy Provisioning Solution.It allows you to create, update, scale, and manage your postgres cluster in kubernetes style: Describe what your want and pigsty will just do that for ya. For example, creating a one-leader-with-two-replica cluster pg-test: hosts: 10.10.10.11: {pg_seq: 1, pg_role: primary} 10.10.10.12: {pg_seq: 2, pg_role: replica} 10.10.10.13: {pg_seq: 3, pg_role: replica} vars: pg_cluster: pg-test vip_address: 10.10.10.3 Full Example of Cluster Customization#----------------------------------## cluster: pg-test (3-node) ##----------------------------------#pg-meta: # required, ansible group name , pgsql cluster name. should be unique among environment hosts: # `<cluster>.hosts` holds instances definition of this cluster 10.10.10.11: {pg_seq: 1, pg_role: primary} # primary instance, leader of cluster 10.10.10.12: {pg_seq: 2, pg_role: replica} # replica instance, follower of leader 10.10.10.13: {pg_seq: 3, pg_role: offline} # offline instance, replica that allow offline access #--------------- # mandatory # all configuration above (`ip`, `pg_seq`, `pg_role`) and `pg_cluster` are mandatory #--------------- vars: # `<cluster>.vars` holds CLUSTER LEVEL CONFIG of this pgsql cluster pg_cluster: pg-meta # required, pgsql cluster name, unique among cluster, used as namespace of cluster resources #--------------- # optional # all configuration below are OPTIONAL for a pgsql cluster (Overwrite global default) #--------------- pg_version: 13 # pgsql version to be installed (use global version if missing) node_tune: tiny # node optimization profile: {oltp|olap|crit|tiny}, use tiny for vm sandbox pg_conf: tiny.yml # pgsql template: {oltp|olap|crit|tiny}, use tiny for sandbox patroni_mode: pause # entering patroni pause mode after bootstrap {default|pause|remove} patroni_watchdog_mode: off # disable patroni watchdog on meta node {off|require|automatic} pg_lc_ctype: en_US.UTF8 # use en_US.UTF8 locale for i18n char support (required by `pg_trgm`) #--------------- # biz databases # Defining Business Databases (Optional) #--------------- pg_databases: # define business databases on this cluster, array of database definition # define the default `meta` database - name: meta # required, `name` is the only mandatory field of a database definition baseline: cmdb.sql # optional, database sql baseline path, (relative path among ansible search path, e.g files/) # owner: postgres # optional, database owner, postgres by default # template: template1 # optional, which template to use, template1 by default # encoding: UTF8 # optional, database encoding, UTF8 by default. (MUST same as template database) # locale: C # optional, database locale, C by default. (MUST same as template database) # lc_collate: C # optional, database collate, C by default. (MUST same as template database) # lc_ctype: C # optional, database ctype, C by default. (MUST same as template database) # tablespace: pg_default # optional, default tablespace, 'pg_default' by default. # allowconn: true # optional, allow connection, true by default. false will disable connect at all # revokeconn: false # optional, revoke public connection privilege. false by default. (leave connect with grant option to owner) # pgbouncer: true # optional, add this database to pgbouncer database list? true by default comment: pigsty meta database # optional, comment string for this database connlimit: -1 # optional, database connection limit, default -1 disable limit schemas: [pigsty] # optional, additional schemas to be created, array of schema names extensions: # optional, additional extensions to be installed: array of schema definition `{name,schema}` - {name: adminpack, schema: pg_catalog} # install adminpack to pg_catalog and install postgis to public - {name: postgis, schema: public} # if schema is omitted, extension will be installed according to search_path. # define an additional database named grafana & prometheus (optional) - { name: grafana, owner: dbuser_grafana , revokeconn: true , comment: grafana primary database } - { name: prometheus, owner: dbuser_prometheus , revokeconn: true , comment: prometheus primary database } #--------------- # biz users # Defining Business Users (Optional) #--------------- pg_users: # define business users/roles on this cluster, array of user definition # define admin user for meta database (This user are used for pigsty app deployment by default) - name: dbuser_meta # required, `name` is the only mandatory field of a user definition password: md5d3d10d8cad606308bdb180148bf663e1 # md5 salted password of 'DBUser.Meta' # optional, plain text and md5 password are both acceptable (prefixed with `md5`) login: true # optional, can login, true by default (new biz ROLE should be false) superuser: false # optional, is superuser? false by default createdb: false # optional, can create database? false by default createrole: false # optional, can create role? false by default inherit: true # optional, can this role use inherited privileges? true by default replication: false # optional, can this role do replication? false by default bypassrls: false # optional, can this role bypass row level security? false by default pgbouncer: true # optional, add this user to pgbouncer user-list? false by default (production user should be true explicitly) connlimit: -1 # optional, user connection limit, default -1 disable limit expire_in: 3650 # optional, now + n days when this role is expired (OVERWRITE expire_at) expire_at: '2030-12-31' # optional, YYYY-MM-DD 'timestamp' when this role is expired (OVERWRITTEN by expire_in) comment: pigsty admin user # optional, comment string for this user/role roles: [dbrole_admin] # optional, belonged roles. default roles are: dbrole_{admin,readonly,readwrite,offline} parameters: {} # optional, role level parameters with `ALTER ROLE SET` # search_path: public # key value config parameters according to postgresql documentation (e.g: use pigsty as default search_path) - {name: dbuser_view , password: DBUser.Viewer ,pgbouncer: true ,roles: [dbrole_readonly], comment: read-only viewer for meta database} # define additional business users for prometheus & grafana (optional) - {name: dbuser_grafana , password: DBUser.Grafana ,pgbouncer: true ,roles: [dbrole_admin], comment: admin user for grafana database } - {name: dbuser_prometheus , password: DBUser.Prometheus ,pgbouncer: true ,roles: [dbrole_admin], comment: admin user for prometheus database } Example of Redis Cluster/Sentinel/Standalone#----------------------------------## redis sentinel example ##----------------------------------#redis-sentinel: hosts: 10.10.10.10: redis_node: 1 redis_instances: { 6001 : {} ,6002 : {} , 6003 : {} } vars: redis_cluster: redis-sentinel redis_mode: sentinel redis_max_memory: 128MB#----------------------------------## redis cluster example ##----------------------------------#redis-cluster: hosts: 10.10.10.11: redis_node: 1 redis_instances: { 6501 : {} ,6502 : {} ,6503 : {} ,6504 : {} ,6505 : {} ,6506 : {} } 10.10.10.12: redis_node: 2 redis_instances: { 6501 : {} ,6502 : {} ,6503 : {} ,6504 : {} ,6505 : {} ,6506 : {} } vars: redis_cluster: redis-cluster # name of this redis 'cluster' redis_mode: cluster # standalone,cluster,sentinel redis_max_memory: 64MB # max memory used by each redis instance redis_mem_policy: allkeys-lru # memory eviction policy#----------------------------------## redis standalone example ##----------------------------------#redis-standalone: hosts: 10.10.10.13: redis_node: 1 redis_instances: 6501: {} 6502: { replica_of: '10.10.10.13 6501' } 6503: { replica_of: '10.10.10.13 6501' } vars: redis_cluster: redis-standalone # name of this redis 'cluster' redis_mode: standalone # standalone,cluster,sentinel redis_max_memory: 64MB # max memory used by each redis instance HA ClustersThe clusters created by Pigsty are distributive HA postgres database cluster powered by Patroni & HAProxy.As long as any instance in the cluster survives, the cluster serves. Each instance is idempotent from application's point of view. SandboxPigsty is designed for real world production env with hundreds of high spec nodes, but it can also run inside a tiny 1C|1GB vm node.Which is great for developing, testing, demonstrating, data analysing & visualizing and other purposes. Pigsty sandbox can be pulled up with one command on your Macbook, powered by virtualbox & vagrant.There are two specs of sandbox: 1 node (the default) and 4 node (full sandbox) Sandbox SpecificationSystem Requirement
Minimal Spec
Demo setup ( TINY mode, vagrant demo)
Production setup (OLTP/OLAP/CRIT mode)
AnalysisPigsty ships with handy tools such as Jupyterlab, PostgreSQL, Grafana, Echarts. Which is great for data analysis & visualization.You can turn pigsty sandbox into an IDE for making data-intensive applications and demos: Processing data with SQL & Python, Visualize with Grafana & Echarts. Pigsty comes with two example apps: Get StartedIf you are interested in Pigsty, check Getting-Started: Introduction for what's next. It takes 3 commands to pull up pigsty: download, configure, install Get a fresh Linux x86_64 CentOS 7.8 node. with nopass curl -SL https://github.com/Vonng/pigsty/releases/download/v1.4.0-rc/pigsty.tgz | gzip -d | tar -xC ~cd pigsty && ./configuremake install Check Quick Start for detail. If you don't have vm nodes, considering launch pigsty sandbox on your Macbook: make deps # Install MacOS deps with homebrewmake dns # Write static DNSmake start # Pull-up vm nodes and setup ssh access (start4 for 4-node demo)make demo # install pigsty on 'meta' as above (demo4 for 4-node demo) LicenseApache Apache License Version 2.0 About
Author: Vonng ([email protected]) License: Apache 2.0 License Copyright 2018-2022 [email protected](Vonng) Beian: 浙ICP备15016890-2号 |
请发表评论