MongoDB Installation (Prerequisites and Initialization)

Prerequisites - Primary replica set member

These pre-requisites are necessary for the successful deployment of the AspenTech Inmation solution on the primary replica set member.

# Procedure Expected Result

1

Confirm hostname for the Core and MongoDB database server (primary replica set member)

  • D-GXPC-Core

  • D-GXPC-RepA

2

Log into the server, where the Primary MongoDB instance is to be installed with an administrative account using a Remote Desktop console session.

In CMD Shell, type:

MSTSC /v:D-GXPC-RepA

Execute this command by pressing Enter.

Successful login on machine with administrative account.

3

Open Start Menu and type Explorer

Open File Explorer by pressing Enter.

Check the file contents of the installation folder (D:\installation).

Installation Files

The following files exist in the installation folder (D:\installation):

  • AspenTechInmationNodeSetup.exe

  • AspenTechInmationSetup.exe

  • install.ps1

  • keyfile

  • pre-install.ps1

  • pre_install.lua

  • mongodb-windows-x86_64-5.0.x-signed.msi

  • Setup.xml

4

Ensure the security on the files is "Unblocked" by right-clicking on each file, selecting properties and checking the status of security as shown below. (Unblocking, where required, will ensure the setup can run without manual intervention)

Unblock File

Files are unblocked.

5

Ensure that the Setup.xml contains the right settings for the following parameters.

These parameters define the requirements for the instance type being installed (in this case a MongoDB) and will not change between installs on any deployment. Edit and save if necessary.

OfflineInstallMongoDb

1

IntegrateMongoDB

1

LocationMongoDb

D:\installation

InstallConnector

1

InstallServer

0

InstallDataStudio

0

InstallWebApi

0

InstallOpcComponents

0

InstallCore

0

InstallRelay

0

ConfigureFirewall

1

ConnectorActiveComponent

1

IsPrimary

1

IsSecondary1

0

IsSecondary2

0

6

Depending on the server environment (D\Q\P) and its configuration specification the parameters below might be different from one server to another.

If required, consult your Design Specification/Configuration Specification and check the following parameters match in the xml file.

InstanceName

InstallationFolder

CoreHost

CorePort

OverrideObjectName

ServiceName

MongoDbReplicasetPrimaryHost

MongoDbReplicasetPrimaryPort

MongoDbReplicasetSecondaryHost1

MongoDbReplicasetSecondaryPort1

MongoDbReplicasetSecondaryHost2

MongoDbReplicasetSecondaryPort2

MongoDbUserName

MongoDbReplicasetName

RetentionTimeNonGxpDays

RetentionTimeGxpDays

BackupPath

Prerequisites - Secondary replica set members

These pre-requisites are necessary for the successful deployment of the AspenTech Inmation solution on the secondary replica-set members.

# Procedure Expected Result

1

Confirm hostname for this deployment:

  • D-GXPC-Core

  • D-GXPC-RepB

  • D-GXPC-RepC

2

Log into the server, where Secondary MongoDB instances are to be installed with an administrative account using Remote Desktop console session.

In CMD Shell, type:

MSTSC /v:D-GXPC-RepB
MSTSC /v:D-GXPC-RepC

Execute this command by pressing Enter.

Successful login on machines with administrative account.

3

Open Start Menu and type Explorer

Open File Explorer by pressing Enter.

Check the file contents of the installation folder (D:\installation).

Installation Files

The following files exist in the installation folder (D:\installation)

  • AspenTechInmationNodeSetup.exe

  • AspenTechInmationSetup.exe

  • install.ps1

  • keyfile

  • mongodb-windows-x86_64-5.0.x-signed.msi

  • Setup.xml

4

Ensure the security on the files is "Unblocked" by right-clicking on each file, selecting properties and checking the status of security as shown below. (Unblocking, where required, will ensure the setup can run without manual intervention)

Unblock File

Files are unblocked.

5

Ensure that the Setup.xml in the secondary replica set members contains the right settings for the following parameters. Edit and save if necessary.

These parameters define the requirements for the instance type being installed (in this case a MongoDB) and will not change between installs on any deployment.

Param

Secondary 1 server D-GXPC-RepB

Secondary 2 server D-GXPC-RepC

OfflineInstallMongoDb

1

1

IntegrateMongoDB

1

1

LocationMongoDb

D:\installation

D:\installation

InstallConnector

1

1

InstallServer

0

0

InstallDataStudio

0

0

InstallWebApi

0

0

InstallOpcComponents

0

0

InstallCore

0

0

InstallRelay

0

0

ConfigureFirewall

1

1

ConnectorActiveComponent

1

1

IsPrimary

0

0

IsSecondary1

1

0

IsSecondary2

0

1

6

Depending on the server environment (D\Q\P) and its configuration specification the parameters below might be different from one server to another.

If required, consult your Design Specification/Configuration Specification and check that the following parameters match in the xml file.

InstanceName

InstallationFolder

CoreHost

CorePort

OverrideObjectName

ServiceName

MongoDbReplicasetPrimaryHost

MongoDbReplicasetPrimaryPort

MongoDbReplicasetSecondaryHost1

MongoDbReplicasetSecondaryPort1

MongoDbReplicasetSecondaryHost2

MongoDbReplicasetSecondaryPort2

MongoDbUserName

MongoDbReplicasetName

RetentionTimeNonGxpDays

RetentionTimeGxpDays

BackupPath

Initialize Data Stores and Connectors

Some configuration is needed in DataStudio through the scripts before the installation to create the MongoDB set and the Connector objects (it will not be functional at this step).

# Procedure Expected Result

1

Open RDP session to Master-Core

Successful login on machine

2

Open start menu and type DataStudio

Open “AspenTech Inmation DataStudio” by pressing ENTER/RETURN

DataStudio window opens with “Connect to dialog”

3

Use Windows Authentication

Click Ok

Connect to dialog closes. No error message is shown in connection dialog.

4

Optional: When using DataStudio the first time, the “Create new workspace…” dialog appears

Leave proposed name and click Ok

Create new workspace dialog closes

5

In the Menu Bar, click Open and then click on Console

New Console opens in AspenTech Inmation DataStudio

6

Copy the following mass command, using the required hostnames and retention times, to the Console as per the example below (pre-install_master.lua):

(require "esi-deploy"):INIT_MONGODB_PSS({
    PrimaryHost = "D-GXPC-RepA",
    SecondaryHost1 = "D-GXPC-RepB",
    SecondaryHost2 = "D-GXPC-RepC",
    RetentionTimeNonGxpDays = 365,
    RetentionTimeGxpDays = 365
})

-

7

Press F5 to run the command

Pre-install script
  • Three Connector objects are created in the Navigation Tree.

  • Six custom data stores are created in a Data Stores group identified by short code GLOBAL (e.g. Core) beneath the System master.

  • The status of the Connector, the System and the custom data stores objects is bad

Test initial configuration

# Procedure Expected Result

1

Check the MongoDB connection settings in the System object properties. Select the System object then expand the Time Series Data Store in the Object Properties panel. The MongoDB connection settings should be as highlighted below:

mongodb connection settings

Do this for each of the MongoDB Connection sections for the Data Stores (except logging and big table data stores) as shown below

mongodb datastores

The settings for the logging and and big table data stores are as shown below

mongodb logging data store settings

For each Data Store (except logging and big table data stores) the MongoDB Connection settings should match the entries in the pre-install script. Below are the object properties that need to be checked:

  • Connection String reflects the PrimaryHost entry

  • Replication Set Name reflects the replicaSet entry

  • Replica Set 1 reflects the SecondaryHost1 entry

  • Replica Set 2 reflects SecondaryHost2 entry

  • Authentication Mode is set as 'SCRAM-SHA-256'

  • User Name reflects the username setting

  • Password contains a random password generated during the installation phase which is the same for all Data Stores (except Logging and Big Table data stores).

This should be checked for these data stores:

  • Time Series Data Store

  • Event (A&E) Data Store

  • Production Tracking Data Store

  • Custom Data Store

  • File Store

  • Audit Trail Data Store

Below are the object properties that need to be checked for the Logging Data Store:

  • Connection String is set as localhost:27017

  • Authentication Mode is set as No Authentication

2

Check the Connector objects properties. In the I/O Model panel expand the System and then Core and show the three installed connectors.

Select the Object Properties for the Connectors and check the settings as highlighted below.

Data Studio Master Connector Object Properties

The connector properties Object Name (in the Common section) and the Host Name or IP (in the Communication section) reflects the OverrideObjectName and MongoDbReplicasetPrimaryHost / MongoDbReplicasetSecondaryHost1/2 settings respectively in the Setup.xml file.

The next step is to install MongoDB on all replica set members through the scripts. The order of the installation should be to install the secondary members of the replica set first, followed by the primary member of the replica set.