Change streaming terminology to parent-child in the code (#9323)

This commit is contained in:
Andrew Moss 2020-06-12 17:49:53 +02:00 committed by GitHub
parent 777818f5b9
commit 68f1888227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 109 additions and 377 deletions

View File

@ -1,6 +1,6 @@
version: '3.3'
services:
agent_master:
agent_parent:
build:
context: ../../..
dockerfile: build_external/make-install.Dockerfile

View File

@ -1,6 +1,6 @@
version: '3.3'
services:
agent_master:
agent_parent:
build:
context: ../../..
dockerfile: build_external/make-install.Dockerfile

View File

@ -1,13 +1,13 @@
version: '3.3'
services:
agent_slave:
agent_child:
image: debian_10_dev
command: /usr/sbin/netdata -D
#ports:
#- 21002+:19999
volumes:
- ./slave_stream.conf:/etc/netdata/stream.conf:ro
#- ./slave_guid:/var/lib/netdata/registry/netdata.public.unique.id:ro
- ./child_stream.conf:/etc/netdata/stream.conf:ro
#- ./child_guid:/var/lib/netdata/registry/netdata.public.unique.id:ro
- ./min.conf:/etc/netdata/netdata.conf:ro
cap_add:
- SYS_PTRACE

View File

@ -1,13 +0,0 @@
version: '3.3'
services:
agent_master:
image: debian_10_dev
command: /usr/sbin/netdata -D
ports:
- 21000:19999
volumes:
- ./master_stream.conf:/etc/netdata/stream.conf:ro
- ./master_guid:/var/lib/netdata/registry/netdata.public.unique.id:ro
- ./min.conf:/etc/netdata/netdata.conf:ro
cap_add:
- SYS_PTRACE

View File

@ -4,7 +4,7 @@ services:
image: debian_10_dev
command: /usr/sbin/netdata -D
ports:
- 21001:19999
- 21001:19999
volumes:
- ./middle_stream.conf:/etc/netdata/stream.conf:ro
- ./middle_guid:/var/lib/netdata/registry/netdata.public.unique.id:ro

View File

@ -1,6 +1,6 @@
[stream]
enabled = yes
destination = tcp:agent_master
destination = tcp:agent_parent
api key = 00000000-0000-0000-0000-000000000000
timeout seconds = 60
default port = 19999

View File

@ -0,0 +1,13 @@
version: '3.3'
services:
agent_parent:
image: debian_10_dev
command: /usr/sbin/netdata -D
ports:
- 21000:19999
volumes:
- ./parent_stream.conf:/etc/netdata/stream.conf:ro
- ./parent_guid:/var/lib/netdata/registry/netdata.public.unique.id:ro
- ./min.conf:/etc/netdata/netdata.conf:ro
cap_add:
- SYS_PTRACE

View File

@ -1,15 +1,15 @@
version: '3.3'
services:
agent_slave:
agent_child:
image: arch_extras_dev
#command: /usr/sbin/valgrind --leak-check=full /usr/sbin/netdata -D
command: /usr/sbin/netdata -D # gdb does not like valgrind !
#ports:
#- 21002:19999
volumes:
- ./slave_stream.conf:/etc/netdata/stream.conf:ro
# - ./slave_guid:/var/lib/netdata/registry/netdata.public.unique.id:ro
- ./child_stream.conf:/etc/netdata/stream.conf:ro
# - ./child_guid:/var/lib/netdata/registry/netdata.public.unique.id:ro
- ./mostly_off.conf:/etc/netdata/netdata.conf:ro
cap_add:
- SYS_PTRACE
- SYS_PTRACE

View File

@ -1,5 +1,5 @@
[stream]
# Enable this on slaves, to have them send metrics.
# Enable this on child nodes, to have them send metrics.
enabled = yes
destination = tcp:192.168.1.2
api key = 00000000-0000-0000-0000-000000000000

View File

@ -1,13 +0,0 @@
version: '3.3'
services:
agent_master:
image: debian_10_dev
command: /usr/sbin/netdata -D
ports:
- 21000:19999
volumes:
- ./master_stream.conf:/etc/netdata/stream.conf:ro
- ./master_guid:/var/lib/netdata/registry/netdata.public.unique.id:ro
- ./mostly_off.conf:/etc/netdata/netdata.conf:ro
cap_add:
- SYS_PTRACE

View File

@ -5,10 +5,10 @@ services:
#command: /usr/sbin/valgrind --leak-check=full /usr/sbin/netdata -D
command: /usr/sbin/netdata -D
ports:
- 21001:19999
- 21001:19999
volumes:
- ./middle_stream.conf:/etc/netdata/stream.conf:ro
- ./middle_guid:/var/lib/netdata/registry/netdata.public.unique.id:ro
- ./mostly_off.conf:/etc/netdata/netdata.conf:ro
cap_add:
- SYS_PTRACE
- SYS_PTRACE

View File

@ -1,6 +1,6 @@
[stream]
enabled = yes
destination = tcp:agent_master
destination = tcp:agent_parent
api key = 00000000-0000-0000-0000-000000000000
timeout seconds = 60
default port = 19999

View File

@ -0,0 +1,13 @@
version: '3.3'
services:
agent_parent:
image: debian_10_dev
command: /usr/sbin/netdata -D
ports:
- 21000:19999
volumes:
- ./parent_stream.conf:/etc/netdata/stream.conf:ro
- ./parent_guid:/var/lib/netdata/registry/netdata.public.unique.id:ro
- ./mostly_off.conf:/etc/netdata/netdata.conf:ro
cap_add:
- SYS_PTRACE

View File

@ -1,140 +0,0 @@
# netdata configuration for aggregating data from remote hosts
#
# API keys authorize a pair of sending-receiving netdata servers.
# Once their communication is authorized, they can exchange metrics for any
# number of hosts.
#
# You can generate API keys, with the linux command: uuidgen
# -----------------------------------------------------------------------------
# 2. ON MASTER NETDATA - THE ONE THAT WILL BE RECEIVING METRICS
# You can have one API key per slave,
# or the same API key for all slaves.
#
# netdata searches for options in this order:
#
# a) master netdata settings (netdata.conf)
# b) [stream] section (above)
# c) [API_KEY] section (below, settings for the API key)
# d) [MACHINE_GUID] section (below, settings for each machine)
#
# You can combine the above (the more specific setting will be used).
# API key authentication
# If the key is not listed here, it will not be able to push metrics.
# [API_KEY] is [YOUR-API-KEY], i.e [11111111-2222-3333-4444-555555555555]
[00000000-0000-0000-0000-000000000000]
# Default settings for this API key
# You can disable the API key, by setting this to: no
# The default (for unknown API keys) is: no
enabled = yes
# A list of simple patterns matching the IPs of the servers that
# will be pushing metrics using this API key.
# The metrics are received via the API port, so the same IPs
# should also be matched at netdata.conf [web].allow connections from
allow from = *
# The default history in entries, for all hosts using this API key.
# You can also set it per host below.
# If you don't set it here, the history size of the central netdata
# will be used.
default history = 3600
# The default memory mode to be used for all hosts using this API key.
# You can also set it per host below.
# If you don't set it here, the memory mode of netdata.conf will be used.
# Valid modes:
# save save on exit, load on start
# map like swap (continuously syncing to disks - you need SSD)
# ram keep it in RAM, don't touch the disk
# none no database at all (use this on headless proxies)
# dbengine like a traditional database
# default memory mode = ram
# Shall we enable health monitoring for the hosts using this API key?
# 3 possible values:
# yes enable alarms
# no do not enable alarms
# auto enable alarms, only when the sending netdata is connected. For ephemeral slaves or slave system restarts,
# ensure that the netdata process on the slave is gracefully stopped, to prevent invalid last_collected alarms
# You can also set it per host, below.
# The default is taken from [health].enabled of netdata.conf
health enabled by default = auto
# postpone alarms for a short period after the sender is connected
default postpone alarms on connect seconds = 60
# allow or deny multiple connections for the same host?
# If you are sure all your netdata have their own machine GUID,
# set this to 'allow', since it allows faster reconnects.
# When set to 'deny', new connections for a host will not be
# accepted until an existing connection is cleared.
multiple connections = allow
# need to route metrics differently? set these.
# the defaults are the ones at the [stream] section (above)
#default proxy enabled = yes | no
#default proxy destination = IP:PORT IP:PORT ...
#default proxy api key = API_KEY
#default proxy send charts matching = *
# -----------------------------------------------------------------------------
# 3. PER SENDING HOST SETTINGS, ON MASTER NETDATA
# THIS IS OPTIONAL - YOU DON'T HAVE TO CONFIGURE IT
# This section exists to give you finer control of the master settings for each
# slave host, when the same API key is used by many netdata slaves / proxies.
#
# Each netdata has a unique GUID - generated the first time netdata starts.
# You can find it at /var/lib/netdata/registry/netdata.public.unique.id
# (at the slave).
#
# The host sending data will have one. If the host is not ephemeral,
# you can give settings for each sending host here.
[MACHINE_GUID]
# enable this host: yes | no
# When disabled, the master will not receive metrics for this host.
# THIS IS NOT A SECURITY MECHANISM - AN ATTACKER CAN SET ANY OTHER GUID.
# Use only the API key for security.
enabled = no
# A list of simple patterns matching the IPs of the servers that
# will be pushing metrics using this MACHINE GUID.
# The metrics are received via the API port, so the same IPs
# should also be matched at netdata.conf [web].allow connections from
# and at stream.conf [API_KEY].allow from
allow from = *
# The number of entries in the database
history = 3600
# The memory mode of the database: save | map | ram | none | dbengine
memory mode = save
# Health / alarms control: yes | no | auto
health enabled = yes
# postpone alarms when the sender connects
postpone alarms on connect seconds = 60
# allow or deny multiple connections for the same host?
# If you are sure all your netdata have their own machine GUID,
# set this to 'allow', since it allows faster reconnects.
# When set to 'deny', new connections for a host will not be
# accepted until an existing connection is cleared.
multiple connections = allow
# need to route metrics differently?
# the defaults are the ones at the [API KEY] section
#proxy enabled = yes | no
#proxy destination = IP:PORT IP:PORT ...
#proxy api key = API_KEY
#proxy send charts matching = *

View File

@ -1,144 +0,0 @@
# netdata configuration for aggregating data from remote hosts
#
# API keys authorize a pair of sending-receiving netdata servers.
# Once their communication is authorized, they can exchange metrics for any
# number of hosts.
#
# You can generate API keys, with the linux command: uuidgen
# -----------------------------------------------------------------------------
# 1. ON SLAVE NETDATA - THE ONE THAT WILL BE SENDING METRICS
[stream]
# Enable this on slaves, to have them send metrics.
enabled = yes
# Where is the receiving netdata?
# A space separated list of:
#
# [PROTOCOL:]HOST[%INTERFACE][:PORT][:SSL]
#
# If many are given, the first available will get the metrics.
#
# PROTOCOL = tcp, udp, or unix (only tcp and unix are supported by masters)
# HOST = an IPv4, IPv6 IP, or a hostname, or a unix domain socket path.
# IPv6 IPs should be given with brackets [ip:address]
# INTERFACE = the network interface to use (only for IPv6)
# PORT = the port number or service name (/etc/services)
# SSL = when this word appear at the end of the destination string
# the Netdata will do encrypt connection with the master.
#
# This communication is not HTTP (it cannot be proxied by web proxies).
destination = tcp:agent_master
# Skip Certificate verification?
#
# The netdata slave is configurated to avoid invalid SSL/TLS certificate,
# so certificates that are self-signed or expired will stop the streaming.
# Case the server certificate is not valid, you can enable the use of
# 'bad' certificates setting the next option as 'yes'.
#
#ssl skip certificate verification = yes
# Certificate Authority Path
#
# OpenSSL has a default directory where the known certificates are stored,
# case it is necessary it is possible to change this rule using the variable
# "CApath"
#
#CApath = /etc/ssl/certs/
# Certificate Authority file
#
# When the Netdata master has certificate, that is not recognized as valid,
# we can add this certificate in the list of known certificates in CApath
# and give for Netdata as argument.
#
#CAfile = /etc/ssl/certs/cert.pem
# The API_KEY to use (as the sender)
api key = 00000000-0000-0000-0000-000000000000
# The timeout to connect and send metrics
timeout seconds = 60
# If the destination line above does not specify a port, use this
default port = 19999
# filter the charts to be streamed
# netdata SIMPLE PATTERN:
# - space separated list of patterns (use \ to include spaces in patterns)
# - use * as wildcard, any number of times within each pattern
# - prefix a pattern with ! for a negative match (ie not stream the charts it matches)
# - the order of patterns is important (left to right)
# To send all except a few, use: !this !that * (ie append a wildcard pattern)
send charts matching = *
# The buffer to use for sending metrics.
# 1MB is good for 10-20 seconds of data, so increase this if you expect latencies.
# The buffer is flushed on reconnects (this will not prevent gaps at the charts).
buffer size bytes = 1048576
# If the connection fails, or it disconnects,
# retry after that many seconds.
reconnect delay seconds = 5
# Sync the clock of the charts for that many iterations, when starting.
initial clock resync iterations = 60
# -----------------------------------------------------------------------------
# 3. PER SENDING HOST SETTINGS, ON MASTER NETDATA
# THIS IS OPTIONAL - YOU DON'T HAVE TO CONFIGURE IT
# This section exists to give you finer control of the master settings for each
# slave host, when the same API key is used by many netdata slaves / proxies.
#
# Each netdata has a unique GUID - generated the first time netdata starts.
# You can find it at /var/lib/netdata/registry/netdata.public.unique.id
# (at the slave).
#
# The host sending data will have one. If the host is not ephemeral,
# you can give settings for each sending host here.
[MACHINE_GUID]
# enable this host: yes | no
# When disabled, the master will not receive metrics for this host.
# THIS IS NOT A SECURITY MECHANISM - AN ATTACKER CAN SET ANY OTHER GUID.
# Use only the API key for security.
enabled = no
# A list of simple patterns matching the IPs of the servers that
# will be pushing metrics using this MACHINE GUID.
# The metrics are received via the API port, so the same IPs
# should also be matched at netdata.conf [web].allow connections from
# and at stream.conf [API_KEY].allow from
allow from = *
# The number of entries in the database
history = 3600
# The memory mode of the database: save | map | ram | none | dbengine
memory mode = save
# Health / alarms control: yes | no | auto
health enabled = yes
# postpone alarms when the sender connects
postpone alarms on connect seconds = 60
# allow or deny multiple connections for the same host?
# If you are sure all your netdata have their own machine GUID,
# set this to 'allow', since it allows faster reconnects.
# When set to 'deny', new connections for a host will not be
# accepted until an existing connection is cleared.
multiple connections = allow
# need to route metrics differently?
# the defaults are the ones at the [API KEY] section
#proxy enabled = yes | no
#proxy destination = IP:PORT IP:PORT ...
#proxy api key = API_KEY
#proxy send charts matching = *

View File

@ -0,0 +1,10 @@
[stream]
enabled = yes
destination = tcp:agent_parent
api key = 00000000-0000-0000-0000-000000000000
timeout seconds = 60
default port = 19999
send charts matching = *
buffer size bytes = 1048576
reconnect delay seconds = 5
initial clock resync iterations = 60

View File

@ -1,23 +1,23 @@
version: '3.3'
services:
agent_master:
agent_parent:
image: debian_10_dev
command: /usr/sbin/netdata -D
ports:
- 20000:19999
- 20000:19999
volumes:
- ./master_stream.conf:/etc/netdata/stream.conf:ro
agent_slave1:
- ./parent_stream.conf:/etc/netdata/stream.conf:ro
agent_child1:
image: debian_9_dev
command: /usr/sbin/netdata -D
#ports: Removed to allow scaling
#- 20001:19999
volumes:
- ./slave_stream.conf:/etc/netdata/stream.conf:ro
agent_slave2:
- ./child_stream.conf:/etc/netdata/stream.conf:ro
agent_child2:
image: fedora_30_dev
command: /usr/sbin/netdata -D
#ports: Removed to allow scaling
#- 20002:19999
volumes:
- ./slave_stream.conf:/etc/netdata/stream.conf:ro
- ./child_stream.conf:/etc/netdata/stream.conf:ro

View File

@ -0,0 +1,7 @@
[00000000-0000-0000-0000-000000000000]
enabled = yes
allow from = *
default history = 3600
health enabled by default = auto
default postpone alarms on connect seconds = 60
multiple connections = allow

View File

@ -306,7 +306,7 @@ PARSER_RC pluginsd_chart(char **words, void *user, PLUGINSD_ACTION *plugins_act
// parse the name, and make sure it does not include 'type.'
if (unlikely(name && *name)) {
// when data are coming from slaves
// when data are streamed from child nodes
// name will be type.name
// so we have to remove 'type.' from name too
size_t len = strlen(type);
@ -693,4 +693,3 @@ inline size_t pluginsd_process(RRDHOST *host, struct plugind *cd, FILE *fp, int
return count;
}

View File

@ -36,7 +36,7 @@ void netdata_cleanup_and_exit(int ret) {
// exit cleanly
// stop everything
info("EXIT: stopping master threads...");
info("EXIT: stopping static threads...");
cancel_main_threads();
// free the database
@ -232,7 +232,7 @@ void cancel_main_threads() {
usec_t max = 5 * USEC_PER_SEC, step = 100000;
for (i = 0; static_threads[i].name != NULL ; i++) {
if(static_threads[i].enabled == NETDATA_MAIN_THREAD_RUNNING) {
info("EXIT: Stopping master thread: %s", static_threads[i].name);
info("EXIT: Stopping main thread: %s", static_threads[i].name);
netdata_thread_cancel(*static_threads[i].thread);
found++;
}
@ -254,7 +254,7 @@ void cancel_main_threads() {
if(found) {
for (i = 0; static_threads[i].name != NULL ; i++) {
if (static_threads[i].enabled != NETDATA_MAIN_THREAD_EXITED)
error("Master thread %s takes too long to exit. Giving up...", static_threads[i].name);
error("Main thread %s takes too long to exit. Giving up...", static_threads[i].name);
}
}
else

View File

@ -396,7 +396,7 @@ typedef enum rrdset_flags {
RRDSET_FLAG_BACKEND_IGNORE = 1 << 5, // if set, this chart should not be sent to backends
RRDSET_FLAG_UPSTREAM_SEND = 1 << 6, // if set, this chart should be sent upstream (streaming)
RRDSET_FLAG_UPSTREAM_IGNORE = 1 << 7, // if set, this chart should not be sent upstream (streaming)
RRDSET_FLAG_UPSTREAM_EXPOSED = 1 << 8, // if set, we have sent this chart definition to netdata master (streaming)
RRDSET_FLAG_UPSTREAM_EXPOSED = 1 << 8, // if set, we have sent this chart definition to netdata parent (streaming)
RRDSET_FLAG_STORE_FIRST = 1 << 9, // if set, do not eliminate the first collection during interpolation
RRDSET_FLAG_HETEROGENEOUS = 1 << 10, // if set, the chart is not homogeneous (dimensions in it have multiple algorithms, multipliers or dividers)
RRDSET_FLAG_HOMOGENEOUS_CHECK = 1 << 11, // if set, the chart should be checked to determine if the dimensions are homogeneous

View File

@ -907,7 +907,7 @@ struct label *load_auto_labels()
add_label_to_list(label_list, "_virt_detection", localhost->system_info->virt_detection, LABEL_SOURCE_AUTO);
label_list = add_label_to_list(
label_list, "_is_master", (localhost->next || configured_as_master()) ? "true" : "false", LABEL_SOURCE_AUTO);
label_list, "_is_parent", (localhost->next || configured_as_parent()) ? "true" : "false", LABEL_SOURCE_AUTO);
if (localhost->rrdpush_send_destination)
label_list =

View File

@ -410,7 +410,7 @@ if [ -z ${EMAIL_CHARSET} ]; then
fi
# If we've been asked to use FQDN's for the URL's in the alarm, do so,
# unless we're sending an alarm for a slave system which we can't get the
# unless we're sending an alarm for a child system which we can't get the
# FQDN of easily.
if [ "${use_fqdn}" = "YES" ] && [ "${host}" = "$(hostname -s 2>/dev/null)" ]; then
host="$(hostname -f 2>/dev/null)"

View File

@ -76,8 +76,8 @@ date_format=''
# the line below to have Netdata instead use the host's fully qualified
# domain name.
#
# This does not report correct FQDN's for slave systems for which this
# sytem is a master.
# This does not report correct FQDN's for child systems for which this
# system is a parent.
#
# Additionally, if the system host name is overridden in /etc/netdata.conf
# with the `hostname` option, that name will be used unconditionally

View File

@ -316,7 +316,7 @@ int security_process_accept(SSL *ssl,int msg) {
/**
* Test Certificate
*
* Check the certificate of Netdata master
* Check the certificate of Netdata parent
*
* @param ssl is the connection structure
*
@ -348,10 +348,10 @@ int security_test_certificate(SSL *ssl) {
* Location for context
*
* Case the user give us a directory with the certificates available and
* the Netdata master certificate, we use this function to validate the certificate.
* the Netdata parent certificate, we use this function to validate the certificate.
*
* @param ctx the context where the path will be set.
* @param file the file with Netdata master certificate.
* @param file the file with Netdata parent certificate.
* @param path the directory where the certificates are stored.
*
* @return It returns 0 on success and -1 otherwise.
@ -359,7 +359,7 @@ int security_test_certificate(SSL *ssl) {
int security_location_for_context(SSL_CTX *ctx, char *file, char *path) {
struct stat statbuf;
if (stat(file, &statbuf)) {
info("Netdata does not have a SSL master certificate, so it will use the default OpenSSL configuration to validate certificates!");
info("Netdata does not have the parent's SSL certificate, so it will use the default OpenSSL configuration to validate certificates!");
return 0;
}
@ -379,7 +379,7 @@ int security_location_for_context(SSL_CTX *ctx, char *file, char *path) {
slfc:
while ((err = ERR_get_error()) != 0) {
ERR_error_string_n(err, buf, sizeof(buf));
error("Cannot set the directory for the certificates and the master SSL certificate: %s",buf);
error("Cannot set the directory for the certificates and the parent SSL certificate: %s",buf);
}
return -1;
}

View File

@ -51,7 +51,7 @@ PARSER_RC streaming_timestamp(char **words, void *user, PLUGINSD_ACTION *plugins
RRDHOST *host = ((PARSER_USER_OBJECT *)user)->host;
struct plugind *cd = ((PARSER_USER_OBJECT *)user)->cd;
if (cd->version < VERSION_GAP_FILLING ) {
error("STREAM %s from %s: Slave negotiated version %u but sent TIMESTAMP!", host->hostname, cd->cmd,
error("STREAM %s from %s: Child negotiated version %u but sent TIMESTAMP!", host->hostname, cd->cmd,
cd->version);
return PARSER_RC_OK; // Ignore error and continue stream
}
@ -232,8 +232,8 @@ static int rrdpush_receive(struct receiver_state *rpt)
if(rpt->tags && !*rpt->tags) rpt->tags = NULL;
if (strcmp(rpt->machine_guid, localhost->machine_guid) == 0) {
log_stream_connection(rpt->client_ip, rpt->client_port, rpt->key, rpt->machine_guid, rpt->hostname, "DENIED - ATTEMPT TO RECEIVE METRICS FROM MACHINE_GUID IDENTICAL TO MASTER");
error("STREAM %s [receive from %s:%s]: denied to receive metrics, machine GUID [%s] is my own. Did you copy the master/proxy machine guid to a slave?", rpt->hostname, rpt->client_ip, rpt->client_port, rpt->machine_guid);
log_stream_connection(rpt->client_ip, rpt->client_port, rpt->key, rpt->machine_guid, rpt->hostname, "DENIED - ATTEMPT TO RECEIVE METRICS FROM MACHINE_GUID IDENTICAL TO PARENT");
error("STREAM %s [receive from %s:%s]: denied to receive metrics, machine GUID [%s] is my own. Did you copy the parent/proxy machine GUID to a child?", rpt->hostname, rpt->client_ip, rpt->client_port, rpt->machine_guid);
close(rpt->fd);
return 1;
}

View File

@ -144,9 +144,9 @@ static inline int should_send_chart_matching(RRDSET *st) {
return(rrdset_flag_check(st, RRDSET_FLAG_UPSTREAM_SEND));
}
int configured_as_master() {
int configured_as_parent() {
struct section *section = NULL;
int is_master = 0;
int is_parent = 0;
appconfig_wrlock(&stream_config);
for (section = stream_config.first_section; section; section = section->next) {
@ -154,13 +154,13 @@ int configured_as_master() {
if (uuid_parse(section->name, uuid) != -1 &&
appconfig_get_boolean_by_section(section, "enabled", 0)) {
is_master = 1;
is_parent = 1;
break;
}
}
appconfig_unlock(&stream_config);
return is_master;
return is_parent;
}
// checks if the current chart definition has been sent
@ -476,7 +476,7 @@ int rrdpush_receiver_thread_spawn(struct web_client *w, char *url) {
else if(!strcmp(name, "ver"))
stream_version = MIN((uint32_t) strtoul(value, NULL, 0), STREAMING_PROTOCOL_CURRENT_VERSION);
else {
// An old Netdata slave does not have a compatible streaming protocol, map to something sane.
// An old Netdata child does not have a compatible streaming protocol, map to something sane.
if (!strcmp(name, "NETDATA_SYSTEM_OS_NAME"))
name = "NETDATA_HOST_OS_NAME";
else if (!strcmp(name, "NETDATA_SYSTEM_OS_ID"))

View File

@ -99,7 +99,7 @@ extern void sender_init(struct sender_state *s, RRDHOST *parent);
void sender_start(struct sender_state *s);
void sender_commit(struct sender_state *s);
extern int rrdpush_init();
extern int configured_as_master();
extern int configured_as_parent();
extern void rrdset_done_push(RRDSET *st);
extern void rrdset_push_chart_definition_now(RRDSET *st);
extern void *rrdpush_sender_thread(void *ptr);

View File

@ -145,7 +145,7 @@ void rrdpush_clean_encoded(stream_encoded_t *se)
freez(se->kernel_version);
}
static int rrdpush_sender_thread_connect_to_master(RRDHOST *host, int default_port, int timeout,
static int rrdpush_sender_thread_connect_to_parent(RRDHOST *host, int default_port, int timeout,
struct sender_state *s) {
struct timeval tv = {
@ -365,7 +365,7 @@ static int rrdpush_sender_thread_connect_to_master(RRDHOST *host, int default_po
}
s->version = version;
info("STREAM %s [send to %s]: established communication with a master using protocol version %d - ready to send metrics..."
info("STREAM %s [send to %s]: established communication with a parent using protocol version %d - ready to send metrics..."
, host->hostname
, s->connected_to
, version);
@ -385,7 +385,7 @@ static void attempt_to_connect(struct sender_state *state)
{
state->send_attempts = 0;
if(rrdpush_sender_thread_connect_to_master(state->host, state->default_port, state->timeout, state)) {
if(rrdpush_sender_thread_connect_to_parent(state->host, state->default_port, state->timeout, state)) {
state->last_sent_t = now_monotonic_sec();
// reset the buffer, to properly send charts and metrics

View File

@ -8,10 +8,10 @@
# -----------------------------------------------------------------------------
# 1. ON SLAVE NETDATA - THE ONE THAT WILL BE SENDING METRICS
# 1. ON CHILD NETDATA - THE ONE THAT WILL BE SENDING METRICS
[stream]
# Enable this on slaves, to have them send metrics.
# Enable this on child nodes, to have them send metrics.
enabled = no
# Where is the receiving netdata?
@ -21,20 +21,20 @@
#
# If many are given, the first available will get the metrics.
#
# PROTOCOL = tcp, udp, or unix (only tcp and unix are supported by masters)
# PROTOCOL = tcp, udp, or unix (only tcp and unix are supported by parent nodes)
# HOST = an IPv4, IPv6 IP, or a hostname, or a unix domain socket path.
# IPv6 IPs should be given with brackets [ip:address]
# INTERFACE = the network interface to use (only for IPv6)
# PORT = the port number or service name (/etc/services)
# SSL = when this word appear at the end of the destination string
# the Netdata will do encrypt connection with the master.
# the Netdata will encrypt the connection with the parent.
#
# This communication is not HTTP (it cannot be proxied by web proxies).
destination =
# Skip Certificate verification?
#
# The netdata slave is configurated to avoid invalid SSL/TLS certificate,
# The netdata child is configurated to avoid invalid SSL/TLS certificate,
# so certificates that are self-signed or expired will stop the streaming.
# Case the server certificate is not valid, you can enable the use of
# 'bad' certificates setting the next option as 'yes'.
@ -51,7 +51,7 @@
# Certificate Authority file
#
# When the Netdata master has certificate, that is not recognized as valid,
# When the Netdata parent has certificate, that is not recognized as valid,
# we can add this certificate in the list of known certificates in CApath
# and give for Netdata as argument.
#
@ -88,14 +88,14 @@
initial clock resync iterations = 60
# -----------------------------------------------------------------------------
# 2. ON MASTER NETDATA - THE ONE THAT WILL BE RECEIVING METRICS
# 2. ON PARENT NETDATA - THE ONE THAT WILL BE RECEIVING METRICS
# You can have one API key per slave,
# or the same API key for all slaves.
# You can have one API key per child,
# or the same API key for all child nodes.
#
# netdata searches for options in this order:
#
# a) master netdata settings (netdata.conf)
# a) parent netdata settings (netdata.conf)
# b) [stream] section (above)
# c) [API_KEY] section (below, settings for the API key)
# d) [MACHINE_GUID] section (below, settings for each machine)
@ -140,8 +140,8 @@
# 3 possible values:
# yes enable alarms
# no do not enable alarms
# auto enable alarms, only when the sending netdata is connected. For ephemeral slaves or slave system restarts,
# ensure that the netdata process on the slave is gracefully stopped, to prevent invalid last_collected alarms
# auto enable alarms, only when the sending netdata is connected. For ephemeral child nodes or child system restarts,
# ensure that the netdata process on the child is gracefully stopped, to prevent invalid last_collected alarms
# You can also set it per host, below.
# The default is taken from [health].enabled of netdata.conf
health enabled by default = auto
@ -158,22 +158,22 @@
# -----------------------------------------------------------------------------
# 3. PER SENDING HOST SETTINGS, ON MASTER NETDATA
# 3. PER SENDING HOST SETTINGS, ON PARENT NETDATA
# THIS IS OPTIONAL - YOU DON'T HAVE TO CONFIGURE IT
# This section exists to give you finer control of the master settings for each
# slave host, when the same API key is used by many netdata slaves / proxies.
# This section exists to give you finer control of the parent settings for each
# child host, when the same API key is used by many netdata child nodes / proxies.
#
# Each netdata has a unique GUID - generated the first time netdata starts.
# You can find it at /var/lib/netdata/registry/netdata.public.unique.id
# (at the slave).
# (at the child).
#
# The host sending data will have one. If the host is not ephemeral,
# you can give settings for each sending host here.
[MACHINE_GUID]
# enable this host: yes | no
# When disabled, the master will not receive metrics for this host.
# When disabled, the parent will not receive metrics for this host.
# THIS IS NOT A SECURITY MECHANISM - AN ATTACKER CAN SET ANY OTHER GUID.
# Use only the API key for security.
enabled = no

View File

@ -863,7 +863,7 @@ static inline char *web_client_valid_method(struct web_client *w, char *s) {
memcpy(hostname,"not available",13);
hostname[13] = 0x00;
}
error("The server is configured to always use encrypt connection, please enable the SSL on slave with hostname '%s'.",hostname);
error("The server is configured to always use encrypted connections, please enable the SSL on child with hostname '%s'.",hostname);
s = NULL;
}
#endif