Not able to connect with cassandra db which have multiple ssh tunnel
I am trying to setup my remote cassandra db with datagrip which goes through multiple hops.
local machine -> ssh to bastion -> ssh to remote-cql -> cqlsh to login to cassandra db.
I am not able to setup multiple hop in datagrip. first tunnel I did and that was successful but not able to setup second one.
tried using ~/.ssh/config I am able to do using terminal but the same not working with datagrip.
Host bastion
Hostname 10.0.0.1
User qwerty
IdentityFile ~/.ssh/jumpcloud
Host remote-cql
Hostname 10.0.0.2
User qwerty
ProxyCommand ssh -W %h:%p bastion
LocalForward 9042 localhost:9042
ProxyJump bastion
ForwardAgent yes
if i do ssh remote-cql, it allows me to login to db node.
but same not able to connect with datagrip.
Please sign in to leave a comment.
Hello,
Am I got you right that at first you try to establish ssh connection to bastion which fails? Is it possible to attach idea.log ("Help | Show Log in...") after testing connection to check recorded events?
Hey Yaroslav Bedrov, thanks for having a look into this.
Bastion connection is successful if i try with key-pair option where I provide my key passphrase file.
But I don't have option to establish another ssh tunnel, So tried to do using config which I put it as sample that is not working, seems to be not able to read or parse it properly.
Could you take a look at https://youtrack.jetbrains.com/issue/DBE-1573/Multiple-hops-SSH-tunnel-support#focus=Comments-27-2705336.0-0 ?
It looks like misconfiguration.
Hey, what if i don't have a identity file for private server?
vasily chernov I have some logs which might be helpful.
FYI, I am able to make ssh tunnel using below config.
Host bastion
Hostname 10.0.x.x
User qwerty
IdentityFile ~/.ssh/jumpcloud
Host eu1a-cql
Hostname 10.0.y.y
User qwerty
ProxyCommand ssh -W %h:%p bastion
while trying to connect with DB in general tab I am providing the cassandra db ip and Authentication type is user & password.
Some missing logs
Then remove that line from config file.
Have you tried to set up SSH tunnel in console / terminal to connect to Cassandra?
In the logs, I can see the following error:
Authentication error on host localhost/127.0.0.1:53356: Failed to login. Please re-try
It appears that you are attempting to connect to the local host. Have you tried providing the IP address of your Cassandra instance in the network where you are trying to establish the tunnel?