dalmatinerdb / ddb_proxy

Proxy for other metric protocols
MIT License
9 stars 5 forks source link

LIsteners don't showing up #14

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi folks, I'm very interested in trying DalmatinerDB and went to test the setup on Centos7. I've configured ZFS and installed dalmatiner components like the following:

Filesystem         Size  Used Avail Use% Mounted on
data               709G  128K  709G   1% /data
data/dalmatinerdb  710G  363M  709G   1% /data/dalmatinerdb
data/ddb_proxy     709G   35M  709G   1% /data/ddb_proxy
data/dalmatinerfe  709G   34M  709G   1% /data/dalmatinerfe

DalmatinerDB itself works great, but I can't get listeners in ddb_proxy to work. My config file is as follows:

run_user_home = /data/ddb_proxy                                                                          
listeners.dp_otsdb.bucket = OpenTSDB                                                                     
listeners.dp_otsdb.protocol = tcp                                                                        
listeners.dp_otsdb.port = 4242                                                                           
listeners.dp_influx.bucket = InfluxDB                                                                    
listeners.dp_influx.port = 8086                                                                          
listeners.dp_influx.protocol = http                                                                      
nodename = ddb_proxy@127.0.0.1                                                                           
distributed_cookie = ddb_proxy_cookie                                                                    
erlang.async_threads = 30                                                                                
idx.pg.backend = 127.0.0.1:5555                                                                          
idx.pg.size = 20                                                                                         
idx.pg.max_overflow = 0                                                                                  
idx.pg.database = metric_metadata                                                                        
idx.pg.username = ddb                                                                                    
idx.pg.password = ddb                                                                                    
idx.backend = dqe_idx_ddb                                                                                
ddb_connection.backend_server = 127.0.0.1:5555                                                           
ddb_connection.max_read = 604800
ddb_connection.pool.size = 20
ddb_connection.pool.max = 5
log.console = file
log.console.level = info
log.console.file = /data/ddb_proxy/log/console.log
log.error.file = /data/ddb_proxy/log/error.log
log.debug.file = /data/ddb_proxy/log/debug.log
log.syslog = off
log.crash.file = /data/ddb_proxy/log/crash.log
log.crash.msg_size = 64KB
log.crash.size = 10MB
log.crash.date = $D0
log.crash.count = 5
log.error.redirect = on
log.error.messages_per_second = 100

And when I run the /data/ddb_proxy/bin/ddb_proxy start I get the following logs in debug.log:

2016-11-03 16:31:00.633 [debug] <0.86.0> Supervisor pgapp_sup started poolboy:start_link([{name,{local,ep
gsql_pool}},{worker_module,pgapp_worker},{size,20},{max_overflow,0}], [{host,"127.0.0.1"},{port,5555},{si
ze,20},{max_overflow,0},{database,"metric_metadata"},{username,...},...]) at pid <0.148.0>
2016-11-03 16:31:00.642 [info] <0.144.0>@ddb_proxy_sup:listener:39 [listener:dp_influx_InfluxDB_8086_http] Adding listener on bucket: <<"InfluxDB">> and port 8086
2016-11-03 16:31:00.692 [debug] <0.199.0> Supervisor {<0.199.0>,ranch_listener_sup} started ranch_conns_sup:start_link(dp_influx_InfluxDB_8086_http, worker, 5000, ranch_tcp, 5000, cowboy_protocol) at pid <0.200.0>
2016-11-03 16:31:00.716 [info] <0.144.0>@ddb_proxy_sup:listener:39 [listener:dp_otsdb_OpenTSDB_4242_tcp] Adding listener on bucket: <<"OpenTSDB">> and port 4242

But when I check netstat, for example, there's nothing here (I don't expect InfluxDB to show up, but I expect OpenTSDB listener to be at 4242 port):

> netstat -na | grep 4242

List of buckets in my database:

                        Bucket | Resolution      | File Size       | TTL                                 
-------------------------------+-----------------+-----------------+----------------                     
                         test1 | 1s              | 1w              | inf                                 
                  dalmatinerdb | 1s              | 1w              | inf                                 
                      OpenTSDB | 1s              | 1w              | inf                                 
               metric_metadata | 1s              | 1w              | inf                                 
                          test | 1s              | 1w              | inf 

All dalmatiner components were built from source, using Erlang 18.3.

If listeners were added and launched, why isn't there anything listening on corresponding port? Please help me solve the issue so I can check out what is the database you've built :) Thanks!

Licenser commented 8 years ago

did you create the OpenTSDB bucket manually?

ghost commented 8 years ago

@Licenser yes, I did, with the following command:

/data/dalmatinerdb/bin/ddb-admin buckets create OpenTSDB 1s 1w inf
Licenser commented 8 years ago

I notice that you are poinitng the indexer postgres backend to the dalmatinerdb port, that definitely will cause you some problems. can you try correcting that and see if that does the trick for you?

Licenser commented 8 years ago
idx.pg.backend = 127.0.0.1:5555

should probably be:

idx.pg.backend = 127.0.0.1:5432
ghost commented 8 years ago

Oh shoot! I've read that PostrgeSQL is optional and there's a default indexer in dalmatinerdb. So, I've thought that pg backend in that case should point to dalmatinerdb. I've commented this option and got my listener:

netstat -tulpn | grep 4242
tcp        0      0 0.0.0.0:4242            0.0.0.0:*               LISTEN      2530/beam.smp

Such a dumb error. Thanks for your time on helping me with this!

Licenser commented 8 years ago

No worries, you will not have fun with opentsdb and the default indexer so, it doesn't support dimensions and OpenTSDB kind of depends on them, you'll get only flattened path this way.

I'll mark this as closed as we solved your issue :)

ghost commented 8 years ago

Thanks for your advice! I was going to use PostgreSQL but later, first I wanted to be able to work with dalmatiner components.