Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grails cloud-hosting recommendation [closed]

I'm looking for cloud-hosting for a Grails app. In the past, I've tried several including CloudFoundry, JElastic, AppFog, but could never successfully deploy the app. The app needs:

  • MySQL database
  • File system access in order to store the Searchable plugin index files and images uploaded by users

I'll only be using this site for QA, so am not concerned about performance. Obviously I'd like it to be as simple as possible to deploy the app, and I'd like to pay as little as possible for the hosting.

I've already tried using the CloudFoundry Grails plugin to deploy to CloudFoundry, but without any success.

like image 991
Dónal Avatar asked May 04 '13 11:05

Dónal


1 Answers

I have successfully hosted Grails based websites on Amazon EC2. To reduce the cost, I used small reserved instance. I think It's ok to use Amazon EC2 AMI for temporary files such as searchable index files since you can always re-index if AMI crashes.

To store user images, I used Amazon S3 using Grails AWS SDK plugin (http://grails.org/plugin/aws-sdk). It is very easy to upload files to S3 using Amazon SDK http://blanq.github.io/grails-aws/1.2.12.1/index.html -

To Upload a file with public read permissions.

amazonWebService.s3.putObject(new PutObjectRequest('some-grails-bucket', 
'somePath/someKey.jpg', new  File('/Users/ben/Desktop/photo.jpg')).withCannedAcl( CannedAccessControlList.PublicRead ) )

Download a file.

amazonWebService.s3.getObject(new GetObjectRequest('some-grails-bucket', 
'somePath/someKey.jpg'), new File('/Users/ben/Downloads/photo.jpg'))

Delete a file.

amazonWebService.s3.deleteObject('some-grails-bucket', 'somePath/someKey.jpg')

I hope this helps.

like image 154
Ben W Avatar answered Sep 20 '22 07:09

Ben W