I am very New with Hbase, its really different from RDBMS. I developed a simple application and trying to configure it to remote server 162.18.17.55. I am getting connection refusing error. I am unable to to forward to check where it went wrong, when i type zk_dump in Putty , then i got the respective server details, I can login into putty and tables into database, but when i use java client i am not able to connect to server. please can any one guide me this process and issue
When you are connecting to Zookeeper it returns HadoopMaster as host instead of the ip address since you put HadoopMaster in your core-site.xml file. Now you need to add HadoopMaster in your /etc/hosts file to be able to recognize the host address. Add this line to your host file
162.18.17.55 HadoopMaster
Related
I am trying to start H2 in server mode to connect an application from another computer. But no matter how hard I have tried, I have not succeeded.
I have seen the documentation and to start the server from the command line is executed:
java -cp h2-2.1.214.jar org.h2.tools.Server -tcpAllowOthers
output:
TCP server running at tcp://127.0.1.1:9092 (others can connect)
PG server running at pg://127.0.1.1:5435 (only local connections)
Web Console server running at https://127.0.1.1:8082 (others can connect)
now from the other pc, as I understand I must execute the connection in the following way:
jdbc:h2:tcp://[server][:port]/[path]/[databaseName]
then it should be:
jdbc:h2:tcp://127.0.1.1:9092/home/mateo/database
But I have read that 127.0.1.1 only works locally. I have also noticed that when I open H2 Console in the examples I have seen, the machine's ip appears, that is to say: 192.168.X.
What am I doing wrong?
(Update)
I am currently using Linux.
I have launched the server from Windows and managed to connect it from Linux successfully following the above steps. But, I still don't understand why it doesn't work in Linux, in Windows it loads the server with the IP address of the machine. It makes me think that I have to do some additional configuration for Linux.
server running
You need to replace local IP address in your JDBC URL with real non-local IP address of your server (jdbc:h2:tcp://127.0.1.1:9092/*** -> jdbc:h2:tcp://192.168.1.4:9092/***, for example). H2 listens all network interfaces of the host, it doesn't matter which address was reported in “runnig at …” message.
You also may need to protect ports 8082 and 9092 from connections from untrusted systems if you have them in your internal network and from connections from external network (make sure your router or whatever you have doesn't redirect connections to the host with database server).
My idea is like this: The provider does not allow external mysql requests. I have been searching for hours for a solution to connect local java with remote server java. The remote java server would then make the mysql request and send it back.
Any ideas/Links for me?
You could do this with port forwarding, you can use ssh to setup a tunnel. So there is no need to write a java server program.
The last link have an example of your exact problem, though it is connecting to a PostgreSQL database, I translated that info to MySQL below.
An example here is when you need to connect to a database console, which only allows local connection for security reasons. Let’s say you’re running MySQL on your server, which by default listens on the port 3306.
$ ssh -L 9000:localhost:3306 user#example.com
The part that changed here is the localhost:3306, which says to forward connections from your local port 9000 to localhost:3306 on your server. Now we can simply connect to our database.
$ mysql -h localhost -p 9000
You should now be able connect your local java jdbc program with the url jdbc:mysql://localhost:9000/dbname and it will be tunneled to the remote database which would see your tunneled connection as a local connection.
Connection c = DriverManager.getConnection("jdbc:mysql://localhost:9000/dbname","username", "password");
hello guys i have seen similar threads concerning my question but couldn't solve my problem. i am trying to remotely connect to the mysql database hosted on cpanel through my netbeans. i have added my ip address as a host to be allowed remote access. the cpanel ip address was given as https:197.211.45.2:2087. the username given as 'root' and the password also given. in my netbeans i try connecting to the database using the stated parameters and the database name but it wouldnt just connect. i have also tried using the default mysql port it still wouldnt work. if there is anything wrong i have done please put me aright. thanksthe image.. i have attached a snapshot. thanks
It's seems that MySQL port is not added in server firewall and due to that you are getting this issues. Please add port 3306 in firewall and check again.
Under cPanel there is usually 'Remote MySQL' tool which allows you to enter the IP addresses that are allowed to connect into the host.
i want to add database to my netbeans java project using ip address.
my question is that when i specify hostname by name that is "localhost" followed my correct details in the new connection wizard in netbeans connection establishes succesfully. this is as shown below.
but when i specify host by specifying ip address of my own computer that is localhost connection doesn't get established. same is shown below
well my motive is not to put ip of localhost but of another pc for remote database sharing over internet. but i think the problem lies in the method of specifying host using ip. if i get it right database sharing might work between different hosts as well.
also any other methods of sharing postgres database over the internet are also welcome.
i am a newbie in java as well as netbeans so any help is appreciated.
Your sense of thinking that localhost is your IP-Address is itself wrong!You need to have a loop-back address which will direct your operations to itself and not as the case of your IP-Address shown in ipconfig command.
You need to specify this 127.0.0.1 as the IP-Address.
127.0.0.1 is the most-commonly used IPv4 loopback address.
Try this :- jdbc:postgresql://127.0.0.1:5432/nic_project_db
localhost means this computer. It is a hostname that the computer's
software and users may employ to access the computer's own network
services via its loopback network interface. Using the loopback
interface bypasses local network interface hardware. // Taken from Wikipedia.
For future reference to anyone that might have same question here is solution:
In the postgresql database folder open up the postgresql.conf file. Add the following line:
listen_addresses = '*'
Then open up the pg_hba.conf file and add the following line:
host all all 0.0.0.0/0 md5
I just want to access the database in another system from current system. In that second system, i had already created a derby database which is in built in netbeans. I tried to access that database by changing the ip address instead of localhost in "jdbc:derby://localhost:1527/course".
But it shows java.net.ConnectException: Error connecting to server 10.6.3.3 on port 1527 with message connection timed out. How can i resolve this.. Please help me
You can run derby on two ways : embedded or server.
so first step is you need to run derby on server mode.However by running derby on server mode still only localhost can have access to database.
To give access to other IP's you need to run server with option : -h "0.0.0.0"
On windows : /pathtoderby/bin/startNetworkServer.bat -h "0.0.0.0"
On linux : /pathtoderby/bin/startNetworkServe.ksh =h "0.0.0.0"
Note: the reason you should not allow network access is security as derby is single user and plain text. before over network access make sure to read this topics to make sure you give secure access :
http://db.apache.org/derby/papers/DerbyTut/ns_intro.html