English 中文(简体)
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

问题回答

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





相关问题
grails + gwt request handling via controllers

I am new to gwt. I am trying to integrate gwt+grails.Can anybody provide me a good example for handling the request using grails controllers and not a custom servlet.I will be really thankful if ...

Error loading the grails gwt module xml

I ve installed the plugin from this article by Peter http://www.cacoethes.co.uk/blog/groovyandgrails/the-command-pattern-w.... While compile time its not able to find the module file which is present ...

Sorting Objects Based on Custom Domain Class Methods

I have a domain class, in which I ve defined some methods which give the object a score based on different algorithms (eg. popularity). I now want to retrieve a list of these objects sorted by one of ...

Grails Packaging and Naming Conventions

Packaging Controllers, Services,etc. i.e. - com.company.controllers - com.company.services Is this a good practice or should be avoided by all means?? Another worth mentioning problem I encountered ...

Hibernate/GORM: collection was not processed by flush()

I have an integration test in my Grails application that fails when I try to save an entity of type Member invitingMember.save(flush: true) This raises the following exception org.hibernate....

热门标签