2013年8月現在無料で利用できるJAVA paas OpenShiftへの引っ越しNo1
忘れそうなので、書いておきます。
私の環境は、Windows7 64bitです。
後から、出てきますがレッドハットのOpenShiftに引っ越しました。
【注意点】
・既存のプロジェクトファイルをデプロイするのは、チョット コツがあります。後で書きます。
・System.out.Println();のメッセージが普通にしてたら出ません。また、エラーメッセージも出ません。後で出し方を書きます。
・CloudFoundryからの引っ越しの場合、Springが使えると思いますが、僕は上手くいかなかったので、
どうしたかを後で書きます。
・ちなみに、僕がやりたいことは、長時間のバッチを流したいだけです。Webアプリは必要ないです。
また、データベースも利用しません。
バッチを実行した結果は、WEB-INFの下にCSVファイルで書き出して、SSHでダウンロードします。
この前まで、CloudFoundryを利用していましたが、有料になったので無料のjava PAASを探していました。
最近は、無料のjava PAASほとんどないですね。
ということで、無料のjava paas レッドハットのOpenshiftに引っ越しです。
こちらは、当面無料で利用できそうです。
http://fight-tsk.blogspot.jp/2013/06/get-started-on-openshift.html
こちらのURLで手順を訳してくれていますので、そちらをもとに環境設定です。
1)コマンドラインツールの環境をセットアップします。
○rubyのインストール http://rubyinstaller.org/downloads/
重要!"Add Ruby executables to your PATH"オプションをチェックすること。
○Gitのインストール http://msysgit.github.io/
重要!"Run Git from the Windows Command Prompt"オプションをチェックすること。
○Windowsのコマンドプロンプトからgemをインストールして下さい:
$ gem install rhc
○クライアントツール最新版へ更新したい場合、gem updateコマンドを使用します:
$ gem update rhc
2)OpenShiftにサインアップします。
○下のURLのSIGNUP(画面の右上)からメルアド、パスワードなど設定する。
https://www.openshift.com/
3)コマンドラインツールrhcを使って、sshとかドメインとかの設定をしていきます。
※注意:rubyでコマンドを入力すると、DL is deprecated, please use Fiddle
というメッセージがでますが、これは無視してよいそうです。
○Windowsのコマンドプロンプトから rhc setup
以下、自分で入力した文字は、赤色です。
メッセージは、黒色です。
入力は、3回
1回目:rhc setup
2回目:yes
3回目:ドメイン名(半角) URLのdomainの部分を決めます。 好きな文字で。
http://applicationname–domain.rhcloud.com
ここから ここから ここから ここから ここから rhc setup
C:\Users\ユーザー名>rhc setup
DL is deprecated, please use FiddleOpenShift Client Tools (RHC) Setup Wizard
This wizard will help you upload your SSH keys, set your application namespace,
and check that other programs like Git are properly installed.
Using an existing token for メールアドレス to login to openshift.redhat.com
Saving configuration to C:\Users\ユーザー名\.openshift\express.conf ... done
No SSH keys were found. We will generate a pair of keys for you.
Created: C:/Users/ユーザー名/.ssh/id_rsa.pub
Your public SSH key must be uploaded to the OpenShift server to access code.
Upload now? (yes|no)yes
Since you do not have any keys associated with your OpenShift account, your new
key will be uploaded as the 'default' key.
Uploading key 'default' ... done
In order to fully interact with OpenShift you will need to install and configure
a git client if you have not already done so.
Documentation for installing other tools you will need for OpenShift can be
found at
https://openshift.redhat.com/community/developers/install-the-client-tools
We recommend these free applications:
* Git for Windows - a basic git command line and GUI client
https://github.com/msysgit/msysgit/wiki/InstallMSysGit
* TortoiseGit - git client that integrates into the file explorer
http://code.google.com/p/tortoisegit/
Checking common problems
Your private SSH key file should be set as readable only to yourself. Please
run 'chmod 600 C:\Users\ユーザー名\.ssh\id_rsa'
Checking your namespace ... none
Your namespace is unique to your account and is the suffix of the public URLs we
assign to your applications. You may configure your namespace here or leave it
blank and use 'rhc create-domain' to create a namespace later. You will not be
able to create applications without first creating a namespace.
Please enter a namespace (letters and numbers only) |
Your domain name 'ドメイン名' has been successfully created
Checking for applications ... none
Run 'rhc create-app' to create your first application.
Do-It-Yourself 0.1 rhc create-app
JBoss Application Server 7 rhc create-app
JBoss Enterprise Application Platform 6.0 rhc create-app
jbosseap-6.0
Jenkins Server 1.4 rhc create-app
jenkins-1.4
Node.js 0.6 rhc create-app
PHP 5.3 rhc create-app
Perl 5.10 rhc create-app
Python 2.6 rhc create-app
Python 2.7 rhc create-app
Python 3.3 rhc create-app
Ruby 1.8 rhc create-app
Ruby 1.9 rhc create-app
Tomcat 6 (JBoss EWS 1.0) rhc create-app
jbossews-1.0
Tomcat 7 (JBoss EWS 2.0) rhc create-app
jbossews-2.0
Zend Server 5.6 rhc create-app
You are using 0 of 3 total gears
The following gear sizes are available to you: small
Your client tools are now configured.
C:\Users\ユーザー名>
ここまで ここまで ここまで ここまで ここまで rhc setup