diff --git a/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md b/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md deleted file mode 100644 index 680032a215e7f1b9b1590ab6c5773d9bd1ce04da..0000000000000000000000000000000000000000 --- a/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: MogDB & openGauss Server Exporter -summary: MogDB & openGauss Server Exporter -author: Guo Huan -date: 2021-06-02 ---- - -# MogDB & openGauss Server Exporter - -Prometheus exporter for openGauss server metrics. - -
- -## How to Get the Component - - - -
- -## Quick Start - -This package is available for Docker: - -``` -# Start an example database -docker run --net=host -it --rm -e GS_PASSWORD=mtkOP@128 enmotech/opengauss -# Connect to it -docker run --net=host -e DATA_SOURCE_NAME="postgresql://postgres:password@localhost:5432/postgres?sslmode=disable" mogdb/opengauss_exporter -``` - -
- -## Building and running - -### gitee - -The default make file behavior is to build the binary: - -``` -go get gitee.com/enmotech/opengauss_exporter -cd ${GOPATH-$HOME/go}/src/gitee.com/enmotech/opengauss_exporter -make build -export DATA_SOURCE_NAME="postgresql://login:password@hostname:port/dbname" -./bin/opengauss_exporter -``` - -To build the docker, run `make docker`. - -### Flags - -- `help` Show context-sensitive help (also try --help-long and --help-man). -- `web.listen-address` Address to listen on for web interface and telemetry. Default is `:9187`. -- `web.telemetry-path` Path under which to expose metrics. Default is `/metrics`. -- `disable-settings-metrics` Use the flag if you don't want to scrape `pg_settings`. -- `auto-discover-databases` Whether to discover the databases on a server dynamically. -- `config` Path to a YAML file containing queries to run. Check out [`og_exporter.yaml`](https://github.com/enmotech/opengauss_exporter/blob/master/og_exporter_default.yaml) for examples of the format. -- `--dry-run` Do not run - print the internal representation of the metric maps. Useful when debugging a custom queries file. -- `constantLabels` Labels to set in all metrics. A list of `label=value` pairs, separated by commas. -- `version` Show application version. -- `exclude-databases` A list of databases to remove when autoDiscoverDatabases is enabled. -- `log.level` Set logging level: one of `debug`, `info`, `warn`, `error`, `fatal` -- `log.format` Set the log output target and format. e.g. `logger:syslog?appname=bob&local=7` or `logger:stdout?json=true` Defaults to `logger:stderr`. - -### Environment Variables - -The following environment variables configure the exporter: - -- `DATA_SOURCE_NAME` `PG_EXPORTER_URL` the default legacy format. Accepts URI form and key=value form arguments. The URI may contain the username and password to connect with. -- `OG_EXPORTER_WEB_LISTEN_ADDRESS` Address to listen on for web interface and telemetry. Default is `:9187`. -- `OG_EXPORTER_WEB_TELEMETRY_PATH` Path under which to expose metrics. Default is `/metrics`. -- `OG_EXPORTER_DISABLE_SETTINGS_METRICS` Use the flag if you don't want to scrape `pg_settings`. Value can be `true` or `false`. Default is `false`. -- `OG_EXPORTER_AUTO_DISCOVER_DATABASES` Whether to discover the databases on a server dynamically. Value can be `true` or `false`. Default is `false`. -- `OG_EXPORTER_CONSTANT_LABELS` Labels to set in all metrics. A list of `label=value` pairs, separated by commas. -- `OG_EXPORTER_EXCLUDE_DATABASES` A comma-separated list of databases to remove when autoDiscoverDatabases is enabled. Default is empty string. - -Settings set by environment variables starting with `OG_` will be overwritten by the corresponding CLI flag if given. - -### Setting the openGauss server's data source name - -The openGauss server's [data source name](http://en.wikipedia.org/wiki/Data_source_name) must be set via the `DATA_SOURCE_NAME` environment variable. - -For running it locally on a default Debian/Ubuntu install, this will work (transpose to init script as appropriate): - -```bash -DATA_SOURCE_NAME="user=postgres host=/var/run/postgresql/ sslmode=disable" opengauss_exporter -``` - -Also, you can set a list of sources to scrape different instances from the one exporter setup. Just define a comma separated string. - -```bash -DATA_SOURCE_NAME="port=5432,port=6432" opengauss_exporter -``` - -See the [github.com/lib/pq](http://github.com/lib/pq) module for other ways to format the connection string. - -### Adding new metrics via a config file - -The --config command-line argument specifies a YAML file containing additional queries to run. Some examples are provided in [og_exporter.yaml](https://github.com/enmotech/opengauss_exporter/blob/master/og_exporter_default.yaml). - -### Automatically discover databases - -To scrape metrics from all databases on a database server, the database DSN's can be dynamically discovered via the `--auto-discover-databases` flag. When true, `SELECT datname FROM pg_database WHERE datallowconn = true AND datistemplate = false and datname != current_database()` is run for all configured DSN's. From the result a new set of DSN's is created for which the metrics are scraped. - -In addition, the option `--exclude-databases` adds the possibily to filter the result from the auto discovery to discard databases you do not need. - -### run test - -``` -make build -cd test;sh test.sh ../bin/opengauss_exporter -``` - -### openGauss - -### Monitor user - -```sql -CREATE USER dbuser_monitor with login monadmin PASSWORD 'Mon@1234'; -grant usage on schema dbe_perf to dbuser_monitor; -grant select on pg_stat_replication to dbuser_monitor; -``` - -### primary and standby - -``` -docker network create opengauss_network --subnet=172.11.0.0/24 -docker run --network opengauss_network --ip 172.11.0.101 \ - --privileged=true --name opengauss_primary -h opengauss_primary -p 1111:5432 -d \ - -e GS_PORT=5432 -e OG_SUBNET=172.11.0.0/24 -e GS_PASSWORD=Gauss@123 -e NODE_NAME=opengauss_primary \ - -e 'REPL_CONN_INFO=replconninfo1 = '\''localhost=172.11.0.101 localport=5434 localservice=5432 remotehost=172.11.0.102 remoteport=5434 remoteservice=5432'\''\n' enmotech/opengauss:1.1.0 -M primary -docker run --network opengauss_network --ip 172.11.0.102 \ - --privileged=true --name opengauss_standby1 -h opengauss_standby1 -p 1112:5432 -d \ - -e GS_PORT=5432 -e OG_SUBNET=172.11.0.0/24 -e GS_PASSWORD=Gauss@123 -e NODE_NAME=opengauss_standby1 \ - -e 'REPL_CONN_INFO=replconninfo1 = '\''localhost=172.11.0.102 localport=5434 localservice=5432 remotehost=172.11.0.101 remoteport=5434 remoteservice=5432'\''\n' enmotech/opengauss:1.1.0 -M standby -``` diff --git a/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/mogdb-monitor.md b/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/mogdb-monitor.md new file mode 100644 index 0000000000000000000000000000000000000000..b5ae7c9fa118df1b1b12a725fc28e81870a3fb00 --- /dev/null +++ b/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/mogdb-monitor.md @@ -0,0 +1,27 @@ +--- +title: mogdb-monitor +summary: mogdb-monitor +author: Guo Huan +date: 2022-04-14 +--- + +# mogdb-monitor + +mogdb-monitor is a MogDB database cluster monitoring and deployment tool, with the help of the current very popular open source monitoring system prometheus framework, combined with the opengauss_exporter developed by Enmo database team, you can achieve a full range of detection of MogDB database. + +The core monitoring component opengauss_exporter has the following features. + +- Support all versions of MogDB/openGauss database +- Support for monitoring database clusters +- Support primary and standby database judgment within a cluster +- Support for automatic database discovery +- Support for custom query +- Supports online loading of configuration files +- Support for configuring the number of concurrent threads +- Support data collection information caching + +In terms of grafana display, Enmo also provide a complete set of dashboard, both an instance-level dashboard showing detailed information of each instance and a display big screen showing summary information of all instances, which, combined with the alertmanager component, can trigger alerts that meet the rules to relevant personnel in the first place. + +
+ +Please refer to [mogdb-monitor repository page](https://gitee.com/enmotech/mogdb-monitor) for details on how to obtain and use component. diff --git a/product/en/docs-mogdb/v2.1/security-guide/security/4-setting-encrypted-equality-query.md b/product/en/docs-mogdb/v2.1/security-guide/security/4-setting-encrypted-equality-query.md index dff878e0fedd537bfd860d59a66e27c59c375d76..614108c4d47dc78eb6096687a6cfefbcae1129b3 100644 --- a/product/en/docs-mogdb/v2.1/security-guide/security/4-setting-encrypted-equality-query.md +++ b/product/en/docs-mogdb/v2.1/security-guide/security/4-setting-encrypted-equality-query.md @@ -15,7 +15,7 @@ As enterprise data is migrated to the cloud, data security and privacy protectio 1. Log in as the OS user **omm** to the primary node of the database. -2. Run the following command to enable the encryption function and connect to the encrypted database: +2. When you use gsql to connect to database server, you need to use "-C" parameter or "--enable-client-encryption" to enable the encryption function. Run the following command to enable the encryption function and connect to the encrypted database: ```bash gsql -p PORT postgres -r -C @@ -301,7 +301,7 @@ The **gs_encrypted_proc** system catalog is added to the function or stored proc ------------------ Avi (1 row) - + mogdb=# SELECT f_encrypt_in_plpgsql('Avi', val2=>'1234567890123456'); f_encrypt_in_plpgsql ---------------------- diff --git a/product/en/docs-mogdb/v2.1/toc.md b/product/en/docs-mogdb/v2.1/toc.md index 27f444041a5f736a32fd8cfd3c48cbeca37f4bcf..ac08c7a91e3f0c548125f61270b1c708f8161385 100644 --- a/product/en/docs-mogdb/v2.1/toc.md +++ b/product/en/docs-mogdb/v2.1/toc.md @@ -17,7 +17,7 @@ + Open Source Components + [Docker-based MogDB](/about-mogdb/open-source-components/2-docker-based-mogdb.md) + [compat-tools](/about-mogdb/open-source-components/compat-tools.md) - + [MogDB Exporter](/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md) + + [mogdb-monitor](/about-mogdb/open-source-components/mogdb-monitor.md) + [wal2json](/about-mogdb/open-source-components/5-wal2json-extention-for-mogdb&opengauss.md) + [mog_filedump](/about-mogdb/open-source-components/mog_filedump.md) + [mog_xlogdump](/about-mogdb/open-source-components/mog_xlogdump.md) diff --git a/product/en/docs-mogdb/v2.1/toc_about.md b/product/en/docs-mogdb/v2.1/toc_about.md index 34c9954d1f2c2c992ca57e107998b85b2d09fb78..dc25ebf292e0dc9c05c3b10b50bc4d40fdce8e95 100644 --- a/product/en/docs-mogdb/v2.1/toc_about.md +++ b/product/en/docs-mogdb/v2.1/toc_about.md @@ -16,7 +16,7 @@ + Open Source Components + [Docker-based MogDB](/about-mogdb/open-source-components/2-docker-based-mogdb.md) + [compat-tools](/about-mogdb/open-source-components/compat-tools.md) - + [MogDB Exporter](/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md) + + [mogdb-monitor](/about-mogdb/open-source-components/mogdb-monitor.md) + [wal2json](/about-mogdb/open-source-components/5-wal2json-extention-for-mogdb&opengauss.md) + [mog_filedump](/about-mogdb/open-source-components/mog_filedump.md) + [mog_xlogdump](/about-mogdb/open-source-components/mog_xlogdump.md) diff --git a/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md b/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md deleted file mode 100644 index ee7eea7afe70982690e7e90d1e29cf7c2daee018..0000000000000000000000000000000000000000 --- a/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: MogDB & openGauss Server Exporter -summary: MogDB & openGauss Server Exporter -author: Guo Huan -date: 2021-06-02 ---- - -# MogDB & openGauss Server Exporter - -本文介绍适用于MogDB和openGauss服务器指标的Prometheus exporter工具。 - -
- -## 组件获取 - - - -
- -## 快速开始 - -本软件包适用于Docker: - -``` -# 启动一个示例数据库 -docker run --net=host -it --rm -e GS_PASSWORD=mtkOP@128 enmotech/opengauss -# 连接该数据库 -docker run --net=host -e DATA_SOURCE_NAME="postgresql://postgres:password@localhost:5432/postgres?sslmode=disable" mogdb/opengauss_exporter -``` - -
- -## 构建及运行 - -### gitee - -make命令默认构建二进制文件: - -``` -$ go get gitee.com/enmotech/opengauss_exporter -$ cd ${GOPATH-$HOME/go}/src/gitee.com/enmotech/opengauss_exporter -$ make build -$ export DATA_SOURCE_NAME="postgresql://login:password@hostname:port/dbname" -$ ./bin/opengauss_exporter -``` - -要构建docker,请运行`make docker`。 - -### 标记 - -- `help` 显示上下文相关的帮助说明(也可以使用 --help-long 和 --help-man)。 -- `web.listen-address` web界面和遥测监听端口。默认为`:9187`。 -- `web.telemetry-path` 暴露指标的路径。默认为`/metrics`。 -- `disable-settings-metrics` 如果不想采集`pg_settings`,请使用此标记。 -- `auto-discover-databases` 是否动态发现服务器上的数据库。 -- `config` 包含要运行的查询的YAML文件的路径。访问[`og_exporter.yaml`](https://github.com/enmotech/opengauss_exporter/blob/master/og_exporter_default.yaml)可查看格式示例。 -- `--dry-run` 不运行-打印指标映射的内部表示。在调试自定义查询文件时很有用。 -- `constantLabels` 要在所有指标中设置的标签。以英文逗号分隔的`label=value`对的列表。 -- `version` 显示应用版本。 -- `exclude-databases` 启用autoDiscoverDatabases时要删除的数据库列表。 -- `log.level` 设置日志级别:`debug`、`info`、`warn`、`error`、`fatal` -- `log.format` 设置日志输出目标和格式。如`logger:syslog?appname=bob&local=7`或`logger:stdout?json=true`,默认为`logger:stderr`。 - -### 环境变量 - -以下环境变量用于配置exporter: - -- `DATA_SOURCE_NAME` `PG_EXPORTER_URL` 默认的遗留格式。接受URI形式和key=value格式的参数。URI可以包含要连接的用户名和密码。 -- `OG_EXPORTER_WEB_LISTEN_ADDRESS` web界面和遥测监听端口。默认为`:9187`。 -- `OG_EXPORTER_WEB_TELEMETRY_PATH` 暴露指标的路径。默认为`/metrics`。 -- `OG_EXPORTER_DISABLE_SETTINGS_METRICS` 如果不想采集`pg_settings`,请使用此标记。值可以为`true`或`false`。默认为`false`。 -- `OG_EXPORTER_AUTO_DISCOVER_DATABASES` 是否动态发现服务器上的数据库。值可以为`true`或`false`。默认为`false`。 -- `OG_EXPORTER_CONSTANT_LABELS` 要在所有指标中设置的标签。以英文逗号分隔的`label=value`对的列表。 -- `OG_EXPORTER_EXCLUDE_DATABASES` 启用autoDiscoverDatabases时要删除的数据库列表(以英文逗号分隔)。默认为空字符串。 - -如果指定CLI标记,则以`OG_`开头的环境变量设置项将被相应的CLI标记覆盖。 - -### 设置openGauss服务器的数据源名称 - -openGauss服务器的[数据源名称](http://en.wikipedia.org/wiki/Data_source_name)必须通过`DATA_SOURCE_NAME`环境变量来设置。 - -此设置便于在默认的Debian/Ubuntu操作系统中以本地方式运行exporter工具(需要时转换为初始化脚本): - -``` -DATA_SOURCE_NAME="user=postgres host=/var/run/postgresql/ sslmode=disable" opengauss_exporter -``` - -您也可以设置一个数据源列表,以便在一个exporter程序中采集不同的实例,只需定义一个以英文逗号分隔的字符串即可。 - -``` -DATA_SOURCE_NAME="port=5432,port=6432" opengauss_exporter -``` - -有关格式化连接字符串的其他方法,请参阅[github.com/lib/pq](http://github.com/lib/pq)模块。 - -### 通过配置文件添加新的指标 - ---config命令行参数指定包含要运行的其他查询的YAML文件。[og_exporter.yaml](https://github.com/enmotech/opengauss_exporter/blob/master/og_exporter_default.yaml)中提供了一些示例。 - -### 自动发现数据库 - -为了采集数据库服务器上所有数据库的指标,可以通过`--auto-discover-databases`标记动态发现数据库DSN。当此标记设置为true时,工具将为所有已配置的DSN运行`SELECT datname FROM pg_database WHERE datallowconn = true AND datistemplate = false and datname != current_database()`。运行结果将创建一组新的DSN,以便采集指标。 - -此外,选项`--exclude-databases`可对自动发现的结果进行过滤,以丢弃不需要的数据库。 - -### 运行测试 - -``` -make build -cd test;sh test.sh ../bin/opengauss_exporter -``` - -### openGauss - -### 监控用户 - -``` -CREATE USER dbuser_monitor with login monadmin PASSWORD 'Mon@1234'; -grant usage on schema dbe_perf to dbuser_monitor; -grant select on pg_stat_replication to dbuser_monitor; -``` - -### 主备节点 - -``` -docker network create opengauss_network --subnet=172.11.0.0/24 -docker run --network opengauss_network --ip 172.11.0.101 \ - --privileged=true --name opengauss_primary -h opengauss_primary -p 1111:5432 -d \ - -e GS_PORT=5432 -e OG_SUBNET=172.11.0.0/24 -e GS_PASSWORD=Gauss@123 -e NODE_NAME=opengauss_primary \ - -e 'REPL_CONN_INFO=replconninfo1 = '\''localhost=172.11.0.101 localport=5434 localservice=5432 remotehost=172.11.0.102 remoteport=5434 remoteservice=5432'\''\n' enmotech/opengauss:1.1.0 -M primary -docker run --network opengauss_network --ip 172.11.0.102 \ - --privileged=true --name opengauss_standby1 -h opengauss_standby1 -p 1112:5432 -d \ - -e GS_PORT=5432 -e OG_SUBNET=172.11.0.0/24 -e GS_PASSWORD=Gauss@123 -e NODE_NAME=opengauss_standby1 \ - -e 'REPL_CONN_INFO=replconninfo1 = '\''localhost=172.11.0.102 localport=5434 localservice=5432 remotehost=172.11.0.101 remoteport=5434 remoteservice=5432'\''\n' enmotech/opengauss:1.1.0 -M standby -``` diff --git a/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/mogdb-monitor.md b/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/mogdb-monitor.md new file mode 100644 index 0000000000000000000000000000000000000000..f701b542efbffa8468b622f81ca5615e37ca47e1 --- /dev/null +++ b/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/mogdb-monitor.md @@ -0,0 +1,27 @@ +--- +title: mogdb-monitor +summary: mogdb-monitor +author: Guo Huan +date: 2022-04-14 +--- + +# mogdb-monitor + +mogdb-monitor是MogDB数据库集群监控部署工具,借助当前非常流行的开源监控体系prometheus框架,结合由恩墨数据库团队开发的opengauss_exporter,可以实现对MogDB数据库进行全方位的检测。 + +核心监控组件opengauss_exporter具有以下特点: + +- 支持所有版本MogDB/openGauss数据库 +- 支持监控数据库集群 +- 支持集群内主备角色判断 +- 支持自动发现数据库 +- 支持自定义查询query +- 支持在线加载配置文件 +- 支持配置线程并发数 +- 支持数据采集信息缓存 + +在grafana展示方面,云和恩墨也提供了一套完整的dashboard,既有展示每个实例详细信息的实例级dashboard,也有展示所有实例汇总信息的展示大屏,结合alertmanager组件,可以第一时间将符合规则的报警触发到相关人员。 + +
+ +组件获取及使用方法详见[mogdb-monitor仓库页面](https://gitee.com/enmotech/mogdb-monitor)。 \ No newline at end of file diff --git a/product/zh/docs-mogdb/v2.1/security-guide/security/4-setting-encrypted-equality-query.md b/product/zh/docs-mogdb/v2.1/security-guide/security/4-setting-encrypted-equality-query.md index f6f7f1a85297527c97cea8c5bac790b8a247ec46..19df6f9d125ede37c86af31e0b09292e0cdf0dbf 100644 --- a/product/zh/docs-mogdb/v2.1/security-guide/security/4-setting-encrypted-equality-query.md +++ b/product/zh/docs-mogdb/v2.1/security-guide/security/4-setting-encrypted-equality-query.md @@ -17,7 +17,7 @@ date: 2021-10-11 1. 以操作系统用户omm登录CN所在主机。 -2. 执行以下命令打开密态开关,连接密态数据库。 +2. 使用gsql连接数据库服务器时,需使用“-C”参数或“--enable-client-encryption”,打开全密态数据库的开关。执行以下命令连接密态数据库。 ```bash gsql -p PORT postgres -r -C @@ -304,7 +304,7 @@ pstmt.close(); ------------------ Avi (1 row) - + mogdb=# SELECT f_encrypt_in_plpgsql('Avi', val2=>'1234567890123456'); f_encrypt_in_plpgsql ---------------------- diff --git a/product/zh/docs-mogdb/v2.1/toc.md b/product/zh/docs-mogdb/v2.1/toc.md index 1684701fb2d7219be3e3f6f942ba55bacb92e201..d5009fe8440b032e6bd61b4d30ded8f9f8b988ba 100644 --- a/product/zh/docs-mogdb/v2.1/toc.md +++ b/product/zh/docs-mogdb/v2.1/toc.md @@ -17,7 +17,7 @@ + 开源组件 + [容器版本的MogDB](/about-mogdb/open-source-components/2-docker-based-mogdb.md) + [compat-tools](/about-mogdb/open-source-components/compat-tools.md) - + [MogDB Exporter](/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md) + + [mogdb-monitor](/about-mogdb/open-source-components/mogdb-monitor.md) + [wal2json](/about-mogdb/open-source-components/5-wal2json-extention-for-mogdb&opengauss.md) + [mog_filedump](/about-mogdb/open-source-components/mog_filedump.md) + [mog_xlogdump](/about-mogdb/open-source-components/mog_xlogdump.md) diff --git a/product/zh/docs-mogdb/v2.1/toc_about.md b/product/zh/docs-mogdb/v2.1/toc_about.md index ce96fa1bc29295f1e0da233e31138b91fa03fc78..7e8449f64f3d83fb295dd4598aaca6771f1c9438 100644 --- a/product/zh/docs-mogdb/v2.1/toc_about.md +++ b/product/zh/docs-mogdb/v2.1/toc_about.md @@ -16,7 +16,7 @@ + 开源组件 + [容器版本的MogDB](/about-mogdb/open-source-components/2-docker-based-mogdb.md) + [compat-tools](/about-mogdb/open-source-components/compat-tools.md) - + [MogDB Exporter](/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md) + + [mogdb-monitor](/about-mogdb/open-source-components/mogdb-monitor.md) + [wal2json](/about-mogdb/open-source-components/5-wal2json-extention-for-mogdb&opengauss.md) + [mog_filedump](/about-mogdb/open-source-components/mog_filedump.md) + [mog_xlogdump](/about-mogdb/open-source-components/mog_xlogdump.md)