From 14d3d1e0739a3b1aa77b3217f01fe89d4733f639 Mon Sep 17 00:00:00 2001 From: Bobby Bissett Date: Thu, 27 Jul 2023 11:37:19 -0400 Subject: [PATCH 01/17] Adding warning message about openjdk 11 issue on redhat Pushing this first and will correct formatting after I see the generated pages. --- product_docs/docs/efm/4/13_troubleshooting.mdx | 6 +++++- product_docs/docs/efm/4/installing/prerequisites.mdx | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/product_docs/docs/efm/4/13_troubleshooting.mdx b/product_docs/docs/efm/4/13_troubleshooting.mdx index 62749d37f2e..96c3d93de75 100644 --- a/product_docs/docs/efm/4/13_troubleshooting.mdx +++ b/product_docs/docs/efm/4/13_troubleshooting.mdx @@ -1,6 +1,6 @@ --- title: "Troubleshooting" -redirects: +redirects: - ../efm_user/13_troubleshooting legacyRedirectsGenerated: # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. @@ -47,3 +47,7 @@ openjdk version "1.8.0_191" OpenJDK Runtime Environment (build 1.8.0_191-b12) OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode) ``` +!!! Note: + There is a temporary issue with OpenJDK version 11 on RHEL and its derivatives. When starting Failover Manager, you may see an error like the following: + `java.lang.Error: java.io.FileNotFoundException: /usr/lib/jvm/java-11-openjdk-11.0.20.0.8-2.el8.x86_64/lib/tzdb.dat (No such file or directory)` + If so, the workaround is to manually install the missing package, e.g. `dnf install tzdata-java` diff --git a/product_docs/docs/efm/4/installing/prerequisites.mdx b/product_docs/docs/efm/4/installing/prerequisites.mdx index 24e2b64e048..7a55ea3e34a 100644 --- a/product_docs/docs/efm/4/installing/prerequisites.mdx +++ b/product_docs/docs/efm/4/installing/prerequisites.mdx @@ -1,6 +1,6 @@ --- title: "Prerequisites" -redirects: +redirects: - ../efm_user/02_failover_manager_overview/01_prerequisites - /efm/latest/01_prerequisites/ legacyRedirectsGenerated: @@ -17,6 +17,11 @@ Before configuring a Failover Manager cluster, you must satisfy the prerequisite Before using Failover Manager, you must first install Java (version 1.8 or later). Failover Manager is tested with OpenJDK, and we strongly recommend installing that version of Java. [Installation instructions for Java](https://openjdk.java.net/install/) are platform specific. +!!! Note: + There is a temporary issue with OpenJDK version 11 on RHEL and its derivatives. When starting Failover Manager, you may see an error like the following: + `java.lang.Error: java.io.FileNotFoundException: /usr/lib/jvm/java-11-openjdk-11.0.20.0.8-2.el8.x86_64/lib/tzdb.dat (No such file or directory)` + If so, the workaround is to manually install the missing package, e.g. `dnf install tzdata-java` + ## Provide an SMTP server You can receive notifications from Failover Manager as specified by a user-defined notification script, by email, or both. From e15922d3ed9e017567c407a541206797dbd3edaa Mon Sep 17 00:00:00 2001 From: Bobby Bissett Date: Thu, 27 Jul 2023 13:16:01 -0400 Subject: [PATCH 02/17] Trying to add newlines. --- product_docs/docs/efm/4/13_troubleshooting.mdx | 2 ++ product_docs/docs/efm/4/installing/prerequisites.mdx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/product_docs/docs/efm/4/13_troubleshooting.mdx b/product_docs/docs/efm/4/13_troubleshooting.mdx index 96c3d93de75..44da9ff6493 100644 --- a/product_docs/docs/efm/4/13_troubleshooting.mdx +++ b/product_docs/docs/efm/4/13_troubleshooting.mdx @@ -49,5 +49,7 @@ OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode) ``` !!! Note: There is a temporary issue with OpenJDK version 11 on RHEL and its derivatives. When starting Failover Manager, you may see an error like the following: + `java.lang.Error: java.io.FileNotFoundException: /usr/lib/jvm/java-11-openjdk-11.0.20.0.8-2.el8.x86_64/lib/tzdb.dat (No such file or directory)` + If so, the workaround is to manually install the missing package, e.g. `dnf install tzdata-java` diff --git a/product_docs/docs/efm/4/installing/prerequisites.mdx b/product_docs/docs/efm/4/installing/prerequisites.mdx index 7a55ea3e34a..83a7845f59c 100644 --- a/product_docs/docs/efm/4/installing/prerequisites.mdx +++ b/product_docs/docs/efm/4/installing/prerequisites.mdx @@ -19,7 +19,9 @@ Before using Failover Manager, you must first install Java (version 1.8 or later !!! Note: There is a temporary issue with OpenJDK version 11 on RHEL and its derivatives. When starting Failover Manager, you may see an error like the following: + `java.lang.Error: java.io.FileNotFoundException: /usr/lib/jvm/java-11-openjdk-11.0.20.0.8-2.el8.x86_64/lib/tzdb.dat (No such file or directory)` + If so, the workaround is to manually install the missing package, e.g. `dnf install tzdata-java` ## Provide an SMTP server From 40ed6bbd43906002918af9e86823368846a7e588 Mon Sep 17 00:00:00 2001 From: Bobby Bissett Date: Thu, 27 Jul 2023 13:54:07 -0400 Subject: [PATCH 03/17] Somehow "Note" was lost. Trying it like other examples in the doc but can't find one with multiple lines yet. --- product_docs/docs/efm/4/13_troubleshooting.mdx | 2 +- product_docs/docs/efm/4/installing/prerequisites.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/product_docs/docs/efm/4/13_troubleshooting.mdx b/product_docs/docs/efm/4/13_troubleshooting.mdx index 44da9ff6493..ff558cdb8bc 100644 --- a/product_docs/docs/efm/4/13_troubleshooting.mdx +++ b/product_docs/docs/efm/4/13_troubleshooting.mdx @@ -47,7 +47,7 @@ openjdk version "1.8.0_191" OpenJDK Runtime Environment (build 1.8.0_191-b12) OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode) ``` -!!! Note: +!!! Note There is a temporary issue with OpenJDK version 11 on RHEL and its derivatives. When starting Failover Manager, you may see an error like the following: `java.lang.Error: java.io.FileNotFoundException: /usr/lib/jvm/java-11-openjdk-11.0.20.0.8-2.el8.x86_64/lib/tzdb.dat (No such file or directory)` diff --git a/product_docs/docs/efm/4/installing/prerequisites.mdx b/product_docs/docs/efm/4/installing/prerequisites.mdx index 83a7845f59c..7c221116dc5 100644 --- a/product_docs/docs/efm/4/installing/prerequisites.mdx +++ b/product_docs/docs/efm/4/installing/prerequisites.mdx @@ -17,7 +17,7 @@ Before configuring a Failover Manager cluster, you must satisfy the prerequisite Before using Failover Manager, you must first install Java (version 1.8 or later). Failover Manager is tested with OpenJDK, and we strongly recommend installing that version of Java. [Installation instructions for Java](https://openjdk.java.net/install/) are platform specific. -!!! Note: +!!! Note There is a temporary issue with OpenJDK version 11 on RHEL and its derivatives. When starting Failover Manager, you may see an error like the following: `java.lang.Error: java.io.FileNotFoundException: /usr/lib/jvm/java-11-openjdk-11.0.20.0.8-2.el8.x86_64/lib/tzdb.dat (No such file or directory)` From ec1b3f1de5491fe5b536c2fa8b4bd072979f54df Mon Sep 17 00:00:00 2001 From: kelpoole <44814688+kelpoole@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:21:41 -0700 Subject: [PATCH 04/17] Update architectures.mdx --- product_docs/docs/pgd/5/architectures.mdx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/product_docs/docs/pgd/5/architectures.mdx b/product_docs/docs/pgd/5/architectures.mdx index aee575d6b11..210ac0bcf2f 100644 --- a/product_docs/docs/pgd/5/architectures.mdx +++ b/product_docs/docs/pgd/5/architectures.mdx @@ -94,12 +94,14 @@ they aren't part of the standard Always On architectures. * Can be 3 data nodes (recommended) * Can be 2 data nodes and 1 witness that doesn't hold data (not depicted) * A PGD Proxy for each data node with affinity to the applications - * Can be colocated with data node + * Can be colocated with data node (recommended) + * Can be located on a separate node + * Configuration and infrastructure symmetry of data nodes is expected to ensure proper resources are available to handle application workload when rerouted * Barman for backup and recovery (not depicted) * Offsite is optional but recommended - * Can be shared by multiple clusters + * Can be shared by multiple PGD clusters * Postgres Enterprise Manager (PEM) for monitoring (not depicted) - * Can be shared by multiple clusters + * Can be shared by multiple PGD clusters ### Always On multi-location @@ -112,14 +114,17 @@ they aren't part of the standard Always On architectures. * Can be 3 data nodes (recommended) * Can be 2 data nodes and 1 witness which does not hold data (not depicted) * A PGD-Proxy for each data node with affinity to the applications - * can be co-located with data node + * can be co-located with data node (recommended) + * can be located on a separate node + * Configuration and infrastructure symmetry of data nodes and locations is expected to ensure proper resources are available to handle application workload when rerouted * Barman for backup and recovery (not depicted). - * Can be shared by multiple clusters + * Can be shared by multiple PGD clusters * Postgres Enterprise Manager (PEM) for monitoring (not depicted). - * Can be shared by multiple clusters + * Can be shared by multiple PGD clusters * An optional witness node must be placed in a third region to increase tolerance for location failure. * Otherwise, when a location fails, actions requiring global consensus are blocked, such as adding new nodes and distributed DDL. + ## Choosing your architecture All architectures provide the following: From 7cdc2e62aff0eab9541a0b7439815fda8d5bd6d5 Mon Sep 17 00:00:00 2001 From: Arthur Nascimento Date: Thu, 7 Sep 2023 17:06:38 -0300 Subject: [PATCH 05/17] Update 05_using_efm.mdx This changes the instructions on how to customize systemd service files. The instructions were directing the reader to edit files in /usr/lib/systemd/system, which is not the adequate location. Whenever a system administrator edits service files, they should always do so in /etc/systemd/system, either with systemctl edit or editing the files directly, but never editing anything in /lib or /usr. --- product_docs/docs/efm/4/05_using_efm.mdx | 30 ++++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/product_docs/docs/efm/4/05_using_efm.mdx b/product_docs/docs/efm/4/05_using_efm.mdx index fe797d2ee82..0ade30d911d 100644 --- a/product_docs/docs/efm/4/05_using_efm.mdx +++ b/product_docs/docs/efm/4/05_using_efm.mdx @@ -265,27 +265,37 @@ After creating the `acctg.properties` and `sales.properties` files, create a ser ### RHEL/CentOS 7.x or RHEL/Rocky Linux/AlmaLinux 8.x -If you're using RHEL/CentOS 7.x or RHEL/Rocky Linux/AlmaLinux 8.x, copy the `edb-efm-4.` unit file to a new file with a name that is unique for each cluster. For example, if you have two clusters named acctg and sales, the unit file names might be: +If you're using RHEL/CentOS 7.x or RHEL/Rocky Linux/AlmaLinux 8.x, copy the service file `/usr/lib/systemd/system/edb-efm-4..service` to `/etc/systemd/system` with a new name that is unique for each cluster. -```text -/usr/lib/systemd/system/efm-acctg.service +For example, if you have two clusters named `acctg` and `sales` managed by EFM 4.7, the unit file names might be `efm-acctg.service` and `efm-sales.service`, and they can be created with: -/usr/lib/systemd/system/efm-sales.service +```shell +cp /usr/lib/systemd/system/edb-efm-4.7.service /etc/systemd/system/efm-acctg.service +cp /usr/lib/systemd/system/edb-efm-4.7.service /etc/systemd/system/efm-sales.service ``` -Then, edit the `CLUSTER` variable in each unit file, changing the specified cluster name from `efm` to the new cluster name. For example, for a cluster named `acctg`, the value specifies: +Then use `systemctl edit` to edit the `CLUSTER` variable in each unit file, changing the specified cluster name from `efm` to the new cluster name. +Also update the value of the `PIDfile` parameter to match the new cluster name. -```text +In our example, edit the `acctg` cluster by running `systemctl edit efm-acctg.service` and write: + +```ini +[Service] Environment=CLUSTER=acctg +PIDFile=/run/efm-4.7/acctg.pid ``` -Also update the value of the `PIDfile` parameter to specify the new cluster name. For example: +And edit the `sales` cluster by running `systemctl edit efm-sales.service` and write: ```ini -PIDFile=/var/run/efm-4.7/acctg.pid +[Service] +Environment=CLUSTER=sales +PIDFile=/run/efm-4.7/sales.pid ``` -After copying the service scripts, enable the services: +Note: You could also have edited the files in `/etc/systemd/system` directly, but then you'll have to run `systemctl daemon-reload`, which is unecessary when using `systemd edit` to change the override files. + +After saving the changes, enable the services: ```text # systemctl enable efm-acctg.service @@ -296,7 +306,7 @@ After copying the service scripts, enable the services: Then, use the new service scripts to start the agents. For example, to start the `acctg` agent: ```text -# systemctl start efm-acctg` +# systemctl start efm-acctg ``` For information about customizing a unit file, see [Understanding and administering systemd](https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html). From c9a129c08b2f95344130aa6f5fd6567f51ec6aa2 Mon Sep 17 00:00:00 2001 From: Betsy Gitelman <93718720+ebgitelman@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:37:09 -0400 Subject: [PATCH 06/17] edits to PGD CLI content --- .../docs/pgd/5/cli/discover_connections.mdx | 40 ++++++++++++------- product_docs/docs/pgd/5/cli/index.mdx | 6 +-- .../docs/pgd/5/cli/installing_cli.mdx | 9 ++--- product_docs/docs/pgd/5/cli/using_cli.mdx | 24 +++++------ 4 files changed, 45 insertions(+), 34 deletions(-) diff --git a/product_docs/docs/pgd/5/cli/discover_connections.mdx b/product_docs/docs/pgd/5/cli/discover_connections.mdx index 61bde0b5ed4..84c468b3638 100644 --- a/product_docs/docs/pgd/5/cli/discover_connections.mdx +++ b/product_docs/docs/pgd/5/cli/discover_connections.mdx @@ -1,23 +1,27 @@ --- -title: "Discovering Connection Strings" -navTitle: "Discovering Connection Strings" +title: "Discovering connection strings" +navTitle: "Discovering connection strings" indexdepth: 2 deepToC: true --- -PGD CLI can be installed on any system which is able to connect to the PGD cluster. You will require a user with PGD superuser privileges - the [bdr_superuser role](../security) - or equivalent (e.g. edb_admin on BigAnimal distributed high-availability) to use PGD CLI. +You can install PGD CLI on any system that can connect to the PGD cluster. To use PGD CLI, you need a user with PGD superuser privileges or equivalent. The PGD user with superuser privileges is the [bdr_superuser role](../security). An example of an equivalent user is edb_admin on a BigAnimal distributed high-availability cluster. ## PGD CLI and database connection strings -You may not need a database connection string. For example, when Trusted Postgres Architect installs the PGD CLI on a system, it also configures the connection to the PGD cluster. This means that PGD CLI will automatically connect when run. +You might not need a database connection string. For example, when Trusted Postgres Architect installs the PGD CLI on a system, it also configures the connection to the PGD cluster. This means that PGD CLI can connect to the cluster when run. ## Getting your database connection string -Every deployment method has a different way of deriving a connection string for it. This is because of the range of different configurations that PGD supports. Generally, you can obtain the required information from the configuration of your deployment; this section provides a guide of how to assemble that information into connection strings. +Because of the range of different configurations that PGD supports, every deployment method has a different way of deriving a connection string for it. Generally, you can obtain the required information from the configuration of your deployment. You can then assemble that information into connection strings. ### For a TPA-deployed PGD cluster -Because TPA is so flexible, you will have to derive your connection string from your cluster configuration file (config.yml). You will need the name or IP address of a host with the role pgd-proxy listed for it. This host will have a proxy you can connect to. Usually the proxy will be listening on port 6432 (check the setting for `default_pgd_proxy_options` and `listen_port` in the config to confirm). The default database name is `bdrdb` (check the setting `bdr_database` in the config to confirm) and the default PGD superuser will be `enterprisedb` for EPAS and `postgres` for Postgres and Postgres Extended. +Because TPA is so flexible, you have to derive your connection string from your cluster configuration file (`config.yml`). + +- You need the name or IP address of a host with the role pgd-proxy listed for it. This host has a proxy you can connect to. Usually the proxy listens on port 6432. (Check the setting for `default_pgd_proxy_options` and `listen_port` in the config to confirm.) +- The default database name is `bdrdb`. (Check the setting `bdr_database` in the config to confirm.) +- The default PGD superuser is enterprisedb for EDB Postgres Advanced Server and postgres for Postgres and Postgres Extended. You can then assemble a connection string based on that information: @@ -25,7 +29,7 @@ You can then assemble a connection string based on that information: "host= port= dbname= user= sslmode=require" ``` -To illustrate this, here's some excerpts of a config.yml file for a cluster: +To illustrate this, here are some excerpts of a `config.yml` file for a cluster: ```yaml ... @@ -51,26 +55,34 @@ instances: ... ``` -The connection string for this cluster would be: +The connection string for this cluster is: ``` "host=192.168.100.2 port=6432 dbname=bdrdb user=enterprisedb sslmode=require" ``` !!! Note Host name versus IP address -In our example, we use the IP address because the configuration is from a Docker TPA install with no name resolution available. Generally, you should be able to use the host name as configured. +The example uses the IP address because the configuration is from a Docker TPA install with no name resolution available. Generally, you can use the host name as configured. !!! ### For a BigAnimal distributed high-availability cluster -1. Log into the [BigAnimal Clusters](https://portal.biganimal.com/clusters) view. +1. Log in to the [BigAnimal clusters](https://portal.biganimal.com/clusters) view. 1. Select your cluster. -1. In the view of your cluster, select the Connect tab. -1. Copy the Read/Write URI from the connection info. This is your connection string. +1. In the view of your cluster, select the **Connect** tab. +1. Copy the read/write URI from the connection info. This is your connection string. ### For an EDB PGD for Kubernetes deployed cluster -As with TPA, EDB PGD for Kubernetes is very flexible and there is no one way to obtain a connection string. It depends, in large part, on how the [Services](https://www.enterprisedb.com/docs/postgres_distributed_for_kubernetes/latest/connectivity/#services) have been configured for the deployment. If the Node Service Template is used, there should be direct connectivity to each node and proxy service available. If the Group Service Template, there will be a gateway service to each group. Finally, if the Proxy Service Template has been used, there should be a single proxy providing an entry point to the cluster for all applications. Consult your configuration file to determine this information. You should be able to establish a host name or IP address, port, database name (default: `bdrdb`) and username (`enterprisedb` for EPAS and `postgres` for Postgres and Postgres Extended.). +As with TPA, EDB PGD for Kubernetes is very flexible, and there are multiple ways to obtain a connection string. It depends, in large part, on how the [services](/postgres_distributed_for_kubernetes/latest/connectivity/#services) were configured for the deployment: + +- If you use the Node Service Template, direct connectivity to each node and proxy service is available. +- If you use the Group Service Template, there's a gateway service to each group. +- If you use the Proxy Service Template, a single proxy provides an entry point to the cluster for all applications. + +Consult your configuration file to determine this information. + +Establish a host name or IP address, port, database name, and username. The default database name is `bdrdb`, and the default username is enterprisedb for EDB Postgres Advanced Server and postgres for Postgres and Postgres Extended.). You can then assemble a connection string based on that information: @@ -78,6 +90,6 @@ You can then assemble a connection string based on that information: "host= port= dbname= user=" ``` -You may need to add `sslmode=` if the deployment's configuration requires it. +If the deployment's configuration requires it, add `sslmode=`. diff --git a/product_docs/docs/pgd/5/cli/index.mdx b/product_docs/docs/pgd/5/cli/index.mdx index 443ec13d74e..bf8a00d1b39 100644 --- a/product_docs/docs/pgd/5/cli/index.mdx +++ b/product_docs/docs/pgd/5/cli/index.mdx @@ -13,9 +13,9 @@ directoryDefaults: description: "The PGD Command Line Interface (CLI) is a tool to manage your EDB Postgres Distributed cluster" --- -The EDB Postgres Distributed Command Line Interface (PGD CLI) is a tool for managing your EDB Postgres Distributed cluster. It allows you to run commands against EDB Postgres Distributed clusters. It may be installed automatically on systems within a TPA-deployed PGD cluster or it can be installed manually on systems that can connect to any PGD cluster, including BigAnimal Distributed High Availability PGD clusters or PGD clusters deployed using the EDB PGD for Kubernetes operator. +The EDB Postgres Distributed Command Line Interface (PGD CLI) is a tool for managing your EDB Postgres Distributed cluster. It allows you to run commands against EDB Postgres Distributed clusters. It can be installed automatically on systems in a TPA-deployed PGD cluster. Or it can be installed manually on systems that can connect to any PGD cluster, including BigAnimal distributed high-availability PGD clusters or PGD clusters deployed using the EDB PGD for Kubernetes operator. -See [Installing PGD CLI](installing_cli) for information about how to install PGD CLI, both automatically with Trusted Postgres Architect and manually. +See [Installing PGD CLI](installing_cli) for information about how to install PGD CLI automatically with Trusted Postgres Architect and manually. See [Using PGD CLI](using_cli) for an introduction to using the PGD CLI and connecting to your PGD cluster. @@ -23,5 +23,5 @@ See [Configuring PGD CLI](configuring_cli) for details on creating persistent co See the [Command reference](command_ref) for the available commands to inspect, manage, and get information about cluster resources. -There is also a guide to [discovering connection strings](discover_connections). It shows how to obtain the correct connection strings for your PGD-powered deployment. +See [Discovering connection strings](discover_connections) to learn how to obtain the correct connection strings for your PGD-powered deployment. diff --git a/product_docs/docs/pgd/5/cli/installing_cli.mdx b/product_docs/docs/pgd/5/cli/installing_cli.mdx index 2ec709cf331..c72e436f58b 100644 --- a/product_docs/docs/pgd/5/cli/installing_cli.mdx +++ b/product_docs/docs/pgd/5/cli/installing_cli.mdx @@ -3,14 +3,15 @@ title: "Installing PGD CLI" navTitle: "Installing PGD CLI" --- -PGD CLI can be installed on any system which is able to connect to the PGD cluster. You will require a user with PGD superuser privileges - the [bdr_superuser role](../security) - or equivalent (e.g. edb_admin on BigAnimal distributed high-availability) to use PGD CLI. +You can install PGD CLI on any system that can connect to the PGD cluster. To use PGD CLI, you need a user with PGD superuser privileges or equivalent. The PGD user with superuser privileges is the [bdr_superuser role](../security). An example of an equivalent user is edb_admin on a BigAnimal distributed high-availability cluster. ## Installing automatically with Trusted Postgres Architect (TPA) + By default, Trusted Postgres Architect installs and configures PGD CLI on each PGD node. If you want to install PGD CLI on any non-PGD instance in the cluster, attach the pgdcli role to that instance in Trusted Postgres Architect's configuration file before deploying. See [Trusted Postgres Architect](/tpa/latest/) for more information. ## Installing manually on Linux -PGD CLI is installable from the EDB Repositories. These repositories require a token to enable downloads from them. You will need to login to [EDB Repos 2.0](https://www.enterprisedb.com/repos-downloads) to obtain your token. Then execute the following command, substituting +PGD CLI is installable from the EDB repositories. These repositories require a token to enable downloads from them. Log in to [EDB Repos 2.0](https://www.enterprisedb.com/repos-downloads) to obtain your token. Then execute the command shown for your operating system, substituting your token for ``. ### Add repository and install PGD CLI on Debian or Ubuntu @@ -20,7 +21,7 @@ curl -1sLf 'https://downloads.enterprisedb.com//postgres_distributed sudo apt-get install edb-pgd5-cli ``` -### Add repository and install PGD CLI on RHEL, Rocky, AlmaLinux or Oracle Linux +### Add repository and install PGD CLI on RHEL, Rocky, AlmaLinux, or Oracle Linux ```bash curl -1sLf 'https://downloads.enterprisedb.com//postgres_distributed/setup.rpm.sh' | sudo -E bash @@ -28,5 +29,3 @@ sudo yum install edb-pgd5-cli ``` [Next: Using PGD CLI](using_cli) - - diff --git a/product_docs/docs/pgd/5/cli/using_cli.mdx b/product_docs/docs/pgd/5/cli/using_cli.mdx index 3ea54d77ce3..ee992a9c828 100644 --- a/product_docs/docs/pgd/5/cli/using_cli.mdx +++ b/product_docs/docs/pgd/5/cli/using_cli.mdx @@ -3,27 +3,27 @@ title: "Using PGD CLI" navTitle: "Using PGD CLI" --- -## What is the PGD CLI +## What is the PGD CLI? -The PGD CLI is a convenient way to connect to and manage your PGD cluster. You will need the credentials of a Postgres users with PGD superuser privileges - the [bdr_superuser role](../security) - or equivalent (e.g. edb_admin on BigAnimal distributed high availability) to use it. +The PGD CLI is a convenient way to connect to and manage your PGD cluster. To use it, you need a user with PGD superuser privileges or equivalent. The PGD user with superuser privileges is the [bdr_superuser role](../security). An example of an equivalent user is edb_admin on a BigAnimal distributed high-availability cluster. !!! Important Setting passwords -PGD CLI does not interactively prompt for your user's password. You must pass your password using one of the following methods: +PGD CLI doesn't interactively prompt for your password. You must pass your password using one of the following methods: - 1. Adding an entry to your [`.pgpass` password file](https://www.postgresql.org/docs/current/libpq-pgpass.html) which includes the host, port, database name, user name, and password. - 1. Setting the password in the `PGPASSWORD` environment variable. - 1. Including the password in the connection string. + - Adding an entry to your [`.pgpass` password file](https://www.postgresql.org/docs/current/libpq-pgpass.html), which includes the host, port, database name, user name, and password. + - Setting the password in the `PGPASSWORD` environment variable. + - Including the password in the connection string. -We recommend the first option, as the other options don't scale well with multiple databases or compromise password confidentiality. +We recommend the first option, as the other options don't scale well with multiple databases, or they compromise password confidentiality. !!! ## Running the PGD CLI -Once you have [installed pgd-cli](installing_cli), run the `pgd` command to access the PGD command line interface. The `pgd` command will need details of which host, port, and database to connect to, along with your username and password. +Once you have [installed pgd-cli](installing_cli), run the `pgd` command to access the PGD command line interface. The `pgd` command needs details about the host, port, and database to connect to, along with your username and password. ## Passing a database connection string -Use the `--dsn` flag to pass a database connection string to the `pgd` command. You don't need a configuration file when you pass the connection string with the `--dsn` flag. The flag takes precedence even if a configuration file is present. For example: +Use the `--dsn` flag to pass a database connection string to the `pgd` command. When you pass the connection string with the `--dsn` flag, you don't need a configuration file. The flag takes precedence even if a configuration file is present. For example: ```sh pgd show-nodes --dsn "host=bdr-a1 port=5432 dbname=bdrdb user=enterprisedb" @@ -33,7 +33,7 @@ See [pgd](command_ref) in the command reference for a description of the command ## Specifying a configuration file -If a `pgd-cli-config.yml` file is in `/etc/edb/pgd-cli` or `$HOME/.edb/pgd-cli`, `pgd` will automatically use it. You can override +If a `pgd-cli-config.yml` file is in `/etc/edb/pgd-cli` or `$HOME/.edb/pgd-cli`, `pgd` uses it. You can override this behavior using the optional `-f` or `--config-file` flag. For example: ```sh @@ -75,13 +75,13 @@ pgd show-nodes -o json ] ``` -The PGD CLI supports the following output formats: +The PGD CLI supports the following output formats. | Setting | Format | Considerations | | ------- | ------ | --------- | | none | Tabular | Default format. This setting presents the data in tabular form.| | `json` | JSON | Presents the raw data with no formatting. For some commands, the JSON output might show more data than the tabular output, such as extra fields and more detailed messages. | -| `yaml` | YAML |Similar to the JSON output, but as YAML and with the fields ordered alphabetically. Experimental and may not be fully supported in future versions. | +| `yaml` | YAML | Similar to the JSON output but as YAML and with the fields ordered alphabetically. Experimental and might not be fully supported in future versions. | ## Accessing the command line help From d0761417b640f1dd9be42d019e81ea45997431b6 Mon Sep 17 00:00:00 2001 From: Betsy Gitelman <93718720+ebgitelman@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:47:23 -0400 Subject: [PATCH 07/17] Update discover_connections.mdx --- product_docs/docs/pgd/5/cli/discover_connections.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/pgd/5/cli/discover_connections.mdx b/product_docs/docs/pgd/5/cli/discover_connections.mdx index 84c468b3638..fb4cd2fbbd4 100644 --- a/product_docs/docs/pgd/5/cli/discover_connections.mdx +++ b/product_docs/docs/pgd/5/cli/discover_connections.mdx @@ -72,7 +72,7 @@ The example uses the IP address because the configuration is from a Docker TPA i 1. In the view of your cluster, select the **Connect** tab. 1. Copy the read/write URI from the connection info. This is your connection string. -### For an EDB PGD for Kubernetes deployed cluster +### For a cluster deployed with EDB PGD for Kubernetes As with TPA, EDB PGD for Kubernetes is very flexible, and there are multiple ways to obtain a connection string. It depends, in large part, on how the [services](/postgres_distributed_for_kubernetes/latest/connectivity/#services) were configured for the deployment: From 4feb40e72190750b1e114d1799cfe0ccca9a3ab8 Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan <126472455+djw-m@users.noreply.github.com> Date: Fri, 8 Sep 2023 08:50:27 +0100 Subject: [PATCH 08/17] Applying changes as per @kelpoole comments --- product_docs/docs/pgd/5/cli/discover_connections.mdx | 7 ++++--- product_docs/docs/pgd/5/cli/index.mdx | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/product_docs/docs/pgd/5/cli/discover_connections.mdx b/product_docs/docs/pgd/5/cli/discover_connections.mdx index fb4cd2fbbd4..ce04e3af495 100644 --- a/product_docs/docs/pgd/5/cli/discover_connections.mdx +++ b/product_docs/docs/pgd/5/cli/discover_connections.mdx @@ -21,7 +21,7 @@ Because TPA is so flexible, you have to derive your connection string from your - You need the name or IP address of a host with the role pgd-proxy listed for it. This host has a proxy you can connect to. Usually the proxy listens on port 6432. (Check the setting for `default_pgd_proxy_options` and `listen_port` in the config to confirm.) - The default database name is `bdrdb`. (Check the setting `bdr_database` in the config to confirm.) -- The default PGD superuser is enterprisedb for EDB Postgres Advanced Server and postgres for Postgres and Postgres Extended. +- The default PGD superuser is `enterprisedb` for EDB Postgres Advanced Server and `postgres` for Postgres and Postgres Extended. You can then assemble a connection string based on that information: @@ -65,9 +65,10 @@ The connection string for this cluster is: The example uses the IP address because the configuration is from a Docker TPA install with no name resolution available. Generally, you can use the host name as configured. !!! -### For a BigAnimal distributed high-availability cluster +### For an EDB BigAnimal Distributed High Availability cluster 1. Log in to the [BigAnimal clusters](https://portal.biganimal.com/clusters) view. +1. In the filter, set the Cluster Type to "Distributed High Availability" to only show clusters which work with PGD CLI. 1. Select your cluster. 1. In the view of your cluster, select the **Connect** tab. 1. Copy the read/write URI from the connection info. This is your connection string. @@ -82,7 +83,7 @@ As with TPA, EDB PGD for Kubernetes is very flexible, and there are multiple way Consult your configuration file to determine this information. -Establish a host name or IP address, port, database name, and username. The default database name is `bdrdb`, and the default username is enterprisedb for EDB Postgres Advanced Server and postgres for Postgres and Postgres Extended.). +Establish a host name or IP address, port, database name, and username. The default database name is `bdrdb`, and the default username is `enterprisedb` for EDB Postgres Advanced Server and `postgres` for Postgres and Postgres Extended.). You can then assemble a connection string based on that information: diff --git a/product_docs/docs/pgd/5/cli/index.mdx b/product_docs/docs/pgd/5/cli/index.mdx index bf8a00d1b39..1b87d879919 100644 --- a/product_docs/docs/pgd/5/cli/index.mdx +++ b/product_docs/docs/pgd/5/cli/index.mdx @@ -13,9 +13,9 @@ directoryDefaults: description: "The PGD Command Line Interface (CLI) is a tool to manage your EDB Postgres Distributed cluster" --- -The EDB Postgres Distributed Command Line Interface (PGD CLI) is a tool for managing your EDB Postgres Distributed cluster. It allows you to run commands against EDB Postgres Distributed clusters. It can be installed automatically on systems in a TPA-deployed PGD cluster. Or it can be installed manually on systems that can connect to any PGD cluster, including BigAnimal distributed high-availability PGD clusters or PGD clusters deployed using the EDB PGD for Kubernetes operator. +The EDB Postgres Distributed Command Line Interface (PGD CLI) is a tool for managing your EDB Postgres Distributed cluster. It allows you to run commands against EDB Postgres Distributed clusters. It is installed automatically on systems in a TPA-deployed PGD cluster. Or it can be installed manually on systems that can connect to any PGD cluster, such as EDB BigAnimal Distributed High Availability clusters or PGD clusters deployed using the EDB PGD for Kubernetes operator. -See [Installing PGD CLI](installing_cli) for information about how to install PGD CLI automatically with Trusted Postgres Architect and manually. +See [Installing PGD CLI](installing_cli) for information about how to manually install PGD CLI on systems. See [Using PGD CLI](using_cli) for an introduction to using the PGD CLI and connecting to your PGD cluster. From 02fee01ef58659969903175bdbd96f98e49efbfd Mon Sep 17 00:00:00 2001 From: kelpoole <44814688+kelpoole@users.noreply.github.com> Date: Fri, 8 Sep 2023 01:26:20 -0700 Subject: [PATCH 09/17] Update product_docs/docs/pgd/5/cli/discover_connections.mdx Co-authored-by: Dj Walker-Morgan <126472455+djw-m@users.noreply.github.com> --- product_docs/docs/pgd/5/cli/discover_connections.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/pgd/5/cli/discover_connections.mdx b/product_docs/docs/pgd/5/cli/discover_connections.mdx index ce04e3af495..5a24b8a63e9 100644 --- a/product_docs/docs/pgd/5/cli/discover_connections.mdx +++ b/product_docs/docs/pgd/5/cli/discover_connections.mdx @@ -5,7 +5,7 @@ indexdepth: 2 deepToC: true --- -You can install PGD CLI on any system that can connect to the PGD cluster. To use PGD CLI, you need a user with PGD superuser privileges or equivalent. The PGD user with superuser privileges is the [bdr_superuser role](../security). An example of an equivalent user is edb_admin on a BigAnimal distributed high-availability cluster. +You can install PGD CLI on any system that can connect to the PGD cluster. To use PGD CLI, you need a user with PGD superuser privileges or equivalent. The PGD user with superuser privileges is the [bdr_superuser role](../security). An example of an equivalent user is `edb_admin` on an EDB BigAnimal Distributed High Availability cluster. ## PGD CLI and database connection strings From 8112ae5025ac813634ea6ebb63a29d80c7c2ee22 Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan <126472455+djw-m@users.noreply.github.com> Date: Fri, 8 Sep 2023 10:55:34 +0100 Subject: [PATCH 10/17] Update product_docs/docs/efm/4/13_troubleshooting.mdx --- product_docs/docs/efm/4/13_troubleshooting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/efm/4/13_troubleshooting.mdx b/product_docs/docs/efm/4/13_troubleshooting.mdx index ff558cdb8bc..1652ac10269 100644 --- a/product_docs/docs/efm/4/13_troubleshooting.mdx +++ b/product_docs/docs/efm/4/13_troubleshooting.mdx @@ -52,4 +52,4 @@ OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode) `java.lang.Error: java.io.FileNotFoundException: /usr/lib/jvm/java-11-openjdk-11.0.20.0.8-2.el8.x86_64/lib/tzdb.dat (No such file or directory)` - If so, the workaround is to manually install the missing package, e.g. `dnf install tzdata-java` + If so, the workaround is to manually install the missing package using the command `sudo dnf install tzdata-java` From 85f19c018b5c2c13c6fd83400e825e56ec349b0f Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan <126472455+djw-m@users.noreply.github.com> Date: Fri, 8 Sep 2023 10:55:43 +0100 Subject: [PATCH 11/17] Update product_docs/docs/efm/4/installing/prerequisites.mdx --- product_docs/docs/efm/4/installing/prerequisites.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/efm/4/installing/prerequisites.mdx b/product_docs/docs/efm/4/installing/prerequisites.mdx index b4dc1bac48f..8b74021e55c 100644 --- a/product_docs/docs/efm/4/installing/prerequisites.mdx +++ b/product_docs/docs/efm/4/installing/prerequisites.mdx @@ -22,7 +22,7 @@ Before using Failover Manager, you must first install Java (version 1.8 or later `java.lang.Error: java.io.FileNotFoundException: /usr/lib/jvm/java-11-openjdk-11.0.20.0.8-2.el8.x86_64/lib/tzdb.dat (No such file or directory)` - If so, the workaround is to manually install the missing package, e.g. `dnf install tzdata-java` + If so, the workaround is to manually install the missing package using the command `sudo dnf install tzdata-java` ## Provide an SMTP server From 49497d5ac592ac1ebfc294bfbe1607c66a83e6a9 Mon Sep 17 00:00:00 2001 From: Dee Dee Rothery <83650384+drothery-edb@users.noreply.github.com> Date: Fri, 8 Sep 2023 06:29:56 -0400 Subject: [PATCH 12/17] minor copyedits --- product_docs/docs/efm/4/05_using_efm.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/product_docs/docs/efm/4/05_using_efm.mdx b/product_docs/docs/efm/4/05_using_efm.mdx index 0ade30d911d..6a7c7601131 100644 --- a/product_docs/docs/efm/4/05_using_efm.mdx +++ b/product_docs/docs/efm/4/05_using_efm.mdx @@ -267,7 +267,7 @@ After creating the `acctg.properties` and `sales.properties` files, create a ser If you're using RHEL/CentOS 7.x or RHEL/Rocky Linux/AlmaLinux 8.x, copy the service file `/usr/lib/systemd/system/edb-efm-4..service` to `/etc/systemd/system` with a new name that is unique for each cluster. -For example, if you have two clusters named `acctg` and `sales` managed by EFM 4.7, the unit file names might be `efm-acctg.service` and `efm-sales.service`, and they can be created with: +For example, if you have two clusters named `acctg` and `sales` managed by Failover Manager 4.7, the unit file names might be `efm-acctg.service` and `efm-sales.service`, and they can be created with: ```shell cp /usr/lib/systemd/system/edb-efm-4.7.service /etc/systemd/system/efm-acctg.service @@ -293,7 +293,9 @@ Environment=CLUSTER=sales PIDFile=/run/efm-4.7/sales.pid ``` -Note: You could also have edited the files in `/etc/systemd/system` directly, but then you'll have to run `systemctl daemon-reload`, which is unecessary when using `systemd edit` to change the override files. +!!!Note +You could also have edited the files in `/etc/systemd/system` directly, but then you'll have to run `systemctl daemon-reload`, which is unecessary when using `systemd edit` to change the override files. +!!! After saving the changes, enable the services: From 3bc5ed95126f3b133350de5855ba1a8822dc7ba2 Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan Date: Fri, 8 Sep 2023 09:59:46 +0100 Subject: [PATCH 13/17] Fixed bad lists (line break in earlier line) Signed-off-by: Dj Walker-Morgan --- product_docs/docs/pgd/5/limitations.mdx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/product_docs/docs/pgd/5/limitations.mdx b/product_docs/docs/pgd/5/limitations.mdx index 87c3db87415..e89f4faccfa 100644 --- a/product_docs/docs/pgd/5/limitations.mdx +++ b/product_docs/docs/pgd/5/limitations.mdx @@ -108,22 +108,20 @@ Be sure to disable transaction streaming when planning to use CAMO. You can configure this option globally or in the PGD node group. See [Transaction streaming configuration](../transaction-streaming#configuration). -- Not all DDL can run when CAMO is used. If unsupported DDL is used a warning is logged -and the transactions commit scope is set to local only. The only supported DDL operations are: - - non-concurrent CREATE INDEX - - non-concurrent DROP INDEX - - non-concurrent REINDEX of an individual table or index - - CLUSTER (of a single relation or index only) - - ANALYZE - - TRUNCATE +- Not all DDL can run when CAMO is used. If unsupported DDL is used a warning is logged and the transactions commit scope is set to local only. The only supported DDL operations are: + - non-concurrent `CREATE INDEX` + - non-concurrent `DROP INDEX` + - non-concurrent `REINDEX` of an individual table or index + - `CLUSTER` (of a single relation or index only) + - `ANALYZE` + - `TRUNCATE` ## Group Commit [Group Commit](durability/group-commit) is a feature which enables configurable synchronous commits over nodes in a group. If you use this feature, take the following limitations into account: -- Not all DDL can run when Group Commit is used. If unsupported DDL is used a warning is logged -and the transactions commit scope is set to local only. The only supported DDL operations are: +- Not all DDL can run when Group Commit is used. If unsupported DDL is used a warning is logged and the transactions commit scope is set to local only. The only supported DDL operations are: - non-concurrent CREATE INDEX - non-concurrent DROP INDEX - non-concurrent REINDEX of an individual table or index From 39b00221af63a3e263fc2e6d1d90bd64a7fde797 Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan Date: Fri, 8 Sep 2023 10:00:29 +0100 Subject: [PATCH 14/17] Added backticks Signed-off-by: Dj Walker-Morgan --- product_docs/docs/pgd/5/limitations.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/product_docs/docs/pgd/5/limitations.mdx b/product_docs/docs/pgd/5/limitations.mdx index e89f4faccfa..2ef3dc96b64 100644 --- a/product_docs/docs/pgd/5/limitations.mdx +++ b/product_docs/docs/pgd/5/limitations.mdx @@ -122,12 +122,12 @@ CAMO. You can configure this option globally or in the PGD node group. See nodes in a group. If you use this feature, take the following limitations into account: - Not all DDL can run when Group Commit is used. If unsupported DDL is used a warning is logged and the transactions commit scope is set to local only. The only supported DDL operations are: - - non-concurrent CREATE INDEX - - non-concurrent DROP INDEX - - non-concurrent REINDEX of an individual table or index - - CLUSTER (of a single relation or index only) - - ANALYZE - - TRUNCATE + - non-concurrent `CREATE INDEX` + - non-concurrent `DROP INDEX` + - non-concurrent `REINDEX` of an individual table or index + - `CLUSTER` (of a single relation or index only) + - `ANALYZE` + - `TRUNCATE` ## Eager From 1c6baff06105b6749b9169494f4119321c1cc6ea Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan <126472455+djw-m@users.noreply.github.com> Date: Fri, 8 Sep 2023 11:23:36 +0100 Subject: [PATCH 15/17] Update product_docs/docs/pgd/5/limitations.mdx Co-authored-by: Dee Dee Rothery <83650384+drothery-edb@users.noreply.github.com> --- product_docs/docs/pgd/5/limitations.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/pgd/5/limitations.mdx b/product_docs/docs/pgd/5/limitations.mdx index 2ef3dc96b64..6468f04f77f 100644 --- a/product_docs/docs/pgd/5/limitations.mdx +++ b/product_docs/docs/pgd/5/limitations.mdx @@ -108,7 +108,7 @@ Be sure to disable transaction streaming when planning to use CAMO. You can configure this option globally or in the PGD node group. See [Transaction streaming configuration](../transaction-streaming#configuration). -- Not all DDL can run when CAMO is used. If unsupported DDL is used a warning is logged and the transactions commit scope is set to local only. The only supported DDL operations are: +- Not all DDL can run when you use CAMO. If you use unsupported DDL, a warning is logged and the transactions commit scope is set to local only. The only supported DDL operations are: - non-concurrent `CREATE INDEX` - non-concurrent `DROP INDEX` - non-concurrent `REINDEX` of an individual table or index From 264203c80e79f523d283ac11982920909e78cdba Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan <126472455+djw-m@users.noreply.github.com> Date: Fri, 8 Sep 2023 11:23:45 +0100 Subject: [PATCH 16/17] Update product_docs/docs/pgd/5/limitations.mdx Co-authored-by: Dee Dee Rothery <83650384+drothery-edb@users.noreply.github.com> --- product_docs/docs/pgd/5/limitations.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/pgd/5/limitations.mdx b/product_docs/docs/pgd/5/limitations.mdx index 6468f04f77f..2ea6a437a25 100644 --- a/product_docs/docs/pgd/5/limitations.mdx +++ b/product_docs/docs/pgd/5/limitations.mdx @@ -121,7 +121,7 @@ CAMO. You can configure this option globally or in the PGD node group. See [Group Commit](durability/group-commit) is a feature which enables configurable synchronous commits over nodes in a group. If you use this feature, take the following limitations into account: -- Not all DDL can run when Group Commit is used. If unsupported DDL is used a warning is logged and the transactions commit scope is set to local only. The only supported DDL operations are: +- Not all DDL can run when you use Group Commit. If you use unsupported DDL, a warning is logged and the transactions commit scope is set to local. The only supported DDL operations are: - non-concurrent `CREATE INDEX` - non-concurrent `DROP INDEX` - non-concurrent `REINDEX` of an individual table or index From 0eedc8ee30f8b85dc202b91fce812590b682266b Mon Sep 17 00:00:00 2001 From: drothery-edb Date: Fri, 8 Sep 2023 10:05:27 -0400 Subject: [PATCH 17/17] BigAnimal: pricing fix --- .../docs/biganimal/release/pricing_and_billing/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product_docs/docs/biganimal/release/pricing_and_billing/index.mdx b/product_docs/docs/biganimal/release/pricing_and_billing/index.mdx index ffc41414e80..29b6ab62547 100644 --- a/product_docs/docs/biganimal/release/pricing_and_billing/index.mdx +++ b/product_docs/docs/biganimal/release/pricing_and_billing/index.mdx @@ -30,8 +30,8 @@ This table shows the cost breakdown. | Database type | Hourly price | Monthly price\* | | ---------------------------- | -------------- | --------------- | -| EDB Postgres Extended Server | $0.2511 / vCPU | $188.33 / vCPU | -| EDB Postgres Advanced Server | $0.3424 / vCPU | $256.80 / vCPU | +| EDB Postgres Extended Server | $0.2511 / vCPU | $183.30 / vCPU | +| EDB Postgres Advanced Server | $0.3424 / vCPU | $249.95 / vCPU | \* The monthly cost is approximate and assumes 730 hours in a month.