Tyk-pump complainig about mongodb, but not defined in pumps

I’m trying to test tyk-pump with csv files, but I can’t get any info…

[Apr  6 15:33:52]  INFO main: ## Tyk Analytics Pump, v0.2.0.0 ##
[Apr  6 15:33:52]  INFO main: Init Pump: CSV Pump
[Apr  6 15:34:04] ERROR mongo-pump: Mongo connection failed:no reachable servers
[Apr  6 15:34:15] ERROR mongo-pump: Mongo connection failed:no reachable servers
[Apr  6 15:34:27] ERROR mongo-pump: Mongo connection failed:no reachable servers

My pumps.conf it’s like this:

{
    "analytics_storage_type": "redis",
    "analytics_storage_config": {
        "type": "redis",
        "enable_cluster": true,
        "hosts": {
            "api1.local": "6379",
            "api2.local": "6379",
            "api3.local": "6379",
            "api1.local": "6479",
            "api2.local": "6479",
            "api3.local": "6479"
        },
        "username": "",
        "password": "",
        "database": 0,
        "optimisation_max_idle": 2000,
        "optimisation_max_active": 4000
    },
    "purge_delay": 10,
    "pumps": {
        "csv": {
            "name": "csv",
            "meta": {
                "csv_dir": "/opt/tyk-csv/"
            }
        }
    },
    "dont_purge_uptime_data": false
}

Any advice ?

Set "dont_purge_uptime_data": true

The pump is trying to purge Uptime stats (separate from analytics), which are currently only available via a mongo pump. Since you don’t have a section in your conf for that, it’s just using empty server settings.

Ok, modified and restarted… but I can’t see any csv files in csv_dir…
It’s supposed to write one every 10 seconds ?

Log it’s stalled like this

[Apr  6 15:49:14]  INFO main: ## Tyk Analytics Pump, v0.2.0.0 ##
[Apr  6 15:49:14]  INFO main: Init Pump: CSV Pump
[Apr  6 15:49:14]  INFO main: Starting purge loop @10(s)
[Apr  6 15:49:24]  WARN redis: Connection dropped, connecting..
[Apr  6 15:49:24]  INFO redis: --> Using clustered mode

Does the directory exist?

Is the Tyk-Pump process allowed to access this directory?

It will also only write when there is data.

Strange…
The directory exist with proper permissions
Tyk-pump it’s running as root
And there is a little but real activity in tyk-gateway …

There is any config value in the APIs or Tyk to enable/disable statistics ?

in the tyk.conf you have enable_analytics set to true?

(I just tested the CSV purger and it works as expected - so it’s definetely a config problem)

Don’t mind Martin…
It’s working now (with the enable_analytics set to true)
Thanks and sorry, I need to RTFM more often…

1 Like