external db connection from EMR (Sqoop or Spark) using proxy - apache-spark

external db connection from EMR (Sqoop or Spark) using proxy:
I am trying to connect MS SQL Server DB using Sqoop eval command but i am getting connecion refused error as it is external DB from m current system and required to attached proxy .
is there any way to use proxy in Sqoop or Spark command .
sqoop-eval
--connect "jdbc:sqlserver://..."
--username dbuser
--password dbpassword
--query "Select * from dbname.tablename"
Getting connection failed error ---make sure that tcp connection to the port are not blocked by the firewall ?
Anyone can help me to get how i can pass proxy detail here(i have proxy : hostname , user and password )
Note:
Also i can use spark.read.jdbc as well if there is no way in Sqoop
Currently i am using EMR and connection of the external DB is open (i can telnet to db host)

Related

Why connection to postgres from nodejs is not working?

I have back-end created in nodejs hosted on Debian server using postgres 14.
the Nodejs listenning on port 5000, and when I try to connect to postgres using port 5432, I am getting the following reponse from Postman:
"Password is invalid".
I was trying the postgres role, and to create a new role, and problem is the same.
I was installing postgres on my Windows 10 computer, and all works fine in my localhost, but on the remote server not.
My Nodejs back-end, and postgres are on the same computer, but each role I've tryed won't connect to the database.
There is pg_hba.conf in /etc/postgres/14 on your server you have to add:
host username database 0.0.0.0/0 md5
This would allow connection to database from any host to username using password authentication.
Also there is a pg.conf or postgres conf
There is line allow_connections the value should be '*'
allow_connections='*'
This would generally allow connections to postgres running on that server
Guide https://coderwall.com/p/cr2a1a/allowing-remote-connections-to-your-postgresql-vps-installation
don’t forget you have to reload postgres after config change:
systemctl reload postgres

Ntopng can't connected with clickhouse

I have a problem with my ntopng M Entreprise, i want to connect clickhouse remote server so i added
-F="clickhouse;IP#9004;ntopng;default;MyPassword" in a file ntopng config for connect with clickhouse server,
# -d=/var/lib/ntopng
#
# -q|--disable-autologout
# Disable web interface logout for inactivity.
#
# -q=
-F="clickhouse;IP#9004;ntopng;default;MyPassWord"
then when i check connection Clickhouse on interface web i can see Clickhouse was connected but i see in my System ntopng said:
Unable to execute 'cat /var/db/ntopng/tmp/clickhouse/clickhouse-1-alert-83952033.1649775538.sql | /usr/local/bin/clickhouse-client --port 9000 --host "10.0.x.x" --user "default" --password "xxx" -d "ntopng" 2>&1'
and all the flows was save in ntopng server
also port 9000 and 9004 was open on server Clickhouse.
so how can i resolve this problem and how i can make all flow will save in only clickhouse server ?
thanks you

Cloud9 DB to mLab DB "Failed: error connecting to db server: no reachable servers"

I've looked at the similar questions but all are running local mongodb instances and the solutions are over my head.
I'm a newbie trying to port my database info from my Cloud 9 mongodb installation to an mLab database. I'm using the exact pre-loaded string that mLab provides you, and getting "Failed: error connecting to db server: no reachable servers"
mongoimport -h ds113892.mlab.com:13692 -d yelpcamp -c campgrounds -u <myusername> -p <mypassword> --file ~/workspace/YelpCamp/FinalDeployed/campexport.json
I can connect to the server with a mongo shell, but above command doesn't find a server. I've tried it with and without mongod running in the background. Super confused! Would appreciate any help.

Cannot create redis cluster (Sorry, can't connect to node)

I'm trying to follow the redis cluster tutorial but whenever I try to run:
./redis-trib.rb create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 \
127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005`
I get the error:
[ERR] Sorry, can't connect to node 127.0.0.1:7000
The server is running and I can connect to port 7000 using
redis-cli -p 7000
What am I missing?
Turns out I had REDIS_URL set in .bashrc from a previous project. Apparently the redis gem was setting the password from that url for ALL redis connections (even though I was not using the url for my cluster).
Thanks to soveran for pointing out this posibility in this question

Using Navicat to login to Postgresql via SSH - what are the correct settings?

I am trying to log into PostgreSQL on my EC2 server via SSH using Navicat.
I get the following error message:
"80070007: SSH Tunnel: Socket error on connecting. WSAGetLastError return 10061($274D)"
On the server, the "role" postgres already exists, and there is already a database called postgres. I have assigned a password to postgres (using ALTER NAME command via Putty).
The SSH settings I am using in Navicat are:
Port: 5432
User Name: [admin user name]
Authentication Method: Public Key
The Connection settings are:
Host Name: localhost
Port: 3306
Initial Database: postgres
User Name: postgres
Password: [password]
When I connect to the MySQL server on the same machine, the settings are exactly the same except for:
SSH to Port 22
User Name (for connection): root (with corresponding password)
I have tried the SSH to port 22, in which case the error message is:
"could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" and accepting TCP/IP connections on port 60122?
received invalid response to SSL negotiation:4"
Any ideas on what settings I need to change to get this to work?
Your config seems to be very wrong.
ssh port should be not 5432, but 22 (ssh default).
postgresql port should be not 3306 (this is actually MySQL), but 5432 (postgres default)
To verify your setup, try ssh-ing into your EC2 instance manually.
After you ssh in, check if you can execute "telnet localhost 5432".
If you see an error immediately, that would mean that postgres server is not running.
If you see nothing - this is good sign and means that Postgres is running.
You can quit from this by Ctrl-], q, Enter.
Note that EC2 instances may require you to use ssh public key authentication (not a password). In this case, you will have to find option in Navicat to provide such a key.

Resources