HeroKu入门
来源:互联网 发布:mysql update where 编辑:程序博客网 时间:2024/05/09 10:04
1、start
- a free Heroku account
- Java installed
- Maven 3 installed
In this step you will install the Heroku Toolbelt. This provides you access to the Heroku Command Line utility, as well as git and Foreman, tools you’ll use in later steps.
Once installed, you can use the heroku
command from your command shell.
Git Bash
application to open a command shell on Windows. A shortcut for this application was added to your desktop as part of the Toolbelt installation.Log in using the email address and password you used when creating your Heroku account:
$ heroku loginEnter your Heroku credentials.Email: java@example.comPassword:Could not find an existing public key.Would you like to generate one? [Yn]Generating new SSH public key.Uploading ssh public key /Users/java/.ssh/id_rsa.pub
Press enter at the prompt to upload your existing ssh
key or create a new one, used for pushing code later on.
To check that your key was added, type heroku keys
. If your key isn’t there, you can add it manually by typing heroku keys:add
. For more information about SSH keys, seeManaging Your SSH Keys.
3、deploy
In this step, you will prepare a simple application that can be deployed.
Execute the following commands to clone the sample application:
$ git clone https://github.com/heroku/java-getting-started.git$ cd java-getting-started
You now have a functioning git repository that contains a simple application as well as apom.xml
file, which is used by Java’s dependency manager, Maven.
In this step you will deploy the app to Heroku.
Create an app on Heroku, which prepares Heroku to receive your source code:
$ heroku createCreating warm-eyrie-9006... done, stack is cedarhttp://warm-eyrie-9006.herokuapp.com/ | git@heroku.com:warm-eyrie-9006.gitGit remote heroku added
This also creates a remote repository (called heroku
) which it configures in your local git repo. Heroku generates a random name (in this case warm-eyrie-9006
) for your app - you can pass a parameter to specify your own, or rename it later with heroku apps:rename
.
Now deploy your code:
$ git push heroku masterInitializing repository, done.Counting objects: 68, done.Delta compression using up to 4 threads.Compressing objects: 100% (19/19), done.Writing objects: 100% (68/68), 7.07 KiB | 0 bytes/s, done.Total 68 (delta 22), reused 65 (delta 22)-----> Java app detected-----> Installing OpenJDK 1.7... done-----> Installing Maven 3.0.3... done-----> executing /app/tmp/cache/.maven/bin/mvn -B -Duser.home=/tmp/build_4244c199-7f9b-4f62-bf60-bbd0aff3f978 -Dmaven.repo.local=/app/tmp/cache/.m2/repository -DskipTests=true clean install [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building helloworld 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.4/maven-dependency-plugin-2.4.pom...-----> Discovering process types Procfile declares types -> web-----> Compressing... done, 62.7MB-----> Launching... done, v7 http://warm-eyrie-9006.herokuapp.com/ deployed to HerokuTo git@heroku.com:warm-eyrie-9006.git * [new branch] master -> master
The application is now deployed. Ensure that at least one instance of the app is running:
$ heroku ps:scale web=1
Now visit the app at the URL generated by its app name. As a handy shortcut, you can open the website as follows:
$ heroku open
Heroku treats logs as streams of time-ordered events aggregated from the output streams of all your app and Heroku components, providing a single channel for all of the events.
View information about your running app using one of the logging commands, heroku logs
:
$ heroku logs --tail2014-08-08T13:55:07.254053+00:00 heroku[web.1]: State changed from starting to up2014-08-08T13:55:05.214125+00:00 heroku[web.1]: Starting process with command `java -Xmx384m -Xss512k -XX:+UseCompressedOops -cp target/classes:target/dependency/* Main`2014-08-08T13:56:08.662643+00:00 heroku[router]: at=info method=GET path="/" host=warm-eyrie-9006.herokuapp.com request_id=f99b4889-1b16-4862-876d-4f752ad3d843 fwd="94.174.204.242" dyno=web.1 connect=1ms service=3ms status=200 bytes=579
Visit your application in the browser again, and you’ll see another log message generated. Press Control+C
to stop streaming the logs.
- HeroKu入门
- heroku
- heroku
- heroku部署
- HeroKu 试用
- heroku使用
- Heroku工具
- heroku command
- Heroku+Wordpress
- Heroku的架构
- GAE和heroku
- heroku 使用笔记
- rails heroku 部署
- Heroku部署错误
- deploy on heroku
- HeroKu 的架构设计
- perl on heroku
- heroku 云服务器使用
- 2015网易游戏校园招聘笔试题 研发岗
- Letex 学习: Subscripts and Superscripts
- 解决企业考勤管理的常见病
- php中关于mysqli和mysql的解析
- asp SQL 对象关闭时,不允许操作 错误
- HeroKu入门
- 打开Tomcat服务器网页部署界面的配置
- 东莞网站优化哪里好
- Storyboard启动过程
- android Matrix原理
- 从subversion开始(svn安装配置全过程(+全套安装文件与配置文件))
- 深入探讨Java类加载机制
- UVa OJ 160
- java 时间格式