これはCepheus-Brokerの管理ガイドです。
要件¶
- JAVA 8
- Maven 2 (ビルド専用)
- OS/CPU supported by Sqlite-JDBC
ソースからのビルド¶
Github からコードを入手する :
git clone https://github.com/Orange-OpenSource/fiware-cepheus.git
cd fiware-cepheus/cepheus-broker
スタンドアロンの JAR と Debian パッケージをビルドするには、maven が必要です :
mvn clean package
インストール¶
Cepheus-Broker をインストールするには、スタンドアロンの JAR をダウンロードするだけです。
Maven を使った Sonatype Central repository リポジトリからのダウンロード¶
maven が使える場合は、次のコマンドを実行できます :
mvn dependency:get -DgroupId=com.orange.cepheus -DartifactId=cepheus-broker -Dversion=XXXX -Dtransitive=false
ここで、XXXXは、1.0.1-SNAPSHOT や LATEST のようなインストールしたいバージョンです。
wget を使った Sonatype Central repository リポジトリからのダウンロード¶
マシンに maven をインストールしていない場合でも、wget やブラウザを使用してスタンドアロン JAR をダウンロードできます :
wget -O cepheus-broker.jar "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=com.orange.cepheus&a=cepheus-broker&v=LATEST"
実行¶
Cepheus-Broker は SpringBoot アプリケーションです。maven でソースから直接実行することもできます :
mvn spring-boot:run
またはスタンドアロン JAR から :
java -jar cepheus-broker.jar
Debian パッケージ¶
Cepheus-Broker は、あらかじめ設定された Debian パッケージにも含まれており、Debian システムとRaspbian システムでの展開を容易にします。
ダウンロード¶
weget を使用して Sonatype Central repository リポジトリから Debian パッケージをダウンロードしてください :
wget -O cepheus-broker.deb "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=com.orange.cepheus&a=cepheus-broker&v=LATEST&p=deb"
インストール¶
dpkg を使用してインストールします :
dpkg -i cepheus-broker.deb
パッケージは自動的に以下のようになります :
/usr/lib/cepheus下にスタンドアロンのJARを配置/etc/cepheus/broker.properties下に設定ファイルをセットアップ/etc/init.d/cepheus-broker下にcepheus-brokerinit.d 起動スクリプトを追加- マシンの起動時に
cepheus-brokerをポート8081で開始 /var/log/cepheus/broker.log下にログを置く
実行¶
Cepheus-Broker デーモンを起動および停止するには、共通の service コマンドを使用します :
service cepheus-broker start
service cepheus-broker stop
service cepheus-broker restart
設定¶
いくつかのアプリケーション設定を編集するには :
- ソースからビルドするときの
src/main/resources/application.propertiesファイル - Debianパッケージの
/etc/cepheus/broker.propertiesような外部設定
これはアプリケーション・プロパティの短いリストです :
| Name | Description | Default Value |
|---|---|---|
| server.port | broker port | 8081 |
| local.url | public URL to this instance | http://localhost:8081 |
| remote.url | URL to the remote broker (Orion) | http://localhost:8082 |
| remote.serviceName | remote broker Service Name | |
| remote.servicePath | remote broker Service Path | |
| remote.authToken | OAuth token for secured broker | |
| remote.forward.updateContext | updateContext forwarding to remote broker | true |
| logging.level.com.orange.cepheus.broker | log level | INFO |
| spring.datasource.url | DataBase url | jdbc:sqlite:${java.io.tmpdir:-/tmp}/cepheus-broker.db |
すべてのプロパティとデフォルト値は、src/main/resources/application.properties を確認してください。
コマンドライン・パラメータ¶
コマンドラインからすべてのアプリケーション・プロパティを変更することができます :
java -jar cepheus-broker.jar --property=value
例:
java -jar cepheus-broker.jar --server.port=8081
外部設定ファイル¶
アプリケーションのパッケージ化後にアプリケーション・プロパティをカスタマイズする場合は、外部プロパティファイルのデフォルトのプロパティをオーバーライドできます。
次のいずれかを実行できます :
- 現在のパス
.または./config/下にapplication.propertiesを置く -
--spring.config.locationを使用してファイルのカスタムの場所を指定 :java -jar cepheus-broker.jar --spring.config.location=/etc/cepheus/broker.properties
メトリクスとヘルス¶
アプリケーション・プロパティが持つ、Spring Boot アクチュエータ /info, /health そして /metrics エンドポイントを有効にすることができます :
endpoints.info.enabled=true
endpoints.metrics.enabled=true
endpoints.health.enabled=true
ユーザ・ガイド¶
完全なユーザ&プログラミング・ガイドはここにあります