如何部署一个Clojure的Web应用程序到Amazon EC2(弹性AWS魔豆+ Leiningen +的Compojure +戒指+ Tomcat的) [英] How to deploy a clojure web application to Amazon EC2 (AWS Elastic Beanstalk + Leiningen + Compojure + Ring + Tomcat)

查看:227
本文介绍了如何部署一个Clojure的Web应用程序到Amazon EC2(弹性AWS魔豆+ Leiningen +的Compojure +戒指+ Tomcat的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题,
我的IDE是IntelliJ IDEA的12.1.4,
什么工具或插件,我需要能够 Clojure的部署Web应用程序到Amazon EC2?

AS title,
My IDE is intellij idea 12.1.4 ,
What toolkit or plugin do I need to be able to deploy clojure web application to Amazon EC2?

是否有一步的解决方案,任何链接或引用,或一步? 谢谢

Are there any link or reference or step by step solution ? thank you

推荐答案

如果你只是部署,没有其他自定义的基础设施,然后使用EC2的WAR文件直接是矫枉过正,有弹性豆茎会做你更轻松的需要。如果你正在成长的东西做大了,想点击的部署,然后托盘是一个伟大的工具。

If you are just deploying a war file with no other custom infrastructure then using EC2 directly is overkill and elastic beanstalk will do what you need far more easily. If you are growing something bigger, and want one click deployment then pallet is a great tool.

有很多到托盘,这是令人惊讶的编写小程序做这样的事情(以及更多),一个伟大的图书馆。花一些时间来了解'节点''组'的托盘理念融合等,给自己足够的耐心。一旦你用托盘会感觉像变魔术一样。

There is a lot to Pallet and it is a great library for writing amazingly small programs for doing this sort of thing (and much much more). Take some time to understand the pallet concepts of 'node' 'group' 'converge' etc, and give yourself plenty of patience. Once you get going with pallet it feels like magic.

开始的地方与托盘入门指南。经过Hello World示例,这将确保您的AWS账户设置和密钥,他们需要的人。然后你就可以WITE一点的Clojure code,创建你的web应用上的最新版本的实例。

The place to start is with the pallet getting started guide. go through the hello world example which will make sure your aws account is set up and keys are where they need to be. Then you can wite a bit of clojure code that creates an instance with the latest version of your webapp on it.

您需要:

  • 在托盘0.8 +
  • 的托盘java的箱
  • 在一组规范的安装java和复制WAR文件了。
  • 托盘雷音插件是好的,虽然不要求
  • 大量的耐心把事情启动和运行。

一组规范本的一个大致的轮廓看起来有点像

A rough outline of a group spec for this would look a bit like

(def java-server
  (java/server-spec
   {:vendor :oracle
    :components #{:jdk}
    :version [7]})) 

(def webserver
 (node-spec
   :image {:os-family :ubuntu} 
   :hardware {:min-cores 1 :min-ram (* 2 1024)}
   :phases {:configure
            (plan-fn
               (package-manager :update)
               (package "tomcat7")
            (remote-file "/var/lib/tomcat7/webapps/myapp.war"
               :local-file "target/myApp.war"
               :owner "tomcat7"
               :group "tomcat7"
               :mode 755))

(def web-group
 (group-spec
   "my-websertvers"
   webserver
   :extends [java-server]))

你会调用汇聚与网络组来创建或更新服务器。

you would then call converge with web-group to either create or update your servers.

和请跳上#pallet freenode上,在那里友好的人(包括之间〜10我的自我:00〜18:00美国西部)的热心帮助。

and please hop onto #pallet on freenode, where the friendly folks (my self included between ~10:00 and ~18:00 US-west) are eager to help.

这篇关于如何部署一个Clojure的Web应用程序到Amazon EC2(弹性AWS魔豆+ Leiningen +的Compojure +戒指+ Tomcat的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆