Hello,
I’ve already created another user called “energytix” and can connect with that user on my first CrateDB node:
(cratedb) administrator@crate-dn-001:~$ crash --username energytix
Password:
CONNECT OK
cr> \q
Bye!
(cratedb) administrator@crate-dn-001:~$
But when I try to connect from a remote server, again using crash
, I can’t:
(cratedb) loadgenerator001@eris:~$ crash --verbose --hosts 192.168.239.30 --username energytix
+----------------------------+-----------+---------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| server_url | node_name | version | connected | message |
+----------------------------+-----------+---------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| http://192.168.239.30:4200 | NULL | 0.0.0 | FALSE | Server not available, exception: HTTPConnectionPool(host='192.168.239.30', port=4200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f76a35450a0>: Failed to establish a new connection: [Errno 111] Connection refused')) |
+----------------------------+-----------+---------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
CONNECT ERROR
I read Host-Based Authentication (HBA) — CrateDB: Reference and added the user, as well as the remote server’s IP address to /etc/crate/crate.yml
and restarted CrateDB (via systemctl). The relevant part looks like:
# Client access and authentication is then configured via the host based
# config, a map of remote client access entries.
# The following example is a sane configuration that covers a common use case:
# * The predefined superuser `crate` has trusted access from localhost.
# * All other users require username/password authentication from anywhere.
# Note that this authentication method is only available via Postgres
# Protocol, meaning that with this configuration, connecting from non-local
# hosts via HTTP would not be possible!
auth:
host_based:
config:
0:
user: crate
address: _local_
method: trust
a:
user: energytix
address: 192.168.239.20/24
method: password
protocol: pg
99:
method: password
But maybe I misunderstood something and the YAML configuration above is wrong?
Long story short, how can I connect (using crash
) from a remote server to my CrateDB node?