This readme defines operational commands for managing instances.
Apache NiFi MiNiFi C++ can be managed through our C2 protocol or through a local interface called the MiNiFi Controller. This feature is disabled by default, and requires to be enabled through the minifi.properties of the agent before using the MiNiFi controller features outlined here. MiNiFi controller is an example implementation of our C2 protocol. This featureset is not intended to replace your Command and Control implementation. Instead it is meant to provide testing and minimal operational capabilities by example.
The MiNiFi controller is an executable in the bin directory that can be used to control the MiNiFi C++ agent while it runs -- utilizing the Command and Control Protocol. Currently the controller will let you stop subcomponents within a running instance, clear queues, get the status of queues, and update the flow for a warm re-deploy. It also provides an option to retrieve the agent manifest json.
This functionality has to enabled in the minifi.properties file with the controller.socket.enable property. The minifi-controller can track a single MiNiFi C++ agent through the use of three options. Port is required. The hostname is not and will default to localhost. Additionally, controller.socket.local.any.interface allows you to bind to any address when using localhost. Otherwise, we will bind only to the loopback adapter so only minifi-controller on the local host can control the agent:
$ controller.socket.enable=true $ controller.socket.host=localhost $ controller.socket.port=9998 $ controller.socket.local.any.interface=true/false (default: false)
These are defined by default to the above values. If the port option is left undefined, the MiNiFi controller will be disabled in your deployment.
The executable is stored in the bin directory and is titled minifi-controller. Available commands are listed below.
To use secure connection for the C2 commands, both the MiNiFi C++ agent and the controller have to be started with either of the following configurations.
To retrieve the SSL configuration properties from the flow config, set the following property to the name of the SSL context service holding the information:
$ controller.ssl.context.service=SSLContextService
Otherwise if you prefer to retrieve the SSL configuration properties from the minifi.properties file set the nifi.remote.input.secure property value to true and configure the security properties in the minifi.properties file.
$ nifi.remote.input.secure=true $ nifi.security.client.certificate=/path/to/cert/mycert.crt $ nifi.security.client.private.key=/path/to/private/key/myprivatekey.key $ nifi.security.client.pass.phrase=passphrase $ nifi.security.client.ca.certificate=/path/to/ca/cert/myrootca.pem
./minifi-controller --host "host name" --port "port"
By default these options use those defined in minifi.properties and are not required
./minifi-controller --start "component name"
./minifi-controller --stop "component name"
./minifi-controller --list connections
./minifi-controller --list components
./minifi-controller --clear "connection name"
./minifi-controller --getsize "connection name"
Returns the size of the connection. The current size along with the max will be reported
./minifi-controller --updateflow "config yml"
Updates the flow file reference and performs a warm re-deploy.
./minifi-controller --getfull
Provides a list of full connections, if any.
./minifi-controller --manifest
Writes the agent manifest json to standard output
./minificontroller --flowstatus "processor:TailFile:health,stats,bulletins"
The command returns the flow status for the specified query in JSON format. The query consists of the query type, the element identifier, and the query options. Each part is separated by the ‘:’ colon character. Multiple query options are specified as a comma-separated list. In some query types the identifier is omitted, in this case only the query type and the query options are specified. Multiple queries can also be specified in a flowStatus command, in this case the queries are separated by the ‘;’ semicolon character. For example: ./minificontroller --flowstatus "processor:TailFile:health,stats,bulletins;processor:LogAttribute:stats"
Supported query types:
To query the processors, use the processor
flag and specify the processor (by ID, name or “all”) followed by one of the processor options. The processor options are below:
An example query to get the health and stats of the “GenerateFlowFile” processor is below.
./minificontroller --flowstatus "processor:GenerateFlowFile:health,stats"
To query the connections, use the connection
flag and specify the connection (by ID, name or “all”) followed by one of the connection options. The connection options are below:
An example query to get the health and stats of the “Connection1” connection is below.
./minificontroller --flowstatus "connection:Connection1:health"
To query the status of the MiNiFi instance, use the instance
flag followed by one of the instance options. The instance options are below.
An example query to get the all the statuses of the instance is below.
./minificontroller --flowstatus "instance:health,stats,bulletins"
To query the system diagnostics, use the systemdiagnostics
flag followed by one of the system diagnostics options. The system diagnostics options are below.
An example query to get the processor stats, content repository usage and FlowFile repository usage from the system diagnostics is below.
./minificontroller --flowStatus "systemdiagnostics:processorstats,contentrepositoryusage,flowfilerepositoryusage"