1

First of all, English is not my native language, so I apologize in advance for any errors in my grammar.

What I'm trying to do is connect from a local hosted Glassfish Server, to a Mysql Database mounted in Openshift.

The server has already been mounted in Openshift, and I have been able to connect to it using MySQL Workbench over TCP/IP with SSH.

The problem comes with connecting from glassfish, when I try to ping the JDBC Connection Pool it gives me the following error:

 Ping Connection Pool failed for jdbc/studygroup-pool. The connection could not be allocated: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. Please check the server.log for more details. 

What I have in domain.xml

<jdbc-connection-pool driver-classname="com.mysql.jdbc.Driver" name="jdbc/studygroup-pool" res-type="java.sql.Driver">
      <property name="password" value="MysqlPassword"></property>
      <property name="user" value="MysqlAdmin"></property>
      <property name="URL" value="jdbc:mysql://127.13.73.130:3306/servicesstudygroup"></property>
    </jdbc-connection-pool>

Is there anyway to give the ssh key to glassfish to connect that way?

I'm lost in what I have to change to connect to it. If there is any information missing, please tell me what I am missing and I will provide it.

This is what i get with rhc about portforwarding

Service Local                
OpenShift
------- --------------- ---- -------------------

httpd   127.0.0.1:8080   =>  127.13.73.131:8080

httpd   127.0.0.1:8081   =>  127.13.73.133:8080

java    127.0.0.1:7600   =>  127.13.73.129:7600

java    127.0.0.1:8082   =>  127.13.73.129:8080

mongodb 127.0.0.1:27017  =>  127.13.73.132:27017

mysql   127.0.0.1:3307   =>  127.13.73.130:3306



-----------------------------------------------------------------------------------------------

And this is from env | grep MYSQL

SQL
OPENSHIFT_MYSQL_DIR=/var/lib/openshift/sshuser/mysql/

OPENSHIFT_MYSQL_DB_PORT=3306

OPENSHIFT_MYSQL_DB_HOST=127.13.73.130

OPENSHIFT_MYSQL_DB_PASSWORD=mysqlpassword

OPENSHIFT_MYSQL_IDENT=redhat:mysql:5.5:0.2.20

OPENSHIFT_MYSQL_DB_USERNAME=adminmysql

OPENSHIFT_MYSQL_DB_SOCKET=/var/lib/openshift/sshuser/mysql//socket/mysql.sock

OPENSHIFT_MYSQL_DB_URL=mysql://adminmysql:passwordmysql@127.13.73.130:3306/

OPENSHIFT_MYSQL_VERSION=5.5

OPENSHIFT_MYSQL_DB_LOG_DIR=/var/lib/openshift/sshuser/app-root/logs/

OPENSHIFT_MYSQL_LD_LIBRARY_PATH_ELEMENT=/opt/rh/mysql55/root/usr/lib64

The only thing that i have changed are the sshuser, mysql user and password.

  • Possible duplicate of [com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure](http://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link-fai) – Mark Rotteveel May 11 '16 at 10:42
  • Are you sure 127.13.73.130 is the right IP address (assuming this isn't caused by anonymization)? – Mark Rotteveel May 11 '16 at 10:43

0 Answers0