Prepare the GAS for DB Sync

Configure GAS/GIP for DB Sync

To configure the GAS for DB Sync:
  1. Open a command line terminal.

  2. Set up the environment:
    • Go to the FGLGWS installation directory and run the envcomp script (envcomp.bat on Windows)
    • Go to the GAS installation directory and run the envas script (envas.bat on Windows)
  3. Set up a general GAS configuration file for DB Sync.

    Copy the default $FGLASDIR/etc/as.xcf to a specific file such as custom-config-dir/dbsync_gas_config.xcf.

    The General GAS configuration file must define the locale for DB Sync programs and the database client settings depending on the type of your database server.
    • DB Sync configuration apps and DB Sync server programs must define a locale with UTF-8 encoding.

      The XCF file templates are prepared to use an XCF resource named res.dbsync.locale to define the locale.

      To specify the locale using UTF-8 encoding, add the res.dbsync.locale resource.

      On Unix/Linux:
      <RESOURCE Id="res.dbsync.locale" Source="INTERNAL">en_US.utf8</RESOURCE>
      On Windows®:
      <RESOURCE Id="res.dbsync.locale" Source="INTERNAL">.fglutf8</RESOURCE>
    • Define the database software client environment settings, in the sections to start applications and services elements:
      • SERVICE_APPLICATION_EXECUTION_COMPONENT
      • WEB_APPLICATION_EXECUTION_COMPONENT

      For example, when using a PostgreSQL database:

      On Unix/Linux, define the res.postgresql.dir resource in the UNX element:
      <RESOURCE Id="res.postgresql.dir" Source="INTERNAL">/var/postgresql</RESOURCE>

      Then define the PGDIR and LD_LIBRARY_PATH environment variables in the *_COMPONENT elements:

      <ENVIRONMENT_VARIABLE Id="PGDIR">$(res.postgresql.dir)</ENVIRONMENT_VARIABLE>
      <ENVIRONMENT_VARIABLE Id="LD_LIBRARY_PATH">$(res.postgresql.dir)/lib</ENVIRONMENT_VARIABLE>
      Note:

      On macOS®, you cannot define the DYLD_LIBRARY_PATH environment variable for security reasons: The PostgreSQL client library must be found from /usr/local/lib synbolic links.

      On Windows, append the directory where the PostgreSQL client library DLL is located, in the PATH environment variable definition in the *_COMPONENT elements:
      <ENVIRONMENT_VARIABLE Id="PATH">$(res.postgresql.dir)\bin;$(res.path)</ENVIRONMENT_VARIABLE>
  4. Start the GAS dispatcher for testing:
    httpdispatch -f custom-config-dir/dbsync_gas_config.xcf
    Note:

    Until the issue GIP-233 is fixed, the custom-config-dir path provided with the -f option to httpdispatch command must be an absolute path.