Skip to content

Commit ed26e76

Browse files
authored
misc fixes in packaging (#93)
reformat README a bit add deps in rpm fix post install script update parent pom to pick up new build resources (for generated wrapper script)
1 parent c99c038 commit ed26e76

File tree

4 files changed

+37
-15
lines changed

4 files changed

+37
-15
lines changed

README.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ Metrics Aggregator Daemon
1515
</a>
1616
[![Docker Pulls](https://img.shields.io/docker/pulls/arpnetworking/mad.svg?maxAge=2592000)]()
1717

18-
Aggregates samples into configurable time buckets (e.g. 1 second, 1 minute, etc.) published by metrics client libraries (e.g. [Java](https://github.com/ArpNetworking/metrics-client-java), [NodeJS](https://github.com/ArpNetworking/metrics-client-nodejs), [Ruby](https://github.com/ArpNetworking/metrics-client-ruby), etc.) to compute a variety of statistics. The statistics are reaggregatable and are published together with supporting data to configurable destination(s).
18+
Aggregates samples into configurable time buckets (e.g. 1 second, 1 minute, etc.) published by metrics client libraries
19+
(e.g. [Java](https://github.com/ArpNetworking/metrics-client-java),
20+
[NodeJS](https://github.com/ArpNetworking/metrics-client-nodejs),
21+
[Ruby](https://github.com/ArpNetworking/metrics-client-ruby), etc.) to compute a variety of statistics. The statistics
22+
are reaggregatable and are published together with supporting data to configurable destination(s).
1923

2024

2125
Usage
@@ -24,23 +28,30 @@ Usage
2428
### Installation
2529

2630
#### Manual
27-
The artifacts from the build are in *metrics-aggregator-daemon/target/appassembler* and should be copied to an appropriate directory on your application host(s).
31+
The artifacts from the build are in *metrics-aggregator-daemon/target/appassembler* and should be copied to an
32+
appropriate directory on your application host(s).
2833

2934
#### Docker
30-
If you use Docker, we publish a base docker image that makes it easy for you to layer configuration on top of. Create a Docker image based on the image arpnetworking/mad. Configuration files are typically located at /opt/mad/config/ with pipeline files located at /opt/mad/config/pipelines. In addition, you can specify CONFIG_FILE (defaults to /opt/mad/config/config.json), PARAMS (defaults to $CONFIG_FILE), LOGGING_CONFIG (defaults to "-Dlogback.configurationFile=/opt/mad/config/logback.xml"), and JAVA_OPTS (defaults to $LOGGING_CONFIG) environment variables to control startup.
35+
If you use Docker, we publish a base docker image that makes it easy for you to layer configuration on top of. Create
36+
a Docker image based on the image arpnetworking/mad. Configuration files are typically located at /opt/mad/config/
37+
with pipeline files located at /opt/mad/config/pipelines. In addition, you can specify CONFIG_FILE (defaults to
38+
/opt/mad/config/config.json), PARAMS (defaults to $CONFIG_FILE), LOGGING_CONFIG (defaults to
39+
"-Dlogback.configurationFile=/opt/mad/config/logback.xml"), and JAVA_OPTS (defaults to "") environment variables to
40+
control startup.
3141

3242
### Execution
3343

34-
In the installation's *bin* directory there are scripts to start Metrics Aggregator Daemon: *mad* (Linux) and *mad.bat* (Windows). One of these should be executed on system start with appropriate parameters; for example:
44+
In the installation's *bin* directory there are scripts to start Metrics Aggregator Daemon: *mad* (Linux) and
45+
*mad.bat* (Windows). One of these should be executed on system start with appropriate parameters; for example:
3546

3647
/usr/local/lib/metrics-aggregator-daemon/bin/mad /usr/local/lib/metrics-aggregator-daemon/config/config.json
3748

3849
### Configuration
3950

4051
#### Logging
4152

42-
To customize logging you may provide a [LogBack](http://logback.qos.ch/) configuration file. The project ships with `logback.xml` which
43-
writes logs to rotated files and with `logback-console.xml` which writes logs to STDOUT.
53+
To customize logging you may provide a [LogBack](http://logback.qos.ch/) configuration file. The project ships with
54+
`logback.xml` which writes logs to rotated files and with `logback-console.xml` which writes logs to STDOUT.
4455

4556
Outside of Docker, set the `JAVA_OPTS` environment variable to configure logging:
4657

@@ -54,7 +65,8 @@ Under Docker, set the `LOGBACK_CONFIG` environment variable to configure logging
5465

5566
#### Daemon
5667

57-
The Metrics Aggregator Daemon configuration is specified in a JSON file. The location of the configuration file is passed to *mad* as a command line argument:
68+
The Metrics Aggregator Daemon configuration is specified in a JSON file. The location of the configuration file is
69+
passed to *mad* as a command line argument:
5870

5971
/usr/local/lib/metrics-aggregator-daemon/config/config.json
6072

@@ -102,7 +114,11 @@ For example:
102114

103115
#### Pipelines
104116

105-
One instance of Metrics Aggregator daemon supports multiple independent services on the same host. The most basic single application host still typically configures two services: i) the end-user application running on the host, and ii) the system metrics captured by CollectD. Each of these services is configured as a pipeline in Metrics Aggregator Daemon. The pipeline defines the name of the service, one or more sources of metrics and one more destinations or sinks for the aggregated statistics.
117+
One instance of Metrics Aggregator daemon supports multiple independent services on the same host. The most basic
118+
single application host still typically configures two services: i) the end-user application running on the host,
119+
and ii) the system metrics captured by CollectD. Each of these services is configured as a pipeline in Metrics
120+
Aggregator Daemon. The pipeline defines the name of the service, one or more sources of metrics and one more
121+
destinations or sinks for the aggregated statistics.
106122

107123
For example:
108124

@@ -140,11 +156,13 @@ For example:
140156
}
141157
```
142158

143-
Each of the pipeline configuration files should be placed in the *pipelinesDirectory* defined as part of the daemon configuration above.
159+
Each of the pipeline configuration files should be placed in the *pipelinesDirectory* defined as part of the daemon
160+
configuration above.
144161

145162
#### Hocon
146163

147-
The daemon and pipeline configuration files may be written in [Hocon](https://github.com/typesafehub/config) when specified with a _.conf extension.
164+
The daemon and pipeline configuration files may be written in [Hocon](https://github.com/typesafehub/config) when
165+
specified with a _.conf extension.
148166

149167
### Sources
150168

@@ -297,7 +315,8 @@ To use the local version in your project you must first install it locally:
297315

298316
metrics-aggregator-daemon> ./jdk-wrapper.sh ./mvnw install
299317

300-
You can determine the version of the local build from the pom.xml file. Using the local version is intended only for testing or development.
318+
You can determine the version of the local build from the pom.xml file. Using the local version is intended only for
319+
testing or development.
301320

302321
You may also need to add the local repository to your build in order to pick-up the local version:
303322

pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<parent>
1919
<groupId>com.arpnetworking.build</groupId>
2020
<artifactId>arpnetworking-parent-pom</artifactId>
21-
<version>1.1.4</version>
21+
<version>1.1.5</version>
2222
<relativePath />
2323
</parent>
2424

@@ -761,6 +761,8 @@
761761
</postremoveScriptlet>
762762
<requires>
763763
<require>java &gt;= ${jdk.version}</require>
764+
<require>initscripts</require>
765+
<require>which</require>
764766
</requires>
765767
<mappings>
766768
<mapping>

rpm/scripts/post.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/sbin/chkconfig --add mad
2-
mkdir /opt/mad/logs
2+
mkdir -p /opt/mad/logs
33
chown mad:mad /opt/mad/logs
4-
mkdir /opt/mad/config/pipelines
5-
mkdir /var/run/mad
4+
mkdir -p /opt/mad/config/pipelines
5+
mkdir -p /var/run/mad
66
chown mad:mad /var/run/mad

src/main/docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ENV JVM_XMS="64m"
2424
ENV JVM_XMX="1024m"
2525
ENV LOGBACK_CONFIG="-Dlogback.configurationFile=/opt/mad/config/logback.xml"
2626
ENV MAD_CONFIG="/opt/mad/config/config.conf"
27+
ENV JAVA_OPTS=""
2728

2829
# Build
2930
RUN mkdir -p /opt/mad/lib/ext && \

0 commit comments

Comments
 (0)