将 Logstash 与 IBM BlueMix 上的 RethinkDB 连接起来

Connect Logstash with RethinkDB on IBM BlueMix

我尝试将 Logstash 与 IBM BlueMix 上的 RethinkDB 连接起来。我已经从 BlueMix 提供了 RethinkDB-Service(我相信是从 Compose 提供的)并且还提供了一个虚拟机 (CentOS)。然后我安装了 Logstash(使用 yum 包)和这里的插件(https://github.com/wayann/logstash-input-rethinker). So far so good. Now I struggle to get a connection from Logstash to RethinkDB. I have sent host and port and auth_key in a similar config file (https://github.com/wayann/logstash-input-rethinker/blob/master/rethinker.conf)并用 bin/logstash -f rethinker.conf 启动了 Logstash 但是,Logstash 无法连接到 RethinkDB。有没有人在 Bluemix 上使用 Logstash 和 RethinkDB?我已经根据 BlueMix 仪表板上可用的凭据(与管理员 UI 相同)发送了主机和端口,但我不确定 auth_key 使用什么。管理员密码无效。 BlueMix 运行 RethinkDB 版本 2.3.5

高度赞赏任何提示

Edit1,错误信息:

05:46:12.049 [[main]<rethinker] ERROR logstash.pipeline - A plugin 
had an unrecoverable error. Will restart this plugin.
 Plugin: <LogStash::Inputs::Rethinker host=>"sl-eu-lon-2-
portal.3.dblayer.com", port=>15216, auth_key=>"********", 
watch_dbs=>["test", "MyDB"], watch_tables=>["MyTable"], 
backfill=>"true", id=>"f1c07e0332787a22600c0835d2aa6ad61ca9b22b-1", 
enable_metric=>true, codec=><LogStash::Codecs::JSONLines 
id=>"json_lines_e24c0744-3983-4001-9629-d93e266c5ffb", 
enable_metric=>true, charset=>"UTF-8", delimiter=>"\n">, 
squash=>true, user=>"admin">
 Error: Connection closed by server.

Edit2,配置文件:

input { 
  rethinker {
    host => 'sl-eu-lon-2-portal.3.dblayer.com'
    port => 15216
    auth_key => '*****'
    watch_dbs => ['test','MyDB']
    watch_tables => ['MyTable']
    backfill => true
  }
}

output { 
  stdout { 
    codec => json_lines 
  } 
}

编辑 3:

好的,这是我的错误。我需要使用 'username'、'password' 和 'ca_cert' 参数,而不是 'auth_key'。使用此配置连接到 rethinkdb 实例:

input { 
  rethinker {
    host => 'sl-eu-lon-2-portal.3.dblayer.com'
    port => 15216
    watch_dbs => ['MyDB']
    watch_tables => ['MyTable']
    backfill => true
    user => 'admin'
    password => '******'
    ca_certs => '<<cert-string>>'
  }
}

output { 
  stdout { 
    codec => json_lines 
  } 
}

但是,现在我收到以下错误:

03:54:37.252 [[main]<rethinker] ERROR logstash.pipeline - A plugin 
had an unrecoverable error. Will restart this plugin.
  Plugin: <LogStash::Inputs::Rethinker host=>"sl-eu-lon-2-
portal.3.dblayer.com", port=>15216, watch_dbs=>["MyDB"], 
watch_tables=>["MyTable"], backfill=>"true", user=>"admin", 
password=>"*****", ca_certs=>"**cert-string**", 
id=>"46aa34ee0917060057d4e9a0c657ee327df730ee-1", 
enable_metric=>true, codec=><LogStash::Codecs::JSONLines 
id=>"json_lines_c43cdbc3-1646-4e96-aadc-834e727949a6", 
enable_metric=>true, charset=>"UTF-8", delimiter=>"\n">, 
squash=>true>
  Error: No message available

我该如何解决这个 Error: No message available 错误? Logstash 版本为 5.5.2

我终于弄明白了,非常感谢您的帮助@whites11

我需要在配置文件中进行正确的设置。这包括 userpasswordca-cert。对于 ca-cert 重要的是这是证书文件的路径并且 不是 作为字符串的证书内容。

我的设置现在是这样的:

input { 
  rethinker {
    host => 'sl-eu-lon-2-portal.3.dblayer.com'
    port => 15216
    watch_dbs => ['MyDB']
    watch_tables => ['MyTable']
    backfill => true
    user => 'admin'
    password => '******'
    ca_certs => '<<path-to-cert-file>>'
  }
}

output { 
  stdout { 
    codec => json_lines 
  } 
}