提交 35905a04 编写于 作者: J jiajingbin

finish all dockerfile

上级 e111ba2e
......@@ -2,11 +2,15 @@ FROM ubuntu:20.04
ENV REFRESHED_AT 2021-12-05
WORKDIR /root
ARG DEBIAN_FRONTEND=noninteractive
COPY node_exporter-1.3.0.linux-amd64.tar.gz /root/node_exporter-1.3.0.linux-amd64.tar.gz
RUN set -ex; \
apt update -y --fix-missing && \
apt-get install -y --no-install-recommends wget && \
wget http://39.105.163.10:9000/node_exporter-1.3.0.linux-amd64.tar.gz && \
tar -xvf node_exporter-1.3.0.linux-amd64.tar.gz && \
mv node_exporter-1.3.0.linux-amd64/node_exporter /usr/bin/node_exporter && \
rm -rf node_exporter-1.3.0.linux-amd64 node_exporter-1.3.0.linux-amd64.tar.gz
rm -rf node_exporter-1.3.0.linux-amd64 node_exporter-1.3.0.linux-amd64.tar.gz &&\
apt remove -y wget && \
rm -rf /var/lib/apt/lists/*
COPY entrypoint.sh /entrypoint.sh
ENV NodeExporterHostname localhost
ENV NodeExporterInterval 10
......
FROM ubuntu:20.04
ENV REFRESHED_AT 2021-12-06
WORKDIR /root
ARG DEBIAN_FRONTEND=noninteractive
RUN set -ex; \
apt update -y --fix-missing && \
apt-get install -y --no-install-recommends nodejs devscripts debhelper wget netcat-traditional && \
wget http://39.105.163.10:9000/statsd.tar.gz && \
tar -xvf statsd.tar.gz && \
rm -rf statsd.tar.gz && \
apt remove -y wget && \
rm -rf /var/lib/apt/lists/*
COPY config.js /root/statsd/config.js
COPY entrypoint.sh /entrypoint.sh
ENV TaosadapterIp 127.0.0.1
ENV TaosadapterPort 6044
ENTRYPOINT ["/entrypoint.sh"]
/*
Graphite Required Variable:
(Leave this unset to avoid sending stats to Graphite.
Set debug flag and leave this unset to run in 'dry' debug mode -
useful for testing statsd clients without a Graphite server.)
graphiteHost: hostname or IP of Graphite server
Optional Variables:
graphitePort: port for the graphite text collector [default: 2003]
graphitePicklePort: port for the graphite pickle collector [default: 2004]
graphiteProtocol: either 'text' or 'pickle' [default: 'text']
backends: an array of backends to load. Each backend must exist
by name in the directory backends/. If not specified,
the default graphite backend will be loaded.
* example for console and graphite:
[ "./backends/console", "./backends/graphite" ]
servers: an array of server configurations.
If not specified, the server, address,
address_ipv6, and port top-level configuration
options are used to configure a single server for
backwards-compatibility
Each server configuration supports the following keys:
server: the server to load. The server must exist by name in the directory
servers/. If not specified, the default udp server will be loaded.
* example for tcp server:
"./servers/tcp"
address: address to listen on [default: 0.0.0.0]
address_ipv6: defines if the address is an IPv4 or IPv6 address [true or false, default: false]
port: port to listen for messages on [default: 8125]
socket: (only for tcp servers) path to unix domain socket which will be used to receive
metrics [default: undefinded]
socket_mod: (only for tcp servers) file mode which should be applied to unix domain socket, relevant
only if socket option is used [default: undefined]
debug: debug flag [default: false]
mgmt_address: address to run the management TCP interface on
[default: 0.0.0.0]
mgmt_port: port to run the management TCP interface on [default: 8126]
title: Allows for overriding the process title. [default: statsd]
if set to false, will not override the process title and let the OS set it.
The length of the title has to be less than or equal to the binary name + cli arguments
NOTE: This does not work on Mac's with node versions prior to v0.10
healthStatus: default health status to be returned and statsd process starts ['up' or 'down', default: 'up']
dumpMessages: log all incoming messages
flushInterval: interval (in ms) to flush metrics to each backend
percentThreshold: for time information, calculate the Nth percentile(s)
(can be a single value or list of floating-point values)
negative values mean to use "top" Nth percentile(s) values
[%, default: 90]
flush_counts: send stats_counts metrics [default: true]
keyFlush: log the most frequently sent keys [object, default: undefined]
interval: how often to log frequent keys [ms, default: 0]
percent: percentage of frequent keys to log [%, default: 100]
log: location of log file for frequent keys [default: STDOUT]
deleteIdleStats: don't send values to graphite for inactive counters, sets, gauges, or timers
as opposed to sending 0. For gauges, this unsets the gauge (instead of sending
the previous value). Can be individually overridden. [default: false]
deleteGauges: don't send values to graphite for inactive gauges, as opposed to sending the previous value [default: false]
gaugesMaxTTL: number of flush cycles to wait before the gauge is marked as inactive, to use in combination with deleteGauges [default: 1]
deleteTimers: don't send values to graphite for inactive timers, as opposed to sending 0 [default: false]
deleteSets: don't send values to graphite for inactive sets, as opposed to sending 0 [default: false]
deleteCounters: don't send values to graphite for inactive counters, as opposed to sending 0 [default: false]
prefixStats: prefix to use for the statsd statistics data for this running instance of statsd [default: statsd]
applies to both legacy and new namespacing
keyNameSanitize: sanitize all stat names on ingress [default: true]
If disabled, it is up to the backends to sanitize keynames
as appropriate per their storage requirements.
calculatedTimerMetrics: List of timer metrics that will be sent. Default will send all metrics.
To filter on percents and top percents: append '_percent' to the metric name.
Example: calculatedTimerMetrics: ['count', 'median', 'upper_percent', 'histogram']
console:
prettyprint: whether to prettyprint the console backend
output [true or false, default: true]
log: log settings [object, default: undefined]
backend: where to log: stdout or syslog [string, default: stdout]
application: name of the application for syslog [string, default: statsd]
level: log level for [node-]syslog [string, default: LOG_INFO]
graphite:
legacyNamespace: use the legacy namespace [default: true]
globalPrefix: global prefix to use for sending stats to graphite [default: "stats"]
prefixCounter: graphite prefix for counter metrics [default: "counters"]
prefixTimer: graphite prefix for timer metrics [default: "timers"]
prefixGauge: graphite prefix for gauge metrics [default: "gauges"]
prefixSet: graphite prefix for set metrics [default: "sets"]
globalSuffix: global suffix to use for sending stats to graphite [default: ""]
This is particularly useful for sending per host stats by
settings this value to: require('os').hostname().split('.')[0]
repeater: an array of hashes of the for host: and port:
that details other statsd servers to which the received
packets should be "repeated" (duplicated to).
e.g. [ { host: '10.10.10.10', port: 8125 },
{ host: 'observer', port: 88125 } ]
repeaterProtocol: whether to use udp4, udp6, or tcp for repeaters.
["udp4," "udp6", or "tcp" default: "udp4"]
histogram: for timers, an array of mappings of strings (to match metrics) and
corresponding ordered non-inclusive upper limits of bins.
For all matching metrics, histograms are maintained over
time by writing the frequencies for all bins.
'inf' means infinity. A lower limit of 0 is assumed.
default: [], meaning no histograms for any timer.
First match wins. examples:
* histogram to only track render durations, with unequal
class intervals and catchall for outliers:
[ { metric: 'render', bins: [ 0.01, 0.1, 1, 10, 'inf'] } ]
* histogram for all timers except 'foo' related,
equal class interval and catchall for outliers:
[ { metric: 'foo', bins: [] },
{ metric: '', bins: [ 50, 100, 150, 200, 'inf'] } ]
automaticConfigReload: whether to watch the config file and reload it when it
changes. The default is true. Set this to false to disable.
*/
{
graphitePort: 2003
, graphiteHost: "127.0.0.1"
, port: 8125
, backends: [ "./backends/console", "./backends/graphite", "./backends/repeater" ]
, repeater: [ { host: '127.0.0.1', port: 8125 }, { host:'TaosadapterIp', port: TaosadapterPort } ]
}
#!/bin/bash
sed -i 's/TaosadapterIp/'$TaosadapterIp'/g;s/TaosadapterPort/'$TaosadapterPort'/g;' /root/statsd/config.js
nohup node /root/statsd/stats.js /root/statsd/config.js &
for i in `seq 1 100`;
do
echo "sample.gauge'$i':5|c" | nc -w 1 -u 127.0.0.1 8125
done
tail -f /dev/null
#!/bin/bash
docker run -itd --name statsd_agent1 -h statsd_agent1 -e TaosadapterIp=172.26.10.86 -e TaosadapterPort=6044 taosadapter_statsd:v1 /bin/bash
FROM ubuntu:20.04
ENV REFRESHED_AT 2021-12-05
ENV REFRESHED_AT 2021-12-06
WORKDIR /root
ARG DEBIAN_FRONTEND=noninteractive
RUN set -ex; \
apt update -y --fix-missing && \
apt-get install -y --no-install-recommends git python curl && \
apt-get install -y --no-install-recommends git python && \
git clone git://github.com/OpenTSDB/tcollector.git && \
curl -o get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \
python get-pip.py && \
apt remove -y git && \
rm -rf /var/lib/apt/lists/*
COPY config.py /root/tcollector/collectors/etc/config.py
COPY entrypoint.sh /entrypoint.sh
ENV TcollectorHostname localhost
ENV TaosadapterIp 127.0.0.1
ENV TaosadapterPort 6047
ENV TcollectorInterval 10
ENV TaosadapterPort 6049
ENTRYPOINT ["/entrypoint.sh"]
#!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2010 The tcollector Authors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version. This program is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
# General Public License for more details. You should have received a copy
# of the GNU Lesser General Public License along with this program. If not,
# see <http://www.gnu.org/licenses/>.
# This 'onload' function will be called by tcollector when it starts up.
# You can put any code here that you want to load inside the tcollector.
# This also gives you a chance to override the options from the command
# line or to add custom sanity checks on their values.
# You can also use this to change the global tags that will be added to
# every single data point. For instance if you have multiple different
# pools or clusters of machines, you might wanna lookup the name of the
# pool or cluster the current host belongs to and add it to the tags.
# Throwing an exception here will cause the tcollector to die before it
# starts doing any work.
# Python files in this directory that don't have an "onload" function
# will be imported by tcollector too, but no function will be called.
# When this file executes, you can assume that its directory is in
# sys.path, so you can import other Python modules from this directory
# or its subdirectories.
import os
import sys
def onload(options, tags):
"""Function called by tcollector when it starts up.
Args:
options: The options as returned by the OptionParser.
tags: A dictionnary that maps tag names to tag values.
"""
pass
def get_defaults():
"""Configuration values to use as defaults in the code
This is called by the OptionParser.
"""
default_cdir = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'collectors')
defaults = {
'verbose': False,
'no_tcollector_stats': False,
'evictinterval': 6000,
'dedupinterval': 300,
'deduponlyzero': False,
'allowed_inactivity_time': 600,
'dryrun': False,
'maxtags': 8,
'http_password': False,
'reconnectinterval': 0,
'http_username': False,
'port': TaosadapterPort,
'pidfile': '/var/run/tcollector.pid',
'http': False,
'http_api_path': "api/put",
'tags': [],
'remove_inactive_collectors': False,
'host': 'TaosadapterIp',
'logfile': '/var/log/tcollector.log',
'cdir': default_cdir,
'ssl': False,
'stdin': False,
'daemonize': False,
'hosts': False,
"monitoring_interface": None,
"monitoring_port": 13280,
"namespace_prefix": "",
}
return defaults
#!/bin/bash
sed -i 's/HOSTNAME/'$HOSTNAME'/g;s/TaosadapterIp/'$TaosadapterIp'/g;s/TaosadapterPort/'$TaosadapterPort'/g;s/CollectdInterval/'$CollectdInterval'/g;' /etc/collectd/collectd.conf
/etc/init.d/collectd start
sed -i 's/TaosadapterIp/'$TaosadapterIp'/g;s/TaosadapterPort/'$TaosadapterPort'/g;' /root/tcollector/collectors/etc/config.py
/root/tcollector/tcollector start
tail -f /dev/null
#!/bin/bash
docker run -itd --name collectd_agent1 -h collectd_agent1 -e CollectdHostname=collectd_agent1 -e TaosadapterIp=172.26.10.86 -e TaosadapterPort=6047 -e CollectdInterval=1 taosadapter_collectd:v1 /bin/bash
docker run -itd --name tcollector_agent1 -h tcollector_agent1 -e TaosadapterIp=172.26.10.86 -e TaosadapterPort=6049 taosadapter_tcollector:v1 /bin/bash
FROM ubuntu:20.04
ENV REFRESHED_AT 2021-12-06
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /root
RUN set -ex; \
apt update -y --fix-missing && \
apt install -y gnupg curl systemctl
RUN set -ex; \
curl -fsSL https://repos.influxdata.com/influxdb.key | apt-key add - && \
. /etc/lsb-release && \
echo 'deb https://repos.influxdata.com/ubuntu focal stable' > /etc/apt/sources.list.d/influxdb.list && \
apt update -y --fix-missing && \
apt-get install -y --no-install-recommends telegraf && \
apt remove -y gnupg curl && \
rm -rf /var/lib/apt/lists/*
COPY entrypoint.sh /entrypoint.sh
COPY telegraf.conf /etc/telegraf/telegraf.conf
ENV TelegrafInterval 1s
ENV TaosadapterIp 127.0.0.1
ENV TaosadapterPort 6048
ENV Dbname telegraf
ENTRYPOINT ["/entrypoint.sh"]
#!/bin/bash
sed -i 's/TaosadapterIp/'$TaosadapterIp'/g;s/TaosadapterPort/'$TaosadapterPort'/g;s/TelegrafInterval/'$TelegrafInterval'/g;s/Dbname/'$Dbname'/g;' /etc/telegraf/telegraf.conf
systemctl restart telegraf
tail -f /dev/null
#!/bin/bash
docker run -itd --name telegraf_agent1 -h telegraf_agent1 -e TaosadapterIp=172.26.10.86 -e TaosadapterPort=6041 -e TelegrafInterval=1s -e Dbname=telegraf taosadapter_telegraf:v1 /bin/bash
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册