Closed StBurcher closed 7 years ago
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/145911913
The labels on this github issue will be updated when the story is started.
@StBurcher looks like you have a hibernate error in your logs:
2017-05-23T10:08:44.68+0200 [APP/PROC/WEB/0] OUT Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
Have you configured the MySQL driver in your application.properties
?
@zankich I'm using the normal Spring Music Demo. It works find on Pivotal.io without any change. Only on my installation.
@StBurcher Do you have a load balancer configured in front of the MySQL Proxy instances? If not, the first proxy ip is provided to apps as the host. If the proxy ip is being used, you need to ensure that the CF Application Security Groups are configured to allow access to the Proxy vm.
@utricularian There is no Loadbalancer. Both CF and MySQL Proxy are installed in the same OpenStack Project. Using cf env shows the following.
System-Provided:
{
"VCAP_SERVICES": {
"p-mysql": [
{
"credentials": {
"hostname": "10.0.0.41",
"jdbcUrl": "jdbc:mysql://10.0.0.41:3306/cf_a5563db4_0cfe_41a4_a095_bf8531a72879?user=OYDfM19F2qPvpwEP\u0026password=VndIVlPYzTqPrfgi",
"name": "cf_a5563db4_0cfe_41a4_a095_bf8531a72879",
"password": "VndIVlPYzTqPrfgi",
"port": 3306,
"uri": "mysql://OYDfM19F2qPvpwEP:VndIVlPYzTqPrfgi@10.0.0.41:3306/cf_a5563db4_0cfe_41a4_a095_bf8531a72879?reconnect=true",
"username": "OYDfM19F2qPvpwEP"
},
"label": "p-mysql",
"name": "mysql",
"plan": "100mb",
"provider": null,
"syslog_drain_url": null,
"tags": [
"mysql"
],
"volume_mounts": []
}
]
}
}
10.0.0.41 is the correct address.
CF security-groups shows only the standard AGS. public_networks or DNS. How do I have to configure AGS?
@StBurcher You'll need to create an application security group that at least allows TCP access to the proxy ip address and then bind that application security group as a "running" application security group.
https://docs.cloudfoundry.org/concepts/asg.html#asg-individual
That helped. Thank you.
Hello Team,
We created a MySQL instance on PCF and bound it to our application hosted on PCF. The app runs fine if we use localhost in local machine but when we try accessing the PCF instance it fails in both local and in PCF. The host does not seem to be a valid one. When I try to ping the same, it says unknown host.
Working in local :- jdbc:mysql://localhost:3306
Not working if pointed to pcf instance :- jdbc:mysql://q-n4s3y1.q-g84581.bosh:3306
Error logs:- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 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.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_212]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_212]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_212]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_212]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.46.jar:5.1.46]
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990) ~[mysql-connector-java-5.1.46.jar:5.1.46]
at com.mysql.jdbc.MysqlIO.
2019-11-15 15:03:55.937 WARN [-,,,] 57818 --- [ main] o.s.b.a.orm.jpa.DatabaseLookup : Unable to determine jdbc url from datasource
org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta-data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Hi @kalyansagi,
BOSH DNS hostnames are only resolvable from a BOSH-deployed VM - so either as a BOSH job that's part of a BOSH deployment, or when you've pushed an app using cf push
to Diego cells that have been BOSH deployed.
If you wish to access a mysql instance from outside of BOSH VMs, you can manually resolve the BOSH DNS hostname in the binding using an app. Here's an example that you can use: dns-lookup
PS - this is a super-old issue. If you continue to have troubles, I suggest you open a new GitHub issue or visit us on Cloud Foundry slack for more help!
Hi,
My environment is CF 257 with Diego 1,14.1 and CF-Mysql 34. I'm facing the problem to start an application with a bind mysql service. The application is Spring-Music. This application works without a bind service. I can create a service (cf create-service p-mysql 100mb mysql) and bind it.
But, Restaging the application fails.