Installing the collector

The installation of the collector is done by running the install command on the binary. The install process will copy the binary to the correct directory and create a service.

Download the collector binary here.

Install command

  1. Copy the binary to the collector server (location doesn’t matter)
  2. Run the install command from within the directory where the binary is located, using an administrator terminal.
1
  "factry-collector-binary-path" install --token "token"

Example on windows

1
  .\factry-opcua-collector_v1.1.4_windows-x64 install -t "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjgwMDAiLCJleHAiOjI0MzcyMDI0MDcsImdycGMtcG9ydCI6IjgwMDEiLCJpYXQiOjE2NDg4MDI0MDcsImlzcyI6ImZhY3RyeS5pbyIsInJlc3QtcG9ydCI6IjgwMDAiLCJ1dWlkIjoiNjgxZmZiNjQtYjE4Ny0xMWVjLWJlNWYtMDI0MmFjMTgwMDAzIn0.RQlzFoi7I-793-sRIe8bGcQAM5fxQ7lHHkUCVcwxNu8"

Example on linux

1
2
  chmod +x factry-opcua-collector_v1.1.4_linux-x64
  sudo ./factry-opcua-collector_v1.1.4_linux-x64 install -t "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjgwMDAiLCJleHAiOjI0MzcyMDI0MDcsImdycGMtcG9ydCI6IjgwMDEiLCJpYXQiOjE2NDg4MDI0MDcsImlzcyI6ImZhY3RyeS5pbyIsInJlc3QtcG9ydCI6IjgwMDAiLCJ1dWlkIjoiNjgxZmZiNjQtYjE4Ny0xMWVjLWJlNWYtMDI0MmFjMTgwMDAzIn0.RQlzFoi7I-793-sRIe8bGcQAM5fxQ7lHHkUCVcwxNu8"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
Usage:
  opc-ua-collector-v1.1.4 install [flags]

Flags:
  -e, --env stringToString   Environmental value overrides e.g. BATCH_SIZE=200 (default [])
  -h, --help                 help for install
  -i, --installDir string    the directory where the collector will be installed (default "/opt/factry")
  -t, --token string         Collector token
  -u, --user string          The user used to run the service (default "factry-system-user")
  -w, --workDir string       the working directory for the collector (default "/var/opt/factry")

Changing advanced settings after installation

You can change advanced collector settings by editing the collector settings and expanding the advanced settings. If the advanced settings are not available for the installed version of the collector, consider upgrading the collector to a more recent version.

Upgrading the collector

The steps to upgrade the collector are the same as the steps to install the collector .

Generating a token will invalidate the current token, so the collector will not be able to send data until the upgrade is complete. As a result, problems during the upgrade process can potentially cause data loss.

When upgrading from a version of the collector that does not have advanced settings available in the historian, the settings should be recovered from the environment . The environment is overwritten during the upgrade process, so this should be done before upgrading the collector. The variable names will change from UPPER_SNAKE_CASE in the environment to UpperCamelCase in the historian.

Read the release notes of all collector versions between the previously installed version and the upgraded version to find any (breaking) changes in functionality and/or settings of the collector and/or its measurements.

Recovering environment variables before upgrade

Linux

You can find the environment variables in the environment file.
This can be found here: /etc/systemd/system/environments/factry-collector-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (replace the x’s with the collector ID which you can find in the historian).

Windows

  1. Open regedit.
  2. Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  3. Select factry-collector-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (replace the x’s with the collector ID which you can find in the historian).
  4. Right click Environment and select “Modify…”
  5. Take note of the values of all the environment variables, except for API_TOKEN, SERVICE_NAME and WORKING_DIRECTORY.

Configuration

After installation the collector will register itself on the historian server and the collector settings will be ready to be filled in.

Switching to a new collector service

To switch a collector instance in the historian webpage to a new collector service, one needs to
generate a new api token first. Next, use this token to install a new collector service . Finally, delete the previously existing collector service to cleanup the inactive collector service.

Using a new server

One is able to switch from an existing collector service, to a new collector service on a different server. In this case make sure that the necessary TCP ports from the Historian server are reachable by the new collector server.

Deleting a collector

This section describes how to delete a collector service. To delete a collector instance in the Historian webpage as well, one needs to contact Factry support.

The best practice is to re-link a collector instance in the Historian webpage to a new collector service, before deleting the existing collector service.

Delete a collector service

Before deleting a collector service, make sure to stop the collector service first.

To enable data continuity when switching collector services for a collector instance in the Historian webpage, make sure to link the collector instance to a new collector service before deletion.

Example collector service

The service name of the collector is named after it’s uuid in the Historian. The uuid of a collector can be found by selecting the according collector in the Historian webpage and looking at the ID in the collector details on the right side of the screen.

An example uuid and the according collector service name:

1
2
05a094a4-118a-11ed-9351-0242ac1c0003
factry-collector-05a094a4-118a-11ed-9351-0242ac1c0003

Windows service

First, lookup the service name of the collector by clicking on the according collector service in the windows service manager. Stop the service in the service manager before deleting the collector service by executing the following command in a cmd administrator terminal:

1
sc delete "factry-collector-service-name"

Linux service (systemd)

Perform the following commands on a sudo terminal on the linux machine to stop, disable and remove the service from the system daemon:

1
2
3
4
systemctl stop factry-collector-service-name
systemctl disable factry-collector-service-name
rm /etc/systemd/system/factry-collector-service-name.service
systemctl daemon-reload