LDB Node Installation
Overall Installation Steps
The high-level steps for installing and configuring N2ACD LDB nodes are:
- Determine the server(s) that will supply the LDB logical component, bearing in mind the supported operating systems and minimum server requirements. This will generally be a single LDB instance on each individual SVC node.
- Ensure the installation pre-requisites are met.
- Install the LDB package.
- Perform any required post-installation steps.
- Update the LDB configuration as desired.
Installation Pre-requisites
OS-specific Setup
Refer to the specific Red Hat or Debian instructions for any pre-requisites as required.
PostgreSQL Server
The PostgreSQL database server must be installed and configured. Follow the installation procedure for this, noting any prerequisites.
At least version 12 of the PostgreSQL server is required for the N2ACD platform.
In order to perform the database initialisation steps, the PostgreSQL server must be running on the database instance and must be listening and able to be connected to from the command line, i.e. assuming that the PostgreSQL default user is used, this should succeed:
su - postgres
psql
Note that if a DB or RDB instance is to be co-hosted with a LDB instance, a separate PostgreSQL server must be used on a different port for each instance, as described in the database type instructions.
DBMaintain
N2ACD LDB nodes use the third-party tool DBMaintain to manage the database over time.
This tool can be obtained by:
- Installation from the N-Squared RPM repository for Red Hat 8 or Red Hat 7. Contact N-Squared Support to discuss access to this if required.
- Direct download of binaries from the official DBMaintain website.
If you are using an N-Squared packaged installation, DBMaintain will be installed in /usr/share/dbmaintain
.
For direct download, it may be placed in any convenient location. Commands for using DBMaintain are listed below, but
may require updating the path appropriately for your environment.
Java
Usage of the DBMaintain tool requires a JDK or JRE of at least Java 5 to be available on the system. The default Java installation is acceptable in most cases.
To find the local java version, execute:
java -version
If Java is not installed or the version is not at least 5.x
, install a new Java version as follows. The commands to
execute will depend on your operating system type and version.
RHEL 8
On Red Hat Enterprise Linux 8 or similar platforms, execute:
sudo dnf install java-11-openjdk
sudo alternatives --install /usr/bin/java java /usr/java/latest/bin/java 1
sudo alternatives --config java
RHEL 7
On Red Hat Enterprise Linux 7 or similar platforms, execute:
sudo yum install java-11-openjdk
sudo alternatives --install /usr/bin/java java /usr/java/latest/bin/java 1
sudo alternatives --config java
Ubuntu
On Ubuntu or similar platforms, execute:
sudo apt install default-jdk
Installation Steps
Follow the appropriate installation steps depending on your installation sources.
Note that the packages only need to be installed on nodes where a database schema needs to be created and maintained. This will generally only be the primary database instance.
From N-Squared Repository
Execute the instructions specific to your operating system:
RHEL 8 | Other RPM-based Systems | DEB-based Systems |
---|---|---|
dnf install n2acd-ldb |
yum install n2acd-ldb |
apt-get install n2acd-ldb |
As Manual Installation
Transfer the provided package file to the target node, then follow the instructions specific to your operating system.
Execute (adjusting as appropriate for package location and version details) the following:
RPM-based Systems | DEB-based Systems |
---|---|
sudo rpm -Uvh /path/to/n2acd-ldb-M.m.p-b.noarch.rpm |
sudo dpkg -i /path/to/n2acd-ldb_M.m.p-b_all.deb |
Post-Installation Steps
Database Initialisation
N2ACD uses the database maintenance tool DBMaintain to upgrade and manage its database automatically.
N2ACD uses the following (unchangeable) database schemas and users:
- Local data schema:
n2acd
- Database schema owner/user:
n2acd_local
These instructions assume that you will use the following values for N2ACD database storage:
- Database name:
n2in
These values may be modified as required for your installation by updating the installation steps below accordingly.
Database Preparation
The commands in this section must be executed as the OS user that is running the PostgreSQL server. By default, this is
postgres
. These commands all assume that a non-standard database port (5433) is used and that the database server is
on the local host; amend as required for your deployment.
- Create the required user for database administration, runtime data retrieval, and GUI access. You will be prompted to enter a password
export PGHOST=localhost
export PGPORT=5433
createuser -P -l -s n2acd_local
- If the database does not already exist, create it.
export PGHOST=localhost
export PGPORT=5433
createdb -O n2acd_local n2in
- If the database schemas do not already exist, create them.
psql -p 5433 -h localhost n2in
CREATE SCHEMA IF NOT EXISTS audit AUTHORIZATION n2acd_local;
CREATE SCHEMA IF NOT EXISTS n2acd AUTHORIZATION n2acd_local;
\q
- Confirm database login as
n2acd_local
works, and set the schema search path.
psql -p 5433 -h localhost -U n2acd_local n2in
ALTER ROLE n2acd_local SET search_path TO n2acd,public;
\q
Database Creation
Before executing the commands to put the N2ACD local database elements into the database, edit the file:
/usr/share/n2acd/db/localdb/dbmaintain.properties
In the file, locate the following section:
database.url=jdbc:postgresql://REPLACE_WITH_DB_ADDRESS:REPLACE_WITH_DB_PORT/n2in
database.userName=n2acd_local
database.password=REPLACE_WITH_DB_PASSWORD
Update these values to match the commands executed during database preparation.
To automatically install the database elements, execute the following commands:
cd /usr/share/n2acd/db
export DBMAINTAIN_JDBC_DRIVER=/usr/share/dbmaintain/postgresql-42.3.1.jar
/usr/share/dbmaintain/dbmaintain.sh updateDatabase -config servicedb/dbmaintain.properties
cd -
Restart the PostegreSQL service following your normal procedure.
Firewall
The firewall (if any) on the LDB node must be updated to allow:
- Inbound database requests on the listening PostgreSQL port(s).
The exact commands to do this will depend both on the firewall on your platform and also which port(s) are in use. For
example, to allow the non-default PostgreSQL port 5433 when using firewalld
, the commands might be:
firewall-cmd --zone=public --add-port=5433/tcp --permanent
service firewalld restart