Skip to content

Commit bbadc49

Browse files
committed
Add MCAC to images
1 parent 6adf8ad commit bbadc49

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

Dockerfile-3_11

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ ENV TINI_VERSION v0.18.0
1212
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
1313
RUN chmod +x /tini
1414

15+
ENV MCAC_VERSION 0.1.2
16+
ADD https://github.com/datastax/metric-collector-for-apache-cassandra/releases/download/v${MCAC_VERSION}/datastax-mcac-agent-${MCAC_VERSION}.tar.gz /opt/mcac-agent.tar.gz
17+
RUN mkdir /opt/mcac-agent && tar zxvf /opt/mcac-agent.tar.gz -C /opt/mcac-agent --strip-components 1 && rm /opt/mcac-agent.tar.gz
18+
1519
# backwards compat with upstream ENTRYPOINT
1620
COPY scripts/docker-entrypoint.sh /usr/local/bin/
1721
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \

Dockerfile-4_0

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ ENV TINI_VERSION v0.18.0
1212
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
1313
RUN chmod +x /tini
1414

15+
ENV MCAC_VERSION 0.1.2
16+
ADD https://github.com/datastax/metric-collector-for-apache-cassandra/releases/download/v${MCAC_VERSION}/datastax-mcac-agent-${MCAC_VERSION}.tar.gz /opt/mcac-agent
17+
1518
# backwards compat with upstream ENTRYPOINT
1619
COPY scripts/docker-entrypoint.sh /usr/local/bin/
1720
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \

scripts/docker-entrypoint.sh

+11-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ if [ "$1" = 'mgmtapi' ]; then
5454
# 1. configbuilder will overwrite the cassandra-env-sh, so we don't want to set this after
5555
# 2. We don't wan't operator or configbuilder to care so much about the version number or
5656
# the fact this jar even exists.
57+
58+
if ! grep -qxF "JVM_OPTS=\"\$JVM_OPTS -javaagent:/opt/mcac-agent/lib/datastax-mcac-agent.jar\"" < /etc/cassandra/cassandra-env.sh ; then
59+
# ensure newline at end of file
60+
echo "" >> /etc/cassandra/cassandra-env.sh
61+
echo "JVM_OPTS=\"\$JVM_OPTS -javaagent:/opt/mcac-agent/lib/datastax-mcac-agent.jar\"" >> /etc/cassandra/cassandra-env.sh
62+
63+
echo "" >> /opt/mcac-agent/config/metric-collector.yaml
64+
echo "data_dir_max_size_in_mb: 100" >> /opt/mcac-agent/config/metric-collector.yaml
65+
fi
66+
5767
if ! grep -qxF "JVM_OPTS=\"\$JVM_OPTS -javaagent:/etc/cassandra/datastax-mgmtapi-agent-0.1.0-SNAPSHOT.jar\"" < /etc/cassandra/cassandra-env.sh ; then
5868
# ensure newline at end of file
5969
echo "" >> /etc/cassandra/cassandra-env.sh
@@ -63,7 +73,7 @@ if [ "$1" = 'mgmtapi' ]; then
6373
CASSANDRA_RPC_ADDRESS='0.0.0.0'
6474
CASSANDRA_BROADCAST_RPC_ADDRESS="$(_ip_address)"
6575

66-
# Not needed as the operator will set all this but leaving for testing
76+
# Not needed as the operator will set all this but leaving for testing
6777
for yaml in \
6878
cluster_name \
6979
endpoint_snitch \

0 commit comments

Comments
 (0)