I'm trying to import data from an SQL Server to my HIVE and I get the following error:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection
to the host ip address databaseName=SherLock2, port 1433 has
failed. Error: "null. Verify the connection properties, check that an
instance of SQL Server is running on the host and accepting TCP/IP
connections at the port, and that no firewall is blocking TCP
connections to the port.".
This is the command I'm trying to run:
sqoop import --table Sms --target-dir SherlockData/Sms --username yogevmet --password password --connect "jdbc:sqlserver://ipadress databaseName=SherLock2" --split-by UUID --hive-import -hive-table SherLock_2.sms --driver com.microsoft.sqlserver.jdbc.SQLServerDriver;
I looked up here: JDBC connection failed, error: TCP/IP connection to host failed
And everything is set as it suppose to be, does someone have any other suggestion?
Thanks
Related
hi i like to connect through an nginx to an azure sql db to have an single point of access to my network.
Goal is to access to the nginx publicip:1234 which is translated to mydb.database.microsoft.com:1433
I have configured a nginx on centos with stream addon.
config looks like:
stream {
upstream mssql {
server mydb.database.microsoft.com:1433;
server mydb.database.microsoft.com:1433;
}
server {
listen 1234;
proxy_pass mssql;
}
}
The mssql is configured to accept connections from the publicip of the nginx machine as well as has a service endpoint to the vnet where the nginx is connected to.
When i try to connect to the db through the nginx i receive the following error message:
.... connect() to IPOFDB:1433 failed (13: Permission denied) while connecting to upstream, client: MYIP server:0.0.0.0:1234 ...
The only idea why it my fail is that the outgoing ip from nginx is not the publicip which is whitelisted for the db and it does not use the vnet endpoint connection.
any ideas.
Thanks for your help.
Disable SElinux permanently and reboot
or
semanage port -a -t http_port_t -p tcp 1234
need help with setting up connection from Tableau to a server where R is installed. Installed R and Rserve in linux.Started the Rserve from R console using
library(Rserve)
Rserve()
In Tableau trying to set up connection and then test connection by providing Server name and port as 6311 I get below error
"Connected party did not properly responded after a period of time, or
established connection failed because connected host has failed to
respond"
tried chkconfig iptables off and service iptables stop but no use.
I'm using RStudio on OSX and have a local vm running Ubuntu. I'm having issues with RMySQL connecting to mysql running on the local vm via ssh. I've tried forwarding port 3307 via
ssh -L 3307:d.local.internal.com:3306 ubuntu#d.local.internal.com
followed by the following in r
con <- dbConnect(RMySQL::MySQL(), host = "127.0.0.1", user = "root", password = "pass", port=3307)
I'm still getting
Error in .local(drv, ...) : Failed to connect to database: Error: Can't connect to MySQL server on '127.0.0.1' (57)
Any ideas? I am able to successfully connect via SequelPro with the same ssh and mysql credentials.
Try
ssh -L 3307:localhost:3306 ubuntu#d.local.internal.com
I bet d.local.internal.com can't resolve d.local.internal.com hostname, because you may not have DNS entry for d.local.internal.com in the DNS server used by d.local.internal.com or for that matter a /etc/hosts entry.
Also you don't need to setup your local port to 3307, you can use 3306, provided you don't have anything listening on 3306 on your host.
I am trying to use dplyr to connect to a remote database, that I usually query through a ssh tunnel.
I first set up a ssh tunnel like the following:
alias tunnel_ncg='ssh -fNg -L 3307:127.0.0.1:3306 mysqluser#myhost mysql5 -h 127.0.0.1:3306 -P 3307 -u mysqluser -p mypassword'
At this point I can access the database by connecting to localhost:3307. For example:
mysql -h '127.0.0.1' -P 3307 -u mysqluser
If I try to access the same database through dplyr, I get an error complaining that it can't connect to the local MySQL socket:
> conDplyr = src_mysql(dbname = "mydb", user = "mysqluser", password = "mypassword", host = "localhost", port=3307)
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
My understanding is that RMySQL/dplyr are trying to looking for a socket file in the local computer, however they should really be looking for it in the remote server. Is there a way to fix this, or a work-around?
UPDATE:
If I try to connect through dbConnect/RMySQL, the connection works fine:
> dbConnect(dbDriver("MySQL"), user="mysqluser", password="mypassword", dbname="mydb", host="127.0.0.1", port=3307)
<MySQLConnection:0,1>
As silly as it sounds replacing localhost with an IP address (127.0.0.1) solves the problem.
src_mysql(
dbname = "mydb", user = "mysqluser", password = "mypassword",
host = "127.0.0.1", port=3307)
For an explanation take a look at the MySQL documentation:
On Unix, MySQL programs treat the host name localhost specially, in a way that is likely different from what you expect compared to other network-based programs.
For connections to localhost, MySQL programs attempt to connect to the local server by using a Unix socket file. This occurs even if a --port or -P option is given to specify a port number.
To ensure that the client makes a TCP/IP connection to the local server, use --host or -h to specify a host name value of 127.0.0.1, or the IP address or name of the local server.
I'm trying to do load test postgresql db using tsung.
I used pgsql.xml provided in examples folder in tsung-1.5.0.
Here's my pgsql.xml: https://github.com/processone/tsung/blob/master/examples/pgsql.xml.in
I run tsung using tsung -f test.xml -p pgsql start.
I got the following error:
ssh: connect to host localhost port 22: Connection refused
Could anyone point me out what the problem is and how to solve it?
You are using server monitoring and your SSH is not setup..
<monitoring>
<monitor host="localhost"/>
</monitoring>
Do you really want to monitor server? If not then you can comment the code and it should work fine.. If yes then you will have to set up a password less SSH to your server...