From 866c25c2b31e377a590851095f342d0a5c03a577 Mon Sep 17 00:00:00 2001 From: shambupujar Date: Wed, 2 Oct 2024 11:14:13 +0100 Subject: [PATCH 1/7] Remove postgres 12 and install version 15 --- .gitignore | 3 +- node-runner-cli/ansible/project/provision.yml | 56 ++++++++++++++++++- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 44d42c9f..cc68bc56 100644 --- a/.gitignore +++ b/.gitignore @@ -140,4 +140,5 @@ node-runner-cli/systemd.settings.yml .DS_Store node-runner-cli/out/ -requirements.txt \ No newline at end of file +requirements.txt +node-runner-cli/node-keystore.ks diff --git a/node-runner-cli/ansible/project/provision.yml b/node-runner-cli/ansible/project/provision.yml index 3e6f9056..004d8d3b 100644 --- a/node-runner-cli/ansible/project/provision.yml +++ b/node-runner-cli/ansible/project/provision.yml @@ -9,7 +9,7 @@ setup_swap: false setup_limits: false postgres_local: false - postgresql_version: 12 + postgresql_version: 15 postgresql_user: postgres postgresql_db_name: radixdlt_ledger tasks: @@ -78,6 +78,12 @@ state: present filename: pgdg + - name: Remove PostgreSQL 12 if installed + ansible.builtin.package: + name: postgresql-12 + state: absent + ignore_errors: true + - name: install PostgreSQL ansible.builtin.package: name: @@ -87,6 +93,54 @@ - acl state: present + - name: Debug print command pg_lsclusters + command: pg_lsclusters + register: pg_lsclusters_output + changed_when: false + + - name: Print pg_lsclusters output + debug: + var: pg_lsclusters_output.stdout_lines + + - name: Remove PostgreSQL 12 cluster if exists + shell: | + pg_lsclusters | grep '12' && pg_dropcluster --stop 12 main + ignore_errors: true + + - name: Check if PostgreSQL {{postgresql_version}} is listening on port 5432 + shell: | + ss -ltn | grep ':5432' + register: postgres_port_check + changed_when: false + ignore_errors: true + + - name: Stop PostgreSQL {{postgresql_version}} if it is running + service: + name: postgresql + state: stopped + when: postgres_port_check.stdout != "" + + - name: Modify PostgreSQL {{postgresql_version}} to listen on port 5432 + lineinfile: + path: /etc/postgresql/{{ postgresql_version }}/main/postgresql.conf + regexp: '^#?port =' + line: 'port = 5432' + state: present + + - name: Stop PostgreSQL service + service: + name: postgresql + state: stopped + + + - name: Reload systemd daemon + command: systemctl daemon-reload + + - name: Start PostgreSQL {{postgresql_version}} + service: + name: postgresql + state: started + - name: Install psycopg2-binary python package ansible.builtin.pip: name: psycopg2-binary From 05527b1456e82251542dd6acf71a79a1ca3d7b88 Mon Sep 17 00:00:00 2001 From: shambupujar Date: Wed, 2 Oct 2024 13:37:05 +0100 Subject: [PATCH 2/7] Add documentation for Postgres upgrade --- Readme.adoc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Readme.adoc b/Readme.adoc index 2ec7842c..06da2e5d 100644 --- a/Readme.adoc +++ b/Readme.adoc @@ -109,5 +109,34 @@ positional arguments: optional arguments: -h, --help show this help message and exit +---- + +== Upgrading Postgres from 12 to 15 +From release 1.7.3, upgrading Postgres is required. Follow the steps below to upgrade Postgres from version 12 to 15: + +1. Shutdown the node, and gateway: +[source, bash] +---- +./babylonnode docker stop +---- + +2. Install the new Postgres 15 and this is part of cli docker install process. The ansible provision.yml is updated to take care of uninstalling the old version and installing the new version. This removes the existing data on gateway and will reingest. So if you running production gateway, suggestion is to setup new instance and switch over to new instance once it is all synced up. +[source, bash] +---- +./babyonnode docker install +---- + +3.Check if node is running: + +For more information on node monitoring and health, refer to the documentation at https://docs.radixdlt.com/docs/node-monitoring-health. +4. Check if the gateway is running: +For more information on ensuring the gateway is running, refer to the documentation at https://docs.radixdlt.com/docs/setup-with-cli#6-make-sure-the-gateway-is-running. + + +5.If gateway is reporting issues, it might need a restart. Try below commands +[source, bash] +---- +docker compose down data_aggregator gateway_api +docker compose up data_aggregator gateway_api -d ---- From 17a1b6da6c7fba2a49b7997d8506f960fd571181 Mon Sep 17 00:00:00 2001 From: shambupujar Date: Wed, 2 Oct 2024 13:40:09 +0100 Subject: [PATCH 3/7] Minor typo --- Readme.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.adoc b/Readme.adoc index 06da2e5d..471212b1 100644 --- a/Readme.adoc +++ b/Readme.adoc @@ -112,7 +112,7 @@ optional arguments: ---- == Upgrading Postgres from 12 to 15 -From release 1.7.3, upgrading Postgres is required. Follow the steps below to upgrade Postgres from version 12 to 15: +From gateway release 1.7.3, upgrading Postgres is required. Follow the steps below to upgrade Postgres from version 12 to 15: 1. Shutdown the node, and gateway: [source, bash] From 8e5ba4844bb1b68621e1c0b35a776eac03974257 Mon Sep 17 00:00:00 2001 From: shambupujar Date: Wed, 2 Oct 2024 13:41:21 +0100 Subject: [PATCH 4/7] Formatting fix --- Readme.adoc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Readme.adoc b/Readme.adoc index 471212b1..c591e608 100644 --- a/Readme.adoc +++ b/Readme.adoc @@ -126,9 +126,7 @@ From gateway release 1.7.3, upgrading Postgres is required. Follow the steps bel ./babyonnode docker install ---- -3.Check if node is running: - -For more information on node monitoring and health, refer to the documentation at https://docs.radixdlt.com/docs/node-monitoring-health. +3. Check if node is running: For more information on node monitoring and health, refer to the documentation at https://docs.radixdlt.com/docs/node-monitoring-health. 4. Check if the gateway is running: For more information on ensuring the gateway is running, refer to the documentation at https://docs.radixdlt.com/docs/setup-with-cli#6-make-sure-the-gateway-is-running. From c3552d19ff9d1d5fd48538e52480b7277df13fe3 Mon Sep 17 00:00:00 2001 From: shambupujar Date: Wed, 2 Oct 2024 13:42:19 +0100 Subject: [PATCH 5/7] More formmating fix --- Readme.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Readme.adoc b/Readme.adoc index c591e608..bc7b019c 100644 --- a/Readme.adoc +++ b/Readme.adoc @@ -114,25 +114,25 @@ optional arguments: == Upgrading Postgres from 12 to 15 From gateway release 1.7.3, upgrading Postgres is required. Follow the steps below to upgrade Postgres from version 12 to 15: -1. Shutdown the node, and gateway: +=== Shutdown the node, and gateway: [source, bash] ---- ./babylonnode docker stop ---- -2. Install the new Postgres 15 and this is part of cli docker install process. The ansible provision.yml is updated to take care of uninstalling the old version and installing the new version. This removes the existing data on gateway and will reingest. So if you running production gateway, suggestion is to setup new instance and switch over to new instance once it is all synced up. +=== Install the new Postgres 15 and this is part of cli docker install process. The ansible provision.yml is updated to take care of uninstalling the old version and installing the new version. This removes the existing data on gateway and will reingest. So if you running production gateway, suggestion is to setup new instance and switch over to new instance once it is all synced up. [source, bash] ---- ./babyonnode docker install ---- -3. Check if node is running: For more information on node monitoring and health, refer to the documentation at https://docs.radixdlt.com/docs/node-monitoring-health. +=== Check if node is running: For more information on node monitoring and health, refer to the documentation at https://docs.radixdlt.com/docs/node-monitoring-health. -4. Check if the gateway is running: +=== Check if the gateway is running: For more information on ensuring the gateway is running, refer to the documentation at https://docs.radixdlt.com/docs/setup-with-cli#6-make-sure-the-gateway-is-running. -5.If gateway is reporting issues, it might need a restart. Try below commands +=== If gateway is reporting issues, it might need a restart. Try below commands [source, bash] ---- docker compose down data_aggregator gateway_api From e4404ebf228fb1697cf83cf42dddb9a1d77e8681 Mon Sep 17 00:00:00 2001 From: shambupujar Date: Wed, 2 Oct 2024 13:43:07 +0100 Subject: [PATCH 6/7] More formatting fix --- Readme.adoc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Readme.adoc b/Readme.adoc index bc7b019c..2ce4235d 100644 --- a/Readme.adoc +++ b/Readme.adoc @@ -120,13 +120,15 @@ From gateway release 1.7.3, upgrading Postgres is required. Follow the steps bel ./babylonnode docker stop ---- -=== Install the new Postgres 15 and this is part of cli docker install process. The ansible provision.yml is updated to take care of uninstalling the old version and installing the new version. This removes the existing data on gateway and will reingest. So if you running production gateway, suggestion is to setup new instance and switch over to new instance once it is all synced up. +=== Install the new Postgres 15 + This is part of cli docker install process. The ansible provision.yml is updated to take care of uninstalling the old version and installing the new version. This removes the existing data on gateway and will reingest. So if you running production gateway, suggestion is to setup new instance and switch over to new instance once it is all synced up. [source, bash] ---- ./babyonnode docker install ---- -=== Check if node is running: For more information on node monitoring and health, refer to the documentation at https://docs.radixdlt.com/docs/node-monitoring-health. +=== Check if node is running: + For more information on node monitoring and health, refer to the documentation at https://docs.radixdlt.com/docs/node-monitoring-health. === Check if the gateway is running: For more information on ensuring the gateway is running, refer to the documentation at https://docs.radixdlt.com/docs/setup-with-cli#6-make-sure-the-gateway-is-running. From 0eb08b313f527eb35bbbcf5452188952b8709b23 Mon Sep 17 00:00:00 2001 From: shambupujar Date: Wed, 2 Oct 2024 14:52:20 +0100 Subject: [PATCH 7/7] Fix review comments --- Readme.adoc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Readme.adoc b/Readme.adoc index 2ce4235d..1412153b 100644 --- a/Readme.adoc +++ b/Readme.adoc @@ -112,7 +112,7 @@ optional arguments: ---- == Upgrading Postgres from 12 to 15 -From gateway release 1.7.3, upgrading Postgres is required. Follow the steps below to upgrade Postgres from version 12 to 15: +From gateway release 1.7.0, upgrading Postgres is required. Follow the steps below to upgrade Postgres from version 12 to 15: === Shutdown the node, and gateway: [source, bash] @@ -121,20 +121,23 @@ From gateway release 1.7.3, upgrading Postgres is required. Follow the steps bel ---- === Install the new Postgres 15 - This is part of cli docker install process. The ansible provision.yml is updated to take care of uninstalling the old version and installing the new version. This removes the existing data on gateway and will reingest. So if you running production gateway, suggestion is to setup new instance and switch over to new instance once it is all synced up. +This is part of cli docker install process. The ansible provision.yml is updated to take care of uninstalling the old version and installing the new version. This removes the existing data on gateway and will reingest. So if you running production gateway, suggestion is to setup new instance and switch over to new instance once it is all synced up. + [source, bash] ---- ./babyonnode docker install ---- === Check if node is running: - For more information on node monitoring and health, refer to the documentation at https://docs.radixdlt.com/docs/node-monitoring-health. +For more information on node monitoring and health, refer to the documentation at https://docs.radixdlt.com/docs/node-monitoring-health. + === Check if the gateway is running: For more information on ensuring the gateway is running, refer to the documentation at https://docs.radixdlt.com/docs/setup-with-cli#6-make-sure-the-gateway-is-running. -=== If gateway is reporting issues, it might need a restart. Try below commands +=== Gateway still reporting issues +Both gateway_api and data_aggregator might need a restart. Try below commands [source, bash] ---- docker compose down data_aggregator gateway_api