Skip to content

Advanced Deployment Spec Syntax

Andrew Grande edited this page Apr 28, 2016 · 1 revision

Referenced Controller Services

Consider the following deployment specification:

  1. Postgres Pool is a controller service defined in the dbtest.xml template. Pro Tip: use NiFi Template Inspector to generate these for you and adjust only what needs to change!

  2. Note how we override the DB url and driver location to match our deployment environment (instead of what was put in the template).

  3. Finally, the Execute SQL component needs a DB connection pool service to operate, which we provide as a reference ${Postgres Pool}. This is the name of the controller service we have just reconfigured.

nifi:
  templateUri: file:./dbtest.xml
  templateName: dbtest
  url: http://localhost:8080
  undeploy:
    templates:
      - dbtest
    processGroups:
      - db service
    controllerServices:
      - Postgres Pool

controllerServices:
  Postgres Pool:
    state: ENABLED
    config:
      Database Connection URL: jdbc:postgresql://postgres/postgres
      Database Driver Jar Url: file:///opt/postgresql-9.4.1208.jre7.jar
processGroups:
  db service:
    processors:
      ExecuteSQL:
        config:
          Database Connection Pooling Service: ${Postgres Pool}

Clone this wiki locally