В настоящее время я использую свои узлы Cassandra в докерах и планирую использовать Grafana для отображения метрик моего узла Cassandra.
Я использую это руководство
https://andreastech.wordpress.com/2018/03/19/cassandra-performance-monitoring-by-using-jolokia-agent-telegraf-influxdb-and-grafana/
Это использует jolokia, influenxdb, а также telegraf, чтобы попытаться отобразить график в Grafana.
Однако я не могу вызвать агента Джолокии, и, похоже, ему отказывают во время соединения.
Ниже приведена ошибка при подключении к jolokia.
Error in plugin: Get http://127.0.0.1:8778/jolokia/read/org.apache.cassandra.metrics:type=ColumnFamily,scope=%2A,%20name=AllMemtablesLiveDataSize,keyspace=%2A: dial tcp 127.0.0.1:8778: connect: connection refused
Приведенные ниже коды представляют собой файл составления docker моего узла cassandra, а также определенные метрики.
docker-compose.yaml
grafana:
build:
context: .
dockerfile: InputOutputProgram/grafana/sawtooth-stats-grafana
args:
- http-proxy
- https-proxy
- no_proxy
depends_on:
- influxdb
ports:
- "3000:3000"
image: sawtooth-stats-grafana:latest
container_name: sawtooth-grafana
influxdb:
build:
context: ./InputOutputProgram/influxdb
dockerfile: sawtooth-stats-influxdb
args:
- http_proxy
- https_proxy
- no_proxy
ports:
- "8086:8086"
volumes:
- ./:/project/sawtooth-core
image: sawtooth-stats-influxdb:latest
container_name: sawtooth-influxdb
telegraf:
container_name: sawtooth-telegraf
image: telegraf:latest
volumes:
- ./InputOutputProgram/telegraf.conf:/etc/telegraf/telegraf.conf
links:
- influxdb
restart: always
cassandradb:
# image: cassandra:3.11.3
build:
context: ./CassandraDB
dockerfile: db/Dockerfile
container_name: cassandra-db
environment:
CASSANDRA_BROADCAST_ADDRESS: "172.30.193.248"
ports:
- "7000:7000"
- "9042:9042"
- "8778:8778"
expose:
- 8778
# command: /bin/bash -c "sleep 1 && echo ' -- Pausing to let system catch up ... -->' && /docker-entrypoint.sh cassandra -f"
volumes:
- "cassandra:/var/lib/cassandra"
- "./CassandraDB/cassandra.yaml:/etc/cassandra/cassandra.yaml"
- "./CassandraDB/cassandra-env.sh:/etc/cassandra/cassandra-env.sh"
- "./CassandraDB/cassandra-init.sh:/cassandra-init.sh"
command: "sh /cassandra-init.sh"
links:
- "telegraf"
restart: always
telegraf.conf
# ## List of servers exposing jolokia read service
[[inputs.jolokia.servers]]
name = "as-server-01"
host = "127.0.0.1"
port = "8778"
# # username = "myuser"
# # password = "mypassword"
#
# ## List of metrics collected on above servers
# ## Each metric consists in a name, a jmx path and either
# ## a pass or drop slice attribute.
# ## This collect all heap memory usage metrics.
[[inputs.jolokia.metrics]]
name = "heap_memory_usage"
mbean = "java.lang:type=Memory"
attribute = "HeapMemoryUsage"
# # Read Cassandra metrics through Jolokia
[[inputs.cassandra]]
# # This is the context root used to compose the jolokia url
context = "/jolokia/read"
# ## List of cassandra servers exposing jolokia read service
servers = ["127.0.0.1:8778"]
# ## List of metrics collected on above servers
# ## Each metric consists of a jmx path.
# ## This will collect all heap memory usage metrics from the jvm and
# ## ReadLatency metrics for all keyspaces and tables.
# ## "type=Table" in the query works with Cassandra3.0. Older versions might
# ## need to use "type=ColumnFamily"
metrics = [
"/java.lang:type=Memory/HeapMemoryUsage",
"/java.lang:type=Memory/NonHeapMemoryUsage",
"/org.apache.cassandra.metrics:type=Storage,name=Load",
"/org.apache.cassandra.metrics:type=Storage,name=TotalHintsInProgress",
"/org.apache.cassandra.metrics:type=Storage,name=Exceptions",
"/org.apache.cassandra.metrics:type=ClientRequest,name=Latency,scope=*",
"/org.apache.cassandra.metrics:type=Client,name=connectedNativeClients",
"/org.apache.cassandra.metrics:type=CommitLog,name=PendingTasks",
"/org.apache.cassandra.metrics:type=CommitLog,name=TotalCommitLogSize",
"/org.apache.cassandra.metrics:type=ClientRequest,name=Timeouts,scope=*",
"/org.apache.cassandra.metrics:type=Compaction,name=BytesCompacted",
"/org.apache.cassandra.metrics:type=ColumnFamily,name=WriteLatency",
"/org.apache.cassandra.metrics:type=ColumnFamily,name=ReadLatency",
"/org.apache.cassandra.metrics:type=ColumnFamily,name=RangeLatency",
"/org.apache.cassandra.metrics:type=ColumnFamily,scope=*, name=AllMemtablesLiveDataSize,keyspace=*"
]
Dockerfile
FROM cassandra:3.11.3
WORKDIR /source
COPY /jolokia-1.4.0/ ./
COPY PathJolokiaAgent.sh ./
RUN chmod u+x PathJolokiaAgent.sh
PathJolokiaAgent.sh
#!/usr/bin/env sh
echo "pathjolokia"
echo 'JVM_OPTS="$JVM_OPTS -javaagent:./jolokia-1.4.0/agents/jolokia-jvm.jar"' >> /etc/cassandra/cassandra-env.sh
Общение с экспертами или теми, кому удается отображать метрики Кассандры в Графане с помощью докеров.Вся помощь приветствуется:)