-
Notifications
You must be signed in to change notification settings - Fork 51
Multi Instance Installation Steps for openHistorian
These steps enable multiple openHistorian Windows service instances to run on the same machine. Note that the first openHistorian instance can optionally be installed normally using the installer, i.e., openHistorianSetup.msi
, then these instructions can be followed for each other instance ensuring that the new instances use unique ports, service names and install locations. For full control of the deployment details, use these instructions for each instance.
-
(Optional) Create a Windows Group Managed Service Account (MSA) for each openHistorian instance. An MSA account may be required when openHistorian should access external resources, e.g., a remote database or using remote archive locations.
-
For each openHistorian instance, define names for each of these placeholders:
Item Placeholder Examples Managed service account (optional) {MSA}
OH\MSA_INST1
,OH\MSA_INST2
Name of the openHistorian instance {NAME}
OpenHistorian-Instance1
,OpenHistorian-Instance2
Description for the openHistorian instance {DESCRIPTION}
openHistorian instance 1 that archives time-series data
SQL Server name and instance {SQLSERVER}
localhost\SQLEXPRESS
SQL database name {DBNAME}
OpenHistorian-Inst1
,OpenHistorian-Inst2
Port number for the low-level data channel (e.g., 38400-38499) {DATAPORT}
38402
,38403
Port number for the web host (e.g., 8180-8199) {WEBPORT}
8180
,8190
Port number for the remoting host (e.g., 8510-8529) {REMOTEPORT}
8510
,8511
Port number for STTP (e.g., 7175-7299) {STTPPORT}
7175
,7275
Port number for STTPS (e.g., 7177-7299) {STTPSPORT}
7177
,7277
Port number for GEP (e.g., 6175-6299) {GEPPORT}
6175
,6275
Port number for hosted Grafana (e.g., 8185-8199) {GRAFANAPORT}
8185
,8195
The ports listed above are considered "primary" services, however, there are other ports for lesser used services as well. When one or more instances of the openHistorian are configured to use the same service ports, the service for that port will only be available on the openHistorian that starts first. To change "all" relevant ports, see the full port listing and follow similar instructions for updating ports numbers as found below.
We cannot use the packaged openHistorian installer because we need to customize the Windows service details. Download the openHistorian binaries from Grid Protection Alliance's GitHub page:
-
Go to https://www.gridprotectionalliance.org/NightlyBuilds/openHistorian/Beta/
-
Download
openHistorian.Binaries.zip
-
Right-click on the downloaded zip file, choose Properties, and select
Unblock
. This will unblock the DLLs in Windows and enables the .NET runtime to load assemblies. -
Extract the contents of the unblocked zip file into a temporary folder.
-
Create a new (empty) folder within
C:\Program Files\
for the openHistorian instance. Assign{NAME}
as the folder name (see prerequisites). Example:C:\Program Files\OpenHistorian-Inst2
. -
Return to the temporary folder that contains the extracted binaries and open the
\Applications\openHistorian
subfolder. -
Copy the contents of the
openHistorian
subfolder into theC:\Program Files\{NAME}
folder.
-
Open Windows Command Prompt in administrator mode (Start > type "Command Prompt" > right-click on the Command Prompt icon > choose "Run as Administrator").
-
Enter this statement and replace the placeholders:
sc create "{NAME}" binPath="\"C:\Program Files\{NAME}\openHistorian.exe\" -nomutex -runasservice"
Example:
sc create "OpenHistorian-Instance2" binPath= "\"C:\Program Files\OpenHistorian-Inst2\openHistorian.exe\" -nomutex -runasservice"
-
Enter this statement and replace the placeholders:
sc description "{NAME}" "{DESCRIPTION}"
Example:
sc description "OpenHistorian-Instance2" "openHistorian instance 2 that archives time-series data"
-
Verify that both statements return a success message.
-
Open Windows Services (Start > type "Services") and locate the newly-created openHistorian service in the list.
-
Right-click on the openHistorian service and choose Properties.
-
On the General tab, set the startup type to
Automatic
. -
On the Log On tab, apply the credentials:
For MSA accounts:
- Use the following account name:
{MSA}$
(the$
is required!) - Password: clear the box (MSAs do not have passwords)
For all else:
- Verify
Local System account
is selected
- Use the following account name:
-
In File Explorer, go to
C:\Program Files
, right-click on the custom-named openHistorian folder ({NAME}
), and choose Properties > Security > Edit > Add... -
Choose "Service Accounts" on the Object Types, and enter the MSA name (
{MSA}
) without the$
. -
Set the MSA permissions to allow "Full control".
The following instructions assume openHistorian configuration database is for SQL Server, see the "Using the Configuration Setup Utility" wiki-page for other databases. Note that if the target database system is under configuration control, this utility may need to be run by a DBA.
Right-click on ConfigurationSetupUtility.exe
(found in C:\Program Files\{NAME}
) and choose "Run as administrator".
Set up new configuration > Database
Set up a database
- Choose "SQL Server"
- Uncheck "Run sample data script"
- Uncheck "Run audit log trigger scripts"
Set up a SQL Server database
- Host name:
{SQLSERVER}
(see prerequisites) - Database name:
{DBNAME}
(see prerequisites) - Check "Use integrated security"
Apply configuration changes
- Check "openHistorian Windows service"
- Check "openHistorian Manager (local application)"
- Check "Setup / change primary historian"
Set up primary historian
- Select "openHistorian 2.0 (Local)" as the adapter
Set up historian connection string
- DataChannel: change the port number to
{DATAPORT}
(see prerequisites).This is the port that openHistorian will listen on (low-level non-secure socket). Default port is
38402
- each openHistorian service instance will need to operate with a unique port.
Continue clicking Next until you get to the final screen. On the last screen, uncheck both "Start the openHistorian" and "Start openHistorian Manager" and then click Finish.
Open openHistorian.exe.config
found in C:\Program Files\{NAME}
.
-
Go to "configuration" > "categorizedSettings" > "systemSettings" > "WebHostURL"
-
Change the WebHostURL port number:
<add name="WebHostURL" value="http://+:{WEBPORT}" .../>
Example:
<add name="WebHostURL" value="http://+:8190" .../>
-
Go to "configuration" > "categorizedSettings" > "remotingServer" > "ConfigurationString"
-
Change the ConfigurationString port number:
<add name="ConfigurationString" value="Port={REMOTEPORT}" .../>
Example:
<add name="ConfigurationString" value="Port=8511" .../>
-
Go to "configuration" > "categorizedSettings" > "sttpdatapublisher" > "ConfigurationString"
-
Change the ConfigurationString port number:
<add name="ConfigurationString" value="Port={STTPPORT}" .../>
Example:
<add name="ConfigurationString" value="Port=7275" .../>
-
Go to "configuration" > "categorizedSettings" > "sttpsdatapublisher" > "ConfigurationString"
-
Change the ConfigurationString port number:
<add name="ConfigurationString" value="Port={STTPSPORT}" .../>
Example:
<add name="ConfigurationString" value="Port=7277" .../>
-
Go to "configuration" > "categorizedSettings" > "internaldatapublisher" > "ConfigurationString"
-
Change the ConfigurationString port number:
<add name="ConfigurationString" value="Port={GEPPORT}" .../>
Example:
<add name="ConfigurationString" value="Port=6275" .../>
-
Go to "configuration" > "categorizedSettings" > "grafanaHosting" > "HostedURL"
-
Change the HostedURL port number:
<add name="HostedURL" value="http://localhost:{GRAFANAPORT}" .../>
Example:
<add name="HostedURL" value="http://localhost:8195" .../>
Save openHistorian.exe.config
in C:\Program Files\{NAME}
, replacing the original file.
Note that saving file may require administrator privileges.
Open custom.ini
found in C:\Program Files\{NAME}\Grafana\conf
.
-
Go to "[server]" > "http_port"
-
Change the http_port number:
http_port = {GRAFANAPORT}
Example:
http_port = 8195
-
Go to "[server]" > "root_url"
-
Change the root_url web port number (leave
${HOSTNAME}
as-is):
root_url = http://${HOSTNAME}:{WEBPORT}/grafana/
Example:
root_url = http://${HOSTNAME}:8190/grafana/
Save custom.ini
in C:\Program Files\{NAME}\Grafana\conf
, replacing the original file.
Note that saving file may require administrator privileges.
Open openHistorianConsole.exe.config
found in C:\Program Files\{NAME}
.
-
Go to "configuration" > "categorizedSettings" > "remotingClient" > "ConfigurationString"
-
Change the ConfigurationString port number:
<add name="ConnectionString" value="Server=localhost:{REMOTEPORT}" .../>
Example:
<add name="ConnectionString" value="Server=localhost:8511" .../>
Save openHistorianConsole.exe.config
and place it in C:\Program Files\{NAME}
, replacing the original file.
-
Open Windows Firewall > Allow app or feature > Change settings > Allow another app...
- Choose
C:\Program Files\{NAME}\openHistorian.exe
- Check the "Domain" box for the newly-added openHistorian entry
- Choose
-
When using an MSA account, open Windows Command Prompt in administrator mode and run this command, substituting
{WEBPORT}
and{MSA}
with the correct values:netsh http add urlacl http://+:{WEBPORT}/ user="{MSA}$"
Example:
netsh http add urlacl http://+:8183/ user="OH\MSA_INST2$"
This grants permission for the MSA to run an HTTP service on the specified port.
-
Open "Windows Services" > select the newly-installed openHistorian service instance (
{NAME}
) and choose Start. -
Run
openHistorianConsole.exe
, which is found inC:\Program Files\{NAME}
, and verify that it connects successfully. -
Open a web browser and navigate to
http://localhost:{WEBPORT}
to verify proper operation.
-
Run the instance specific openHistorian Manager application found in the found in
C:\Program Files\{NAME}
-
Navigate to
System > Manage Nodes
from the manager menu -
Update the
Settings
string as follows:
RemoteStatusServerConnectionString={server=localhost:{REMOTEPORT}; integratedSecurity=true}; dataPublisherPort={GEPPORT}
Example:
RemoteStatusServerConnectionString={server=localhost:8511; integratedSecurity=true}; dataPublisherPort=6275