これは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-SNAPSHOTLATEST のようなインストールしたいバージョンです。

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-broker init.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 ような外部設定

これはアプリケーション・プロパティの短いリストです :

NameDescriptionDefault Value
server.portbroker port8081
local.urlpublic URL to this instancehttp://localhost:8081
remote.urlURL to the remote broker (Orion)http://localhost:8082
remote.serviceNameremote broker Service Name
remote.servicePathremote broker Service Path
remote.authTokenOAuth token for secured broker
remote.forward.updateContextupdateContext forwarding to remote brokertrue
logging.level.com.orange.cepheus.brokerlog levelINFO
spring.datasource.urlDataBase urljdbc: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

ユーザ・ガイド

完全なユーザ&プログラミング・ガイドはここにあります