Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does anyone have any experience using CloudFoundry with Grails?

I am at the point with my Grails app that I want to deploy it up onto Amazon EC2 so I can start showing it to people. I have a little experience using EC2 "manually" to put other projects onto the web, but I was hoping to find something which made the deployment cycle a little more manageable. In steps CloudFoundry.

I have read through the web site and watched the tutorials, and on the face of it I like what I see. However, before I commit to it I wondered whether any of you have experiences to share from the coal face.

Specifically I am going to be deploying a MySQL database along with the app and it's not clear what exactly you need to supply (SQL scripts?) and how to best configure my project to deploy through CloudFoundry so that the host name is configured correctly. I also have a small amount of standard rows which I insert in my BootStrap.groovy and I wonder whether that stuff makes it through deployment.

Lastly, it is free at the moment, but they are sayin they will introduce charging later. Are there any open source alternatives that it may be better to investigate in case CloudFoundry ends up being expensive?

Thanks

like image 452
Simon Avatar asked Feb 04 '10 10:02

Simon


1 Answers

I have a little experience with CloudFoundry. They have been so kind to sponsor the GR8Conf website, deployed through their service. For configuring the SQL, it appears to me, that the simple solution is to use the CloudFoundry plugin, and enter

    cloudFoundry.db.schemaName="myName"

in the config/CloudFoundry.groovy file.

In your config/DataSource.groovy you should have:

    production {
        dataSource {
            driverClassName = 'com.mysql.jdbc.Driver'
            dbCreate = "update"
            url = "jdbc:mysql://localhost/myName" // or url = "jdbc:mysql://${System.getProperty("dbHostName", "localhost")}/myName"
            dialect = 'org.hibernate.dialect.MySQLDialect'
            username = "myName_user"
            password = "myName_password"
        }
    }

(I got some of this info from: http://www.cloudfoundry.com/getting_started.html)

I do not think that you have to supply additional SQL scripts. What you define in your BootStrap will make through deployment.

On pricing, I have no ideas. I'd suggest you write to their support to ask.

On a side notice: The www.gr8conf.org website is not running on EC2 yet, but that is beacuse I have not yet figured out, how to back up my database from EC2 to S3, and that's rather important, because when an EC2 instance ends, everything in it is lost, if not backed up. /Søren

like image 108
sbglasius Avatar answered Nov 01 '22 09:11

sbglasius