1. Home
  2. FlexRule Server
  3. Installation
  4. Find your Configuration Files

Find your Configuration Files

◷ Reading Time: 7 minutes

When Configurator has finished the configuration it also creates your Agent and Master configuration file. FlexRule Server has a separate configuration file for each agent and master instance.

Config files

There are two types of configuration files:

  • Agent Configuration File: FlexRule.Server.ExecAgent.exe.config
  • Master Configuration File: FlexRule.Server.Master.exe.config

Adding configuration section

FlexRule Server has a custom configuration section that is enabled by ServerConfigFile.

<configSections>
  <section name="flexrule.server" type="FlexRule.Server.Configurations.ServerConfigFile, FlexRule.Server.Library" requirePermission="false" />
</configSections>

This then allows flexrule.server to be defined in the configuration files.

Agent config

<flexrule.server>
  <settings>
    <add key="AuthSigningKey" value="1234567890_1234567890_1234567890" />
    <add key="MasterAgentSharedSecret" value="this is a shared password between master and agents" />
  </settings>
 
  <agent>
    <add key="GenericLogger" value="FlexRule.Server.Logging.LogFileWriter, FlexRule.Server.Library" />
    <add key="ApiAddress" value="http://192.168.3.9:9002" />
    <add key="MasterAddress" value="http://192.168.3.9:9000" />
    <runtime>
      <add version="*" licenseFile="D:\Pliant Framework\FlexRule\5.4.2\Framework\flexrule.license.lic" />
    </runtime>
  </agent>
</flexrule.server>

settings

  • AuthSigningKey: This is the same key that the Master uses to sign the authentication token.
  • MasterAgentSharedSecret: This is the same key that Master and Agent share to identify each other.

agent

  • ApiAddress: address that the agent will listen to in order to receive requests from its Master server.
  • MasterAddress: the agent’s master server address
runtime

Agent requires the FlexRule Runtime to be installed (which the installer does automatically), but for running the agent and executing logic, it must have the license for FlexRule Runtime. In the runtime section, based on a particular version you can set the path to the license.

  • version: default is * which means any version; otherwise the specific version number.
  • runtime: reference to the license file for FlexRule runtime that allows the Agent to execute logic

Master config

<flexrule.server>
  <settings>
    <add key="MasterEncryptionPassword" value="1234567890" />
    <add key="AuthSigningKey" value="1234567890_1234567890_1234567890" />
    <add key="MasterAgentSharedSecret" value="this is a shared password between master and agents" />
  </settings>
 
  <master>
    <add key="GenericLogger" value="FlexRule.Server.Logging.LogFileWriter, FlexRule.Server.Library" />
    <add key="DbAddress" value="D:\Pliant Framework\Server\Master\databases" />
    <add key="ApiAddress" value="http://192.168.3.9:9000" /> 
    <add key="WorkbenchAddress" value="http://192.168.3.9:9003" />
    <add key="WorkbenchPath" value="..\Workbench\home" />
    <!-- Remove the runtime section below to disable executing logic on Master node -->
    <runtime>
      <add version="*" licenseFile="D:\Pliant Framework\FlexRule\5.4.2\Framework\flexrule.license.lic" />
    </runtime>
  </master>
</flexrule.server>

settings

  • MasterEncryptionPassword: This password is used to encrypt User and Application account information (e.g., password) when they are stored in the database
  • AuthSigningKey: This is the same key that the Agent uses to sign the authentication token.
  • MasterAgentSharedSecret: This is the same key that the Master and Agent share to identify each other.

master

  • DbAddress: Database connection string or path address to the database file.
  • ApiAddress: address that the Master will listen to in order to receive requests from any client in its public API interface.
  • WorkbenchAddress: the Workbench web application address
  • WorkbenchPath: the Workbench web application physical path to its folder.
runtime

Master can be responsible for executing logic on the Master Node, so it needs to have the FlexRule Runtime installed (which the installer does automatically). However, for running the agent and executing logic, it must have the license for FlexRule Runtime. In the runtime section, based on different versions, you can set the path to the license.

  • version: default is * which means any version; otherwise the specific version number.
  • runtime: reference to the license file for FlexRule runtime that allows the Agent to execute logic

It’s better to disable execution on the Master node and just dedicate the Master for management only. This frees up resources on the Master node and lets it dispatch requests to Agents faster.
To disable execution on the Master node, just remove the <runtime> section from the Master config file.

Workbench

To configure your Workbench you need to edit the Workbench configuration file. Workbench has a configuration file under:

[Local Disk]/Program Files (x86)/Pliant Framework/FlexRule Server/<version>/Master/Workbench/FlexRule/Config.jsx

Open the file by using any text editors (e.g., Notepad), then you will be able to change the the masterAddress. During the installation, the default Address is “localhost:.

masterAddress: 'http://localhost:9000'

Monitoring section

Monitoring section allows you to stream events to a channel. It has two sections:

  • Events: allows you to tell what events needs to be captured and be sent to a channel. This is where the tag <add ... /> is used.
  • Channels: allows to define a set of channels that can be instantiated and used to streaming events to them. This is where the tag <channels> is used.

Below is an example:

<monitoring>
  <add event="ExceptionTraceEvent" channel="eventLogListener" level="Error" enable="true" includeDetails="true" prettifyDetails="true"/>
  <add event="ExceptionTraceEvent" channel="fileLogListener" level="Error" enable="true" includeDetails="true" prettifyDetails="true"/>
 
  <channels>
    <add initializeData="D:\Pliant Framework\Server\Agent\agent.log" type="TextWriterTraceListener" name="fileLogListener" />
    <add initializeData="" type="EventLogTraceListener" name="eventLogListener" />
  </channels> 
</monitoring>
Channels

Channels are define with <add ... /> tag in the monitoring section.

<add initializeData="" type="" name="" />

And each channel must specify the below attributes:

  • initializeData: will be used to provide some custom information to the channel.
  • type: will be used to specify the type of channels (look at default channel)
  • name: will be used to reference a channel at Events section

There are some default channels provided. Also custom channels can be created as well. For example to push events to Splunk, Database, etc.

Do disable the monitoring, simply remark (or delete) add tags within the Channels section

Default channels

Out of the box, there are some default channels that are configurable using XML configuration. Below is the list of default channels:

  • TextWriterTraceListener: allows writing on the file
  • EventLogTraceListener: allows writing events on event log
  • ConsoleTraceListener: allows writing events on console output
File-based Channel (TextWriterTraceListener)

When TextWriterTraceListener is used, you can specify name of the file as a constant value. For example master.log or you can parameterised name of the file by below values:

  • {processid}: specify the process id of operating system that is writing in the file
  • {machineid}: specify machine id of the server that process is running on
  • {guid}: specify a new name every time

Example:

<add initializeData="master-{processid}.log" type="TextWriterTraceListener" name="fileLogListener" />
Updated on September 27, 2022

Was this article helpful?

Related Articles