grobian / carbon-c-relay

Enhanced C implementation of Carbon relay, aggregator and rewriter
Apache License 2.0
380 stars 107 forks source link

listen directive documentation is missing #296

Closed zdenekpizl closed 7 years ago

zdenekpizl commented 7 years ago

Greetings,

listen
    <linemode [gzip | bzip2 | lzma | ssl]>
        <<interface[:port] | port> proto <udp | tcp>> ...
        </ptah/to/file proto unix> ...
    ;

Could be explained what exactly is functionality of this part of configuration? Thank you very much.

Best regards Zdenek Pizl.

azhiltsov commented 7 years ago

I think it unfinished implementation of this #212 I cannot find any configuration options for sender - hence the assumption it unfinished.

grobian commented 7 years ago

yes, it's work in progress (and the reason why 3.2 isn't released yet)

The idea is/was to add wrappers around the streams, so you can start sending encrypted/compressed and perhaps in the future things like protobuf and pickles.

zdenekpizl commented 7 years ago

I see, reason I was asking about it is that carbon-c-relay (built from 350208b commit) won't start on RHEL 6.x (or CentOS EL 6.x) without this directive included.

configuration:
    relay hostname = zpi-ccr001
    workers = 4
    send batch size = 2500
    server queue size = 25000
    server max stalls = 4
    listen backlog = 32
    server connection IO timeout = 600ms
    extra allowed characters = -_:#^
    daemon = true
    configuration = /etc/carbon-c-relay.conf

parsed configuration follows:
listen
    linemode
        2003 proto tcp
        2003 proto udp
        /tmp/.s.carbon-c-relay.2003 proto unix
    ;

statistics
    submit every 60 seconds
    prefix with carbon.relays.zpi-ccr001
    ;

cluster internal_stats
    file
        /var/lib/carbon-c-relay.stats
    ;

match carbon.relays.*
    send to internal_stats
    ;
match *
    send to blackhole
    stop
    ;

----- log ----
[2017-08-02 08:47:00] (MSG) listening on tcp4 0.0.0.0 port 2003
[2017-08-02 08:47:00] (ERR) failed to create socket for ::: Address family not supported by protocol

It is expected IPv6 by default apparently but there is no such protocol on the affected instance.

Using explicit

listen linemode 0.0.0.0:2003 proto tcp ;

makes carbon-c-relay happy and it tries bind only IPv4.

regards .zp.

grobian commented 7 years ago

hmmm what did previous versions bind to? only tcp4/udp4?

zdenekpizl commented 7 years ago

At least it has worked, so I assume yes, it bound to IPv4 only apparently.Verified with latest stable in EPEL (2.6-1)

[2017-08-02 10:39:00] (MSG) listening on tcp4 0.0.0.0 port 2003
[2017-08-02 10:39:00] (MSG) listening on udp4 0.0.0.0 port 2003
[2017-08-02 10:39:00] (MSG) listening on UNIX socket /tmp/.s.carbon-c-relay.2003
[2017-08-02 10:39:00] (MSG) starting 4 workers
[2017-08-02 10:39:00] (MSG) starting statistics collector
[2017-08-02 10:39:00] (MSG) starting servers

.zp.

grobian commented 7 years ago

I see, will look at this later. It indeed can be worked around by using the explicit ipv4 all address.

grobian commented 7 years ago

Please test if faac089 does the right thing for you. I couldn't spin up a vm or something to test this quickly.