diff --git a/docs/modules/deployment/pages/core/centos-rhel8/postgresql.adoc b/docs/modules/deployment/pages/core/centos-rhel8/postgresql.adoc deleted file mode 100644 index f5acb4bac155..000000000000 --- a/docs/modules/deployment/pages/core/centos-rhel8/postgresql.adoc +++ /dev/null @@ -1,65 +0,0 @@ -.Install PostgreSQL client and server -[source, console] ----- -sudo dnf -y install postgresql-server postgresql ----- - -.Initialize the PostgreSQL database -[source, console] ----- -sudo postgresql-setup --initdb --unit postgresql ----- - -.Enable PostgreSQL on system boot and start immediately -[source, console] ----- -sudo systemctl enable --now postgresql ----- - -.Create an opennms database user and password -[source, console] ----- -sudo -i -u postgres createuser -P opennms ----- - -IMPORTANT: You must provide a password for the `opennms` database user. - This guide uses `YOUR-OPENNMS-PASSWORD` as a placeholder. - Please set a secure password. - -.Create an empty database and set the owner to the opennms user -[source, console] ----- -sudo -i -u postgres createdb -O opennms opennms ----- - -.Set a password for PostgreSQL superuser -[source, console] ----- -sudo -i -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'YOUR-POSTGRES-PASSWORD';" ----- - -IMPORTANT: Change `YOUR-POSTGRES-PASSWORD` to a secure one. - The superuser is required to be able to initialize and change the database schema for installation and updates. - - -[[core-centos-rhel8-pg_hba]] -.Change the access policy for PostgreSQL -[source, console] ----- -sudo vi /var/lib/pgsql/data/pg_hba.conf ----- - -.Allow {page-component-title} to access the database over the local network with an MD5 hashed password -[source, pg_hba.conf] ----- -host all all 127.0.0.1/32 md5<1> -host all all ::1/128 md5<1> ----- - -<1> Change method from `ident` to `md5` for IPv4 and IPv6 on localhost. - -.Apply configuration changes for PostgreSQL -[source, console] ----- -sudo systemctl reload postgresql ----- diff --git a/docs/modules/deployment/pages/core/centos/adoptium.adoc b/docs/modules/deployment/pages/core/centos/adoptium.adoc new file mode 100644 index 000000000000..d54ef66d5e5c --- /dev/null +++ b/docs/modules/deployment/pages/core/centos/adoptium.adoc @@ -0,0 +1,18 @@ +.Add Adoptium repository. See official https://adoptium.net/installation[docs] for more information. +[source, console] +---- +sudo bash -c 'cat < /etc/yum.repos.d/adoptium.repo +[Adoptium] +name=Adoptium +baseurl=https://packages.adoptium.net/artifactory/rpm/${DISTRIBUTION_NAME:-$(. /etc/os-release; echo $ID)}/\$releasever/\$basearch +enabled=1 +gpgcheck=1 +gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public +EOF' +---- + +.Install Temurin Java {compatible-javajdk} +[source, console, subs="attributes"] +---- +sudo dnf install temurin-{compatible-javajdk}-jdk +---- diff --git a/docs/modules/deployment/pages/core/centos9/install-core.adoc b/docs/modules/deployment/pages/core/centos/install-core.adoc similarity index 86% rename from docs/modules/deployment/pages/core/centos9/install-core.adoc rename to docs/modules/deployment/pages/core/centos/install-core.adoc index 5fbbd0f04524..fb7bed1d5e3c 100644 --- a/docs/modules/deployment/pages/core/centos9/install-core.adoc +++ b/docs/modules/deployment/pages/core/centos/install-core.adoc @@ -1,9 +1,13 @@ ifeval::["{page-component-title}" == "Horizon"] -include::../../repos/rhel-centos/horizon-rhel9.adoc[] +include::../centos/adoptium.adoc[] +endif::[] + +ifeval::["{page-component-title}" == "Horizon"] +include::../centos/repo-horizon.adoc[] endif::[] ifeval::["{page-component-title}" == "Meridian"] -include::../../repos/rhel-centos/meridian-rhel9.adoc[] +include::../centos/repo-meridian.adoc[] endif::[] .Install {page-component-title} with all built-in dependencies diff --git a/docs/modules/deployment/pages/core/centos/install-postgresql.adoc b/docs/modules/deployment/pages/core/centos/install-postgresql.adoc new file mode 100644 index 000000000000..41f78ae9ffce --- /dev/null +++ b/docs/modules/deployment/pages/core/centos/install-postgresql.adoc @@ -0,0 +1,23 @@ +.Install language packs and set language +[source,console] +---- +sudo dnf install langpacks-en glibc-all-langpacks -y +sudo localectl set-locale LANG=en_US.UTF-8 +sudo localectl +sudo dnf makecache +sudo dnf update -y +---- + +.Install PostgreSQL +[source, console] +[subs="verbatim,attributes"] +---- +sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-x86_64/pgdg-redhat-repo-latest.noarch.rpm +sudo dnf -qy module disable postgresql +sudo dnf install -y postgresql{postgresql-version}-server +sudo /usr/pgsql-{postgresql-version}/bin/postgresql-{postgresql-version}-setup initdb +sudo systemctl enable postgresql-{postgresql-version} +sudo systemctl start postgresql-{postgresql-version} +---- + +include::../general/initialize-postgresql.adoc[] diff --git a/docs/modules/deployment/pages/core/centos/repo-horizon.adoc b/docs/modules/deployment/pages/core/centos/repo-horizon.adoc new file mode 100644 index 000000000000..64bb07a598dd --- /dev/null +++ b/docs/modules/deployment/pages/core/centos/repo-horizon.adoc @@ -0,0 +1,10 @@ +.Add repository and import GPG key +[source, console] +---- +sudo dnf -y install https://yum.opennms.org/repofiles/opennms-repo-stable-rhel9.noarch.rpm +---- +NOTE: This is a workaround until https://opennms.atlassian.net/browse/NMS-19071[NMS-19071] is solved. +[source, console] +---- +sudo sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/opennms-repo-stable-rhel9.repo +---- \ No newline at end of file diff --git a/docs/modules/deployment/pages/repos/rhel-centos/meridian-rhel9.adoc b/docs/modules/deployment/pages/core/centos/repo-meridian.adoc similarity index 100% rename from docs/modules/deployment/pages/repos/rhel-centos/meridian-rhel9.adoc rename to docs/modules/deployment/pages/core/centos/repo-meridian.adoc diff --git a/docs/modules/deployment/pages/core/debian-ubuntu/adoptium.adoc b/docs/modules/deployment/pages/core/debian-ubuntu/adoptium.adoc new file mode 100644 index 000000000000..e6928aa27e3a --- /dev/null +++ b/docs/modules/deployment/pages/core/debian-ubuntu/adoptium.adoc @@ -0,0 +1,13 @@ +.Add Adoptium repository. See official https://adoptium.net/installation/linux#deb-installation-on-debian-or-ubuntu[docs] for more information. +[source, console] +---- +sudo wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null +sudo echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list +sudo apt update +---- + +.Install Temurin Java {compatible-javajdk} +[source, console, subs="attributes"] +---- +sudo apt -y install temurin-{compatible-javajdk}-jdk +---- diff --git a/docs/modules/deployment/pages/core/ubuntu/install-core.adoc b/docs/modules/deployment/pages/core/debian-ubuntu/install-core.adoc similarity index 84% rename from docs/modules/deployment/pages/core/ubuntu/install-core.adoc rename to docs/modules/deployment/pages/core/debian-ubuntu/install-core.adoc index fc8dafe16aaf..460c8bcccccb 100644 --- a/docs/modules/deployment/pages/core/ubuntu/install-core.adoc +++ b/docs/modules/deployment/pages/core/debian-ubuntu/install-core.adoc @@ -1,6 +1,9 @@ -.Add OpenNMS repository GPG key +include::../debian-ubuntu/adoptium.adoc[] + +.Install GnuPG and add OpenNMS repository GPG key [source, console] ---- +sudo apt -y install curl gnupg ca-certificates curl -fsSL https://debian.opennms.org/OPENNMS-GPG-KEY | sudo gpg --dearmor -o /usr/share/keyrings/opennms.gpg ---- @@ -13,7 +16,7 @@ sudo apt update NOTE: You can safely ignore the message about conflicting distributions (expected stable but got opennms-xx). -.Install OpenNMS {page-component-title} with built-in dependencies (optional) +.Install OpenNMS {page-component-title} with built-in dependencies [source, console] ---- sudo apt -y install opennms @@ -21,7 +24,7 @@ sudo apt -y install opennms TIP: Disable the OpenNMS {page-component-title} repository after installation to prevent unwanted upgrades when upgrading other packages on the server. After upgrade, {page-component-title} requires manual steps to upgrade configuration files or migrate database schemas to a new version. - We recommend that you exclude the {page-component-title} packages from update except when you are planning on performing an upgrade. + We recommend that you exclude the {page-component-title} packages from update except when you plan perform an upgrade. [source, console] ---- diff --git a/docs/modules/deployment/pages/core/debian-ubuntu/install-postgresql.adoc b/docs/modules/deployment/pages/core/debian-ubuntu/install-postgresql.adoc new file mode 100644 index 000000000000..13941525c473 --- /dev/null +++ b/docs/modules/deployment/pages/core/debian-ubuntu/install-postgresql.adoc @@ -0,0 +1,9 @@ +.Install PostgreSQL client and server +[source, console] +---- +sudo apt install -y postgresql-common +sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh +sudo apt -y install postgresql-{postgresql-version} +---- + +include::../general/initialize-postgresql.adoc[] diff --git a/docs/modules/deployment/pages/core/debian-ubuntu/postgresql.adoc b/docs/modules/deployment/pages/core/debian-ubuntu/postgresql.adoc deleted file mode 100644 index f3dcce3c617a..000000000000 --- a/docs/modules/deployment/pages/core/debian-ubuntu/postgresql.adoc +++ /dev/null @@ -1,32 +0,0 @@ -.Install PostgreSQL client and server -[source, console] ----- -sudo apt install -y postgresql-common -sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -sudo apt -y install postgresql-{postgresql-version} ----- - -.Create an opennms database user and password -[source, console] ----- -sudo -u postgres createuser -P opennms ----- - -IMPORTANT: You must provide a password for the `opennms` database user. - This guide uses `YOUR-OPENNMS-PASSWORD` as a placeholder. - Please set a secure password. - -.Create an empty database and set the owner to the opennms user -[source, console] ----- -sudo -u postgres createdb -O opennms opennms ----- - -.Set a password for PostgreSQL superuser -[source, shell] ----- -sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'YOUR-POSTGRES-PASSWORD';" ----- - -IMPORTANT: Change `YOUR-POSTGRES-PASSWORD` to a secure one. - The superuser is required to initialize and change the database schema for installation and updates. diff --git a/docs/modules/deployment/pages/core/debian/install-core.adoc b/docs/modules/deployment/pages/core/debian/install-core.adoc deleted file mode 100644 index 0a75dc49feee..000000000000 --- a/docs/modules/deployment/pages/core/debian/install-core.adoc +++ /dev/null @@ -1,55 +0,0 @@ -.Install GnuPG and add OpenNMS repository GPG key -[source, console] ----- -sudo apt -y install curl gnupg ca-certificates -curl -fsSL https://debian.opennms.org/OPENNMS-GPG-KEY | sudo gpg --dearmor -o /usr/share/keyrings/opennms.gpg ----- - -.Add and update apt repository -[source, console] ----- -echo "deb [signed-by=/usr/share/keyrings/opennms.gpg] https://debian.opennms.org stable main" | sudo tee /etc/apt/sources.list.d/opennms.list -sudo apt update ----- - -NOTE: You can safely ignore the message about conflicting distributions (expected stable but got opennms-xx). - -.Install OpenNMS {page-component-title} with built-in dependencies -[source, console] ----- -sudo apt -y install opennms ----- - -TIP: Disable the OpenNMS {page-component-title} repository after installation to prevent unwanted upgrades when upgrading other packages on the server. - After upgrade, {page-component-title} requires manual steps to upgrade configuration files or migrate database schemas to a new version. - We recommend that you exclude the {page-component-title} packages from update except when you plan perform an upgrade. - -[source, console] ----- -sudo apt-mark hold libopennms-java \ - libopennmsdeps-java \ - opennms-common \ - opennms-db ----- - -.Verify directory structure with the tree command -[source, console] ----- -sudo apt -y install tree -tree /opt/opennms -L 1 ----- - -.Directory structure after successful installation -[source, output] ----- -/opt/opennms -├── bin -├── data -├── deploy -├── etc -> /etc/opennms -├── jetty-webapps -├── lib -> ../java/opennms -├── logs -> /var/log/opennms -├── share -> /var/lib/opennms -└── system ----- diff --git a/docs/modules/deployment/pages/core/centos9/postgresql.adoc b/docs/modules/deployment/pages/core/general/initialize-postgresql.adoc similarity index 52% rename from docs/modules/deployment/pages/core/centos9/postgresql.adoc rename to docs/modules/deployment/pages/core/general/initialize-postgresql.adoc index 53c32ef840c8..e53f039df01c 100644 --- a/docs/modules/deployment/pages/core/centos9/postgresql.adoc +++ b/docs/modules/deployment/pages/core/general/initialize-postgresql.adoc @@ -1,25 +1,3 @@ -.Install language packs and set language -[source,console] ----- -sudo dnf install langpacks-en glibc-all-langpacks -y -sudo localectl set-locale LANG=en_US.UTF-8 -sudo localectl -sudo dnf makecache -sudo dnf update -y ----- - -.Install PostgreSQL -[source, console] -[subs="verbatim,attributes"] ----- -sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm -sudo dnf -qy module disable postgresql -sudo dnf install -y postgresql{postgresql-version}-server -sudo /usr/pgsql-{postgresql-version}/bin/postgresql-{postgresql-version}-setup initdb -sudo systemctl enable postgresql-{postgresql-version} -sudo systemctl start postgresql-{postgresql-version} ----- - IMPORTANT: You must provide a secure password for the `opennms` database user account. This guide uses `YOUR-OPENNMS-PASSWORD` as a placeholder. diff --git a/docs/modules/deployment/pages/core/install.adoc b/docs/modules/deployment/pages/core/install.adoc index f4f9e0ccbb35..5a22c622251a 100644 --- a/docs/modules/deployment/pages/core/install.adoc +++ b/docs/modules/deployment/pages/core/install.adoc @@ -1,7 +1,7 @@ [[getting-started-core]] = Installation and Configuration -:description: Install and configure OpenNMS instance including PostgreSQL setup on CentOS/RHEL 9, Debian/Ubuntu, and Docker. +:description: Install and configure OpenNMS instance including PostgreSQL setup on CentOS/RHEL 9/10, Debian/Ubuntu, and Docker. This section explains how to install and configure a new {page-component-title} instance, including the following tasks: @@ -82,17 +82,17 @@ Use it at your own discretion. [{tabs}] ==== -CentOS 9:: +CentOS/RHEL 9/10:: + -- -include::centos9/postgresql.adoc[] +include::centos/install-postgresql.adoc[] -- ifeval::["{page-component-title}" == "Horizon"] Debian/Ubuntu:: + -- -include::debian-ubuntu/postgresql.adoc[] +include::debian-ubuntu/install-postgresql.adoc[] -- Docker:: @@ -111,23 +111,17 @@ Do not expose the web console or sign-in pages directly to the Internet without [{tabs}] ==== -CentOS 9:: +CentOS/RHEL 9/10:: + -- -include::centos9/install-core.adoc[] +include::centos/install-core.adoc[] -- ifeval::["{page-component-title}" == "Horizon"] -Ubuntu:: -+ --- -include::ubuntu/install-core.adoc[] --- - -Debian:: +Debian/Ubuntu:: + -- -include::debian/install-core.adoc[] +include::debian-ubuntu/install-core.adoc[] -- Docker:: @@ -143,7 +137,7 @@ endif::[] [{tabs}] ==== -CentOS 9:: +CentOS/RHEL 9/10:: + -- include::centos/initialize-core.adoc[] diff --git a/docs/modules/deployment/pages/minion/centos-rhel9/install-minion.adoc b/docs/modules/deployment/pages/minion/centos-rhel9/install-minion.adoc index 413f192a4bba..aebd80a332b0 100644 --- a/docs/modules/deployment/pages/minion/centos-rhel9/install-minion.adoc +++ b/docs/modules/deployment/pages/minion/centos-rhel9/install-minion.adoc @@ -5,11 +5,11 @@ sudo dnf -y install java-17-openjdk-headless ---- ifeval::["{page-component-title}" == "Horizon"] -include::../../repos/rhel-centos/horizon-rhel9.adoc[] +include::../../core/centos/repo-horizon.adoc[] endif::[] ifeval::["{page-component-title}" == "Meridian"] -include::../../repos/rhel-centos/meridian-rhel9.adoc[] +include::../../core/centos/repo-meridian.adoc[] endif::[] .Install the {page-component-title} Minion package diff --git a/docs/modules/deployment/pages/repos/rhel-centos/horizon-rhel9.adoc b/docs/modules/deployment/pages/repos/rhel-centos/horizon-rhel9.adoc deleted file mode 100644 index de3a851ed32e..000000000000 --- a/docs/modules/deployment/pages/repos/rhel-centos/horizon-rhel9.adoc +++ /dev/null @@ -1,6 +0,0 @@ -.Add repository and import GPG key -[source, console] ----- -sudo dnf -y install https://yum.opennms.org/repofiles/opennms-repo-stable-rhel9.noarch.rpm -sudo rpm --import https://yum.opennms.org/OPENNMS-GPG-KEY ----- diff --git a/docs/modules/deployment/pages/sentinel/runtime/centos-rhel9/install-sentinel.adoc b/docs/modules/deployment/pages/sentinel/runtime/centos-rhel9/install-sentinel.adoc index 7d11b7c028a8..2122f5b7861d 100644 --- a/docs/modules/deployment/pages/sentinel/runtime/centos-rhel9/install-sentinel.adoc +++ b/docs/modules/deployment/pages/sentinel/runtime/centos-rhel9/install-sentinel.adoc @@ -3,11 +3,11 @@ sudo dnf -y install java-17-openjdk-headless ifeval::["{page-component-title}" == "Horizon"] -include::../../../repos/rhel-centos/horizon-rhel9.adoc[] +include::../../../core/centos/repo-horizon.adoc[] endif::[] ifeval::["{page-component-title}" == "Meridian"] -include::../../../repos/rhel-centos/meridian-rhel9.adoc[] +include::../../../core/centos/repo-meridian.adoc[] endif::[] .Install {page-component-title} Sentinel diff --git a/docs/modules/deployment/pages/upgrade/backup/centos-rhel8/backup-centos-rhel8.adoc b/docs/modules/deployment/pages/upgrade/backup/centos/backup-centos.adoc similarity index 96% rename from docs/modules/deployment/pages/upgrade/backup/centos-rhel8/backup-centos-rhel8.adoc rename to docs/modules/deployment/pages/upgrade/backup/centos/backup-centos.adoc index c88bb1b8becd..a6c8ea954742 100644 --- a/docs/modules/deployment/pages/upgrade/backup/centos-rhel8/backup-centos-rhel8.adoc +++ b/docs/modules/deployment/pages/upgrade/backup/centos/backup-centos.adoc @@ -1,4 +1,4 @@ -[[backup-centos-rhel8]] +[[backup-centos]] .Stop OpenNMS {page-component-title} service [source, console] ---- diff --git a/docs/modules/deployment/pages/upgrade/backup/introduction.adoc b/docs/modules/deployment/pages/upgrade/backup/introduction.adoc index 8b2a38ca3b08..1808ef6d48b9 100644 --- a/docs/modules/deployment/pages/upgrade/backup/introduction.adoc +++ b/docs/modules/deployment/pages/upgrade/backup/introduction.adoc @@ -28,7 +28,7 @@ Please be aware that `/tmp` is not persisted, as most operating systems will del CentOS/RHEL 8:: + -- -include::centos-rhel8/backup-centos-rhel8.adoc[] +include::centos/backup-centos.adoc[] -- ifeval::["{page-component-title}" == "Horizon"] diff --git a/docs/modules/deployment/pages/upgrade/restore/centos-rhel8/restore-centos-rhel8.adoc b/docs/modules/deployment/pages/upgrade/restore/centos/restore-centos.adoc similarity index 89% rename from docs/modules/deployment/pages/upgrade/restore/centos-rhel8/restore-centos-rhel8.adoc rename to docs/modules/deployment/pages/upgrade/restore/centos/restore-centos.adoc index 8846be399114..92c0b411c6a9 100644 --- a/docs/modules/deployment/pages/upgrade/restore/centos-rhel8/restore-centos-rhel8.adoc +++ b/docs/modules/deployment/pages/upgrade/restore/centos/restore-centos.adoc @@ -1,4 +1,4 @@ -[[restore-centos-rhel8]] +[[restore-centos]] .Restore user/group definition [source, console] @@ -38,10 +38,6 @@ See xref:deployment:core/centos/initialize-core.adoc#initialize-core-cap[Assign sudo dnf -y install postgresql-server postgresql ---- -.Change the access policy for PostgreSQL - -See xref:deployment:core/centos-rhel8/postgresql.adoc#core-centos-rhel8-pg_hba[change the access policy for PostgreSQL]. - .Restore OpenNMS database [source, console] ---- diff --git a/docs/modules/deployment/pages/upgrade/restore/introduction.adoc b/docs/modules/deployment/pages/upgrade/restore/introduction.adoc index 7992e439084a..f77883051b72 100644 --- a/docs/modules/deployment/pages/upgrade/restore/introduction.adoc +++ b/docs/modules/deployment/pages/upgrade/restore/introduction.adoc @@ -30,10 +30,10 @@ NOTE: The PostgreSQL link:https://www.postgresql.org/about/news/announcing-apt-a [{tabs}] ==== -CentOS/RHEL 8:: +CentOS/RHEL 9/10:: + -- -include::centos-rhel8/restore-centos-rhel8.adoc[] +include::centos/restore-centos.adoc[] -- ifeval::["{page-component-title}" == "Horizon"]