Skip to content

irixjp/openstack-sample-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

概要

Web Server - Rest Server - MySQL の3階層システムのサンプルアプリになります。 server-setup/SampleApp.png

All in One でとりあえず動かす

nova boot 時(horizonからも可能)に以下をuserdataへ設定すると、All in One 環境ですぐに動かす事が可能です。

#!/bin/bash
yum install -q -y git
cd /root
git clone https://github.com/irixjp/openstack-sample-app.git
sh /root/openstack-sample-app/server-setup/install_web.sh
sh /root/openstack-sample-app/server-setup/install_rest.sh
sh /root/openstack-sample-app/server-setup/install_db.sh
sh /root/openstack-sample-app/server-setup/web.init.sh
sh /root/openstack-sample-app/server-setup/rest.init.sh

後は Floating IPを割り当てて、ブラウザからアクセスするだけです。

設定(詳細)

  • OpenStack上で3つのインスタンスを起動して設定します。
    • web server
    • rest server
    • db server
  • nova boot 時に以下の userdata を与えます。
#!/bin/bash
yum install -q -y git
cd /root
git clone https://github.com/irixjp/openstack-sample-app.git

サーバ設定

各サーバで以下のスクリプトを実行します。

  • web server
sh /root/openstack-sample-app/server-setup/install_web.sh
  • rest server
sh /root/openstack-sample-app/server-setup/install_rest.sh
  • db server
sh /root/openstack-sample-app/server-setup/install_db.sh

アプリ設定

endpoint.conf にDBサーバのIPアドレスと、ReSTサーバのIPアドレスを記述します。

/root/openstack-sample-app/endpoint.conf
[rest-server]
rest_host = 127.0.0.1 ← 実際のアドレスへ書き換え
rest_endpoint = https://%(rest_host)s:5555/bbs
  
[db-server]
db_host = localhost ← 実際のアドレスへ書き換え
db_endpoint = mysql:https://user:password@%(db_host)s/sample_bbs?charset=utf8

起動

Webサーバ

sh /root/openstack-sample-app/server-setup/web.init.sh

ReSTサーバ

sh /root/openstack-sample-app/server-setup/rest.init.sh

DBサーバ

設定スクリプトの中で起動されるため、特に起動は必要ありません。

動作確認

ブラウザでWebサーバのアドレスへアクセスしてください。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published