Skip to content

Preparing to Install the Agents

When using the SQL Agent, the code that actually interacts with the SQL Server database is custom code that is generated from Synergy repository definitions of your application data files by CodeGen.

Similarly, when using the JSON Agent, the code that parses the DBL record data so that it can be serialized to JSON is also custom generated code.

The Streaming Integration Platform Developers Kit provides four CodeGen templates:

  • SQLHelper.tpl
  • MultiRecordHelperFILE.tpl
  • MultiRecordHelperSQL.tpl
  • RecordHelper.tpl

You must use CodeGen to produce code based on those templates for each of your data files. The developers kit also provides two sample batch files that contain the necessary environment and CodeGen commands.

  • make-recordhelpers.bat
  • make-tablehelpers.bat

Once you have generated the code you must then compile it into two .NET Class Libraries, one for the JSON agent and one for the SQL Agent, and provision them, along with several other dependency assemblues, on the system that will host the JSON andSQL Agents.

Deploying the custom code generally involves:

  1. Installing the .NET helper assemblies and dependencies into a directory on the host system.
  2. Setting appropriate file permissions and ACLs to allow the SQL Agent to access the file.
  3. Declaring the file to the agent using the JSONAgent.HelperAssembly and SQLAgent.HelperAssembly properties in MasterConfig.json.

These steps should ideally be completed before installing the agents, as the agent installations attempt to start the agent services, and they will fail to start if the helper assemblies can't be loaded.

For the purpose of the workshop you have already configured the path to the helper assemblies, and you have been provided with an appropriately built helper assemblies in your ~/installers directory. What remains is to install the assemblies to the correct location, and set appropriate file protections and ACLs so that the agents can load them.

Execute these commands to deploy the helper assemblies and dependencies

Create the helpers directory

sudo install -d -o admin -g sip-service -m 2750 /home/admin/helpers
Allow the service account to traverse /home/admin:
sudo setfacl -m "u:sip-service:--x" /home/admin
Deploy the assemblies using install, not mv:
sudo install -o admin -g "sip-service" -m 0640 ~/installers/DataModels.dll ~/helpers
sudo install -o admin -g "sip-service" -m 0640 ~/installers/HelpersCS.dll ~/helpers
sudo install -o admin -g "sip-service" -m 0640 ~/installers/HelpersDBL.dll ~/helpers
sudo install -o admin -g "sip-service" -m 0640 ~/installers/RecordHelpers.dll ~/helpers
sudo install -o admin -g "sip-service" -m 0640 ~/installers/RecordHelperTools.dll ~/helpers
sudo install -o admin -g "sip-service" -m 0640 ~/installers/SQLTableHelpers.dll ~/helpers
Set directory ACLs and defaults:
sudo setfacl -m "u:sip-service:r-x" /home/admin/helpers
sudo setfacl -m 'd:u::rwx,d:g::r-x,d:m::r-x,d:o::---' /home/admin/helpers

SELinux

SELinux is not active on the workshop system. If it were, it would be necessary to also apply SELinux labels to allow the access:

sudo semanage fcontext -a -e /usr/lib/synergex/sip /home/admin/helpers
sudo restorecon -Rv /home/admin/helpers

If the SELinux rule already exists, use -m instead of -a. Persistent semanage fcontext rules followed by restorecon are the standard RHEL approach.