首先,英语不是我的母语,所以我提前为我的语法错误道歉。
我要做的是从本地托管的Glassfish服务器连接到Openshift中安装的Mysql数据库。
服务器已经安装在Openshift中,我已经能够使用MySQL Workbench通过TCP / IP和SSH连接到它。
从glassfish连接时出现问题,当我尝试ping JDBC连接池时,它给出了以下错误:
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.
我在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>
无论如何都要给这些玻璃鱼提供ssh密钥吗?
我迷失了我必须改变以连接到它。如果缺少任何信息,请告诉我我缺少的内容,我会提供。
这是我用rhc关于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
-----------------------------------------------------------------------------------------------
这是来自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
我唯一改变的是sshuser,mysql用户和密码。