G*なクラウド ~雲のかなたに~
Upcoming SlideShare
Loading in...5
×
 

G*なクラウド ~雲のかなたに~

on

  • 3,505 views

日本 Java ユーザグループ CCC Fall 2009 でのスライドです。...

日本 Java ユーザグループ CCC Fall 2009 でのスライドです。
「G*なクラウド ~雲のかなたに~」
まわりを見渡せばクラウドの話で持ちきりです。様々なフレームワークがクラウドに対応するなか、もちろんG*なクラウド活用法も存在します。Grails でプラグインを使ってGAE/Jに対応や、Cloud Foundry(EC2)、GroovyでのGAE/J「Gaelyk」など、Grails/Groovyでのクラウドを紹介・解説します。

Statistics

Views

Total Views
3,505
Views on SlideShare
2,891
Embed Views
614

Actions

Likes
3
Downloads
22
Comments
0

5 Embeds 614

http://d.hatena.ne.jp 603
http://webcache.googleusercontent.com 6
http://www.slideshare.net 2
http://hatenatunnel.appspot.com 2
http://s.deeeki.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

G*なクラウド ~雲のかなたに~ G*なクラウド ~雲のかなたに~ Presentation Transcript

  • 2009/10/08 @JJUG CCC def speaker = new Cast(name:”T.Yamamoto”,version:”G*C-2009-10-08”)
  • ( ) DTP Web 75%Grails JGGUG( ) Grails 9-11 Grails Acegi Plugin http://d.hatena.ne.jp/mottsnite/ twitter @tyama
  • JGGUG japan grails/groovy user group
  • JGGUG japan grails/groovy user group
  • Grails CMS
  • JGGUG japan grails/groovy user group
  • Grails PaaS
  • # curl -L http://stax-downloads.s3.amazonaws.com/sdk/ stax-sdk-0.3.6-dist.zip > stax_sdk.zip # unzip stax_sdk.zip # rm stax_sdk.zip # cd stax-sdk-0.3.6 export STAX_HOME=/opt/stax-sdk-0.3.6 export PATH=$PATH:$STAX_HOME
  • ... ... dataSource { dbCreate = "update" driverClassName = "com.staxnet.jdbc.Driver" url = "jdbc:stax://jggug" username = "tyama" password = "*****" } ... ...
  • ... log4j = { appenders { null name:'stacktrace' ... ...
  • Cloud Tool grails create-app demo cd demo grails install-plugin cloud-tool.zip Config.groovy import aws.properties grails cloud-tools-deploy grails cloud-tools-describe grails cloud-tools-stop
  • war DB
  • IP
  • DB EBS
  • UPTIME
  • Apache tc Server MySQL
  • HTTPD TC
  • AWS ACCESS KEY ID KEY PAIRS
  • SSH
  • export APPENGINE_HOME=/opt/appengine-java-sdk-1.2.5 google.appengine.sdk='/opt/appengine-java-sdk-1.2.5'
  • $ grails install-plugin app-engine Do you want to use JPA or JDO for persistence? (jpa, jdo) jpa grails-app/conf/ datastore-indexes.xml persistence.xml grails-app/conf/Config.groovy GAE google.appengine.application="jggugv4" Grails
  • $ grails install-plugin gorm-jpa resources.groovy entityManagerFactory transactionManager entityManagerFactory(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean) { beanClassLoader = ref("classLoader") } transactionManager(org.springframework.orm.jpa.JpaTransactionManager) { entityManagerFactory = entityManagerFactory } datanucleus-enhancer*.jar cp $APPENGINE_HOME/lib/tools/orm/datanucleus-enhancer-1.1.4.jar lib
  • import org.datanucleus.jpa.annotations.Extension import javax.persistence.*; @Entity class Event implements Serializable { @Id @GeneratedValue (strategy = GenerationType.IDENTITY) @Extension (vendorName = "datanucleus", key = "gae.encoded-pk", value = "true") String id /** */ @Column // String eventName
  • def save = { def eventInstance = new Event(params) Event.withTransaction{ if(eventInstance.save(flush:true)) { flash.message = "Event ${eventInstance.id} created" redirect action:"show", id:eventInstance.id } else { render view:'create', model:[eventInstance:eventInstance] } } }
  • $ grails set-version 1 $ grails app-engine run
  • $ grails set-version 1 $ grails app-engine deploy $ grails app-engine package $ rm target/war/WEB-INF/lib/jul-to-slf4j-1.5.6.jar $ appcfg.sh update ./target/war
  • $ dev_appserver.sh ./war ※Windows .sh→.cmd
  • View request.setAttribute 'list', [1, 2, 3, 4] request.setAttribute 'date', new Date()   forward 'display.gtpl'
  • mailService.send to: 'foobar@gmail.com', subject: 'Hello World', htmlBody: '<bold>Hello</bold>' datastoreService.withTransaction { // your code }
  • import com.google.appengine.api.datastore.Entity def person = new Entity("person") person['name'] = " " println person['name'] person.age = 31 println person.age // person.save() // person.delete() // def q = new Query('person') def list = datastoreService.prepare(q).asList( Builder.withLimit(20).offset(0) )
  • <system-properties> <property name="file.encoding" value="UTF-8"/> <property name="groovy.source.encoding" value="UTF-8"/> </system-properties>
  • $ ./gaelyk-setup.sh myapp001
  • Grails/Groovy http://www.jggug.org/