From fef62e2693a551f245c6e7b136a310334519afc6 Mon Sep 17 00:00:00 2001 From: Andrii Landiak Date: Mon, 4 Dec 2023 13:24:57 +0200 Subject: [PATCH] Update psql to use 15 version --- .../install/centos/instructions.md | 22 +++++++++---------- .../install/ubuntu/instructions.md | 2 +- .../instructions/upgrade/docker/upgrade_db.md | 2 +- .../service/update/DefaultUpdateService.java | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/application/src/main/data/json/edge/instructions/install/centos/instructions.md b/application/src/main/data/json/edge/instructions/install/centos/instructions.md index 9ad882c387..22bb3f63a0 100644 --- a/application/src/main/data/json/edge/instructions/install/centos/instructions.md +++ b/application/src/main/data/json/edge/instructions/install/centos/instructions.md @@ -56,13 +56,13 @@ sudo yum update sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm # Install packages sudo yum -y install epel-release yum-utils -sudo yum-config-manager --enable pgdg12 -sudo yum install postgresql12-server postgresql12 +sudo yum-config-manager --enable pgdg15 +sudo yum install postgresql15-server postgresql15 # Initialize your PostgreSQL DB -sudo /usr/pgsql-12/bin/postgresql-12-setup initdb -sudo systemctl start postgresql-12 +sudo /usr/pgsql-15/bin/postgresql-15-setup initdb +sudo systemctl start postgresql-15 # Optional: Configure PostgreSQL to start on boot -sudo systemctl enable --now postgresql-12 +sudo systemctl enable --now postgresql-15 {:copy-code} ``` @@ -74,12 +74,12 @@ sudo systemctl enable --now postgresql-12 sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm # Install packages sudo dnf -qy module disable postgresql -sudo dnf -y install postgresql12 postgresql12-server +sudo dnf -y install postgresql15 postgresql15-server # Initialize your PostgreSQL DB -sudo /usr/pgsql-12/bin/postgresql-12-setup initdb -sudo systemctl start postgresql-12 +sudo /usr/pgsql-15/bin/postgresql-15-setup initdb +sudo systemctl start postgresql-15 # Optional: Configure PostgreSQL to start on boot -sudo systemctl enable --now postgresql-12 +sudo systemctl enable --now postgresql-15 {:copy-code} ``` @@ -101,7 +101,7 @@ After configuring the password, edit the pg_hba.conf to use MD5 authentication w Edit pg_hba.conf file: ```bash -sudo nano /var/lib/pgsql/12/data/pg_hba.conf +sudo nano /var/lib/pgsql/15/data/pg_hba.conf {:copy-code} ``` @@ -121,7 +121,7 @@ host all all 127.0.0.1/32 md5 Finally, you should restart the PostgreSQL service to initialize the new configuration: ```bash -sudo systemctl restart postgresql-12.service +sudo systemctl restart postgresql-15.service {:copy-code} ``` diff --git a/application/src/main/data/json/edge/instructions/install/ubuntu/instructions.md b/application/src/main/data/json/edge/instructions/install/ubuntu/instructions.md index 2a6d9c0bc3..6fcdcd50f2 100644 --- a/application/src/main/data/json/edge/instructions/install/ubuntu/instructions.md +++ b/application/src/main/data/json/edge/instructions/install/ubuntu/instructions.md @@ -49,7 +49,7 @@ echo "deb http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo # install and launch the postgresql service: sudo apt update -sudo apt -y install postgresql-12 +sudo apt -y install postgresql-15 sudo service postgresql start {:copy-code} ``` diff --git a/application/src/main/data/json/edge/instructions/upgrade/docker/upgrade_db.md b/application/src/main/data/json/edge/instructions/upgrade/docker/upgrade_db.md index ac38031517..8c218ab41d 100644 --- a/application/src/main/data/json/edge/instructions/upgrade/docker/upgrade_db.md +++ b/application/src/main/data/json/edge/instructions/upgrade/docker/upgrade_db.md @@ -23,7 +23,7 @@ services: entrypoint: upgrade-tb-edge.sh postgres: restart: always - image: "postgres:12" + image: "postgres:15" ports: - "5432" environment: diff --git a/application/src/main/java/org/thingsboard/server/service/update/DefaultUpdateService.java b/application/src/main/java/org/thingsboard/server/service/update/DefaultUpdateService.java index 7ddc4b0e9d..cf31464ba9 100644 --- a/application/src/main/java/org/thingsboard/server/service/update/DefaultUpdateService.java +++ b/application/src/main/java/org/thingsboard/server/service/update/DefaultUpdateService.java @@ -69,10 +69,10 @@ public class DefaultUpdateService implements UpdateService { @Autowired private NotificationRuleProcessor notificationRuleProcessor; - @Autowired + @Autowired(required = false) private EdgeInstallInstructionsService edgeInstallInstructionsService; - @Autowired + @Autowired(required = false) private EdgeUpgradeInstructionsService edgeUpgradeInstructionsService; private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1, ThingsBoardThreadFactory.forName("tb-update-service"));