Tag Archives: cloudfoundry

CloudFoundry MicroCloud

Cloud Foundry have created a Micro Cloud that you can download onto your desktop !


AMI MySQL cluster database access

One of the challenges when deploying MySQL databases and clusters on Amazon EC2 AMIs is that the IP address of the AMIs are assigned dynamically. If your topology involves only a single instance then you can simply use localhost to access your MySQL server.

Cloud Foundry solves this problem by ensuring that ‘dbmaster’ always resolves to the IP address of the MySQL server or lets you launch the application with system property that specifies the MySQL server hostname.

Using the JVM option “-DdbHostName=${databasePrivateDnsName}” sets the the system property’dbHostName’ to the MySQL server’s host name. A Spring/Java application can then use a PropertyPlaceholderConfigurer bean to substitute this value into the database url, e.g. jdbc:mysql://${dbHostName}:3306/.