Pular para o conteúdo principal

Set up the PI AF extractor

The Cognite PI AF extractor is distributed as a Windows installer (.msi file). When you run the .msi file, a setup wizard guides you through the installation process. The installer creates a Windows service and installs the binary files needed to run the extractor.

Before you start

  1. Check the server requirements for the PI AF extractor.

  2. Make sure the PI AF extractor has the following access capabilities in a Cognite Data Fusion (CDF) project:

    • raw:read , raw:list, and raw:write

    • extractionpipelines:read and extractionruns:write if you've configured an extraction pipeline.

    • groups:list and projects:list

Tip

You can use OpenID Connect and your existing identity provider (IdP) framework to manage access to CDF data securely. Read more.

  1. Set up a Windows Update schedule. Note that the update may reboot the machine, causing extractor downtime.

Install and configure the extractor

  1. Navigate to Data management > Integrate > Extractors and download and run the latest PI AF Extractor .msi file.

  2. Create a working directory.

    Modify permissions

    Set Modify permission under Properties in the installation folder to avoid permission issues.

  3. Create a config directory inside the working directory and create a configuration file according to the configuration settings. The file must be in YAML format.

Run as a Windows service

  1. Start PI AF Extractor service from Windows services.

  2. Verify that the service is running.

Running the Windows service
  1. Open Properties for the service and set Startup type to Automatic (Delayed Start):
Properties in the Windows service
  1. Verify that the extractor is running. If you've configured the extractor to log messages to a file, check the log files in the configured path, for instance, logs/log.txt.

    If you haven't configured the extractor to read updates, it terminates after one reading. Check any error messages in the log to verify a successful run.

Run from a command line

You can run the extractor from a command line with these arguments:

ArgumentDescription
--hostInsert the PI server's host name or IP address.
--usernameInsert the PI server's Windows username.
--passwordInsert the PI server's Windows password.
--elements-querySpecify the query parameter for PI AF elements.
-s|--serviceLaunch the extractor as a service. You must specify this parameter if you've configured a Windows service for the extractor. Running this from the command line only won't work.
-f |--config-fileSet the path to the configuration file.
-l|--log-levelSet the console log-level: [fatal/error/warning/information/debug/verbose]
-w|--working-dirSet the working directory for the extractor. The default value is the current directory for a stand-alone file or one level above the executable file for the service version.
--log-dirSet the path to the log files to log to files unless you've already set the Logger configuration parameters.
-?|-h+|--helpEnter to show this information.

Upgrade the extractor

Download and run the .msi file for the new version of the extractor. The installer detects the current installation directory, updates the software, and keeps the configuration as-is. The sample configuration file is a part of the software package and is overwritten during an extractor upgrade.

  1. Download the PI AF extractor .msi file from CDF.

  2. Take note of the installed version in case of a rollback and of the service properties in the Properties dialog.

    RESETTING CUSTOM SERVICE PROPERTIES

    During the upgrade, the installer resets all custom service properties to their default values, such as the service recovery settings.

  3. Run the installer.

  4. Update the custom service properties you noted in step 2.

  5. Verify that the extractor is running and that the version displayed in the Starting PI Extractor logline matches the upgraded version.

Uninstall the extractor

  1. Run the installer, select Remove the extractor or open Add or remove programs from the Windows Control Panel.
  2. Remove the Cognite PI AF extractor.
  3. Optionally, remove the installation directory with the configuration file and logs.
  4. Optionally, delete the .msi file.