cookbook 'flume_agent', '~> 1.3.1'
flume_agent (12) Versions 1.3.1 Follow2
A cookbook used to set up a Flume agent.
cookbook 'flume_agent', '~> 1.3.1', :supermarket
knife supermarket install flume_agent
knife supermarket download flume_agent
Description
Provides a mechanism for installing a Flume agent.
Compatability
As of version 1.2, this has been validated to work on Chef 12.5.1.
Providers
The following are a list of provided actions supplied by this cookbook.
Create
This provider is enabled using the :create action. It will install a Flume agent of your choosing. An example invocation might look like:
<pre>
Install the Flume agent
flume_agent "my-agent" do
action :create
userName "flume"
userGroup "flume"
agentName "my-agent"
postStartupScript do
cookbook_filename "startup_hook_script.sh.erb"
end
loggingProperties do
cookbook_filename "flume.log4j.properties.erb"
end
configFile do
cookbook_filename "flume.properties.erb"
variables(:my-arg => "a", :my-arg2 => "b")
end
flumePlugin "my-flume-plugin" do
file "/usr/share/flume/my-flume-plugin.tar.gz"
end
flumeEnv do
cookbook_filename "my-flume-env.sh.erb"
end
jmx do
port 1234
end
rmLib "guava-10.0.1.jar"
end
</pre>
This takes, at a minimum, four parameters:
- userName: The name of the user under which this installation is to occur
- userGroup: The group to which the installation is to be long
- agentName: The name of the agent to be installed
- configFile: The configuration file to be used to direct the behavior of the Flume agent. This is described in further detail below.
Optionally, you may also specify the following parameters:
- flumeArchiveUrl: The URL link to the Flume binaries used to set up the runtime environment.
Configuration Providers
Nested within the provider are configuration elements that contain their own parameters.
configFile
This is a required element of your provider configuration. It tells Flume how to configure the agent it is going to install and start. It accepts the following parameters:
- cookbook_filename: The name of the file stored in the cookbook to be copied (as a template)
- cookbook: (optional) The name of the cookbook from which the file is to be copied; defaults to the cookbook calling the provider
- variables: (optional) A hash of variables to be provided to the copied agent configuration file.
loggingProperties
Flume provides its own default logging configuration, but, if you so choose, you can provide your own log configuration. This should be a log4j configuration file. It accepts the following parameters:
- cookbook_filename: The name of the file stored in the cookbook to be copied (as a template)
- cookbook: (optional) The name of the cookbook from which the file is to be copied; defaults to the cookbook calling the provider
- variables: (optional) A hash of variables to be provided to the copied logging properties file.
flumePlugin
Flume supports a style of packaging up libraries to be provided as "plugins" to the Flume installation. Refer to the Flume documentation for more details on the exact packaging contents. This cookbook expects all plugins to be packaged as a .tar.gz file.
At minimum, one of the following sources must be provided:
- url: A URL from which the .tar.gz file will be downloaded.
- file: A location on the local disk from which the .tar.gz file will be copied
-
cookbook_filename: The name of a cookbook file that will be copied as the .tar.gz file.
- Optionally, the cookbook parameter can be specified here to identify which cookbook the file should be copied. If not specified, it will be the name of the cookbook calling the provider.
The expected format of the provided Flume plugin bundle follows:
my-project-1.0-my-plugin-flume-plugin.tar.gz
|
+- name-of-my-plugin
|
+- lib/
| |
| +- my-lib.jar
+- libext/
|
+- a.jar
+- b.jar
flumeEnv
Use this element to provide a <tt>flume-env.sh</tt> file template to be copied into the Flume installation. It takes the following parameters:
- cookbook_filename: The name of the file stored in the cookbook to be copied (as a template)
- cookbook: (optional) The name of the cookbook from which the file is to be copied; defaults to the cookbook calling the provider
- variables: (optional) A hash of variables to be provided to the copied logging properties file.
postStartupScript
Starting with version 1.0.7 of this cookbook, the provider now provides a hook allowing consumers to specify a shell script to be executed following the startup of the agent. This allows the injection of, for example, the execution of a health check to ensure that the agent is available. It takes the following parameters:
- cookbook_filename: The name of the file stored in the cookbook to be copied (as a template)
- cookbook: (optional) The name of the cookbook from which the file is to be copied; defaults to the cookbook calling the provider
- variables: (optional) A hash of variables to be provided to the copied script
jmx
This block enables JMX reporting of the behavior of the agent. It takes the following parameter:
- port: The port on which the agent will publish its JMX statistics.
rmLib
(since 1.1) Flume plugins do not get loaded in classloaders isolated from the main classpath of the Flume agent; as a result, dependency convergence issues can arise (such as Guava incompatibilities). To help with this, the option is given as part of this cookbook to have it remove libraries from lib/
directory beneath the Flume installation directory.
Registered service
With this command, the agent will also install an /etc/init.d/ script following the pattern of "/etc/init.d/flume_<agentName>". It supports the following commands:
- start
- stop
- restart
- status
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
1.3.1 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.3.1 failed this metric
FC064: Ensure issues_url is set in metadata: flume_agent/metadata.rb:1
FC065: Ensure source_url is set in metadata: flume_agent/metadata.rb:1
FC066: Ensure chef_version is set in metadata: flume_agent/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: flume_agent/metadata.rb:1
FC069: Ensure standardized license defined in metadata: flume_agent/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: flume_agent/resources/default.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.3.1 passed this metric
Testing File Metric
1.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.3.1 failed this metric
1.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.3.1 failed this metric
FC064: Ensure issues_url is set in metadata: flume_agent/metadata.rb:1
FC065: Ensure source_url is set in metadata: flume_agent/metadata.rb:1
FC066: Ensure chef_version is set in metadata: flume_agent/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: flume_agent/metadata.rb:1
FC069: Ensure standardized license defined in metadata: flume_agent/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: flume_agent/resources/default.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.3.1 passed this metric
Testing File Metric
1.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.3.1 failed this metric
FC065: Ensure source_url is set in metadata: flume_agent/metadata.rb:1
FC066: Ensure chef_version is set in metadata: flume_agent/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: flume_agent/metadata.rb:1
FC069: Ensure standardized license defined in metadata: flume_agent/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: flume_agent/resources/default.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
1.3.1 passed this metric
Testing File Metric
1.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.3.1 failed this metric
1.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number