6. 2018年3月15日現在
Environment ID / Collection ID / Cofiguration ID
Watson Discovery画面で、「Launch tool」をクリックし、Web上の管理UIであ
る「Watson Discovery Tooling」を起動します。起動後、作成済みのコレク
ションを選択します。選択したコレクションに、PostgreSQLを接続します。
Watson Discovery Data Crawlerでは、作成済みのコレクションに接続する
ための3つのIDを使用します。
コレクション画面で、「Use this collection in API」をクリックすることで、左図
のように表示されますので、それぞれ、メモします。
6
7. 2018年3月15日現在
Watson Discovery Data Crawler ダウンロード
ここからの作業は、Linux上で実行してください。
Linux上のWebブラウザでWatson Disocvery画面にアクセスし、「管理」にて、Intended Use の説明から、Linux用のインストー
ラーをダウンロードします。Red Hat/Cent OS系 または、Ubuntu系が対象です。ここでは、シェアが最も多いUbuntu系を想定し
ているため、「DEB」をクリックします。
7
10. 2018年3月15日現在
設定ファイルの編集(1)
crawler.conf を編集します。
# The configuration key within this block to pass to the chosen input adapter. の直下を次のように書き換え。
config = "../connector_framework", に書き換え。 /の前に、ドットを2つ追加。
#crawl_config_file = "connectors/filesystem.conf", の下に、
crawl_config_file = "connectors/database.conf", を追記。
#crawl_seed_file = "seeds/filesystem-seed.conf", の下に、
crawl_seed_file = "seeds/database-seed.conf", を追記。
# Supply "database" when using the Database connector. の直下を次のように書き換え。
extra_jars_dir = "database", に書き換え。
10
11. 2018年3月15日現在
設定ファイルの編集(2)-1
seeds/database-seed.conf を編集します。
# For example: postgresql://mydbserver.test.com:5000/countries/street_view?per=1000
{
name ="url",
value="postgresql://localhost:5432/sample/sales?per=1000" ← サンプルデータベースとテーブルを指定。
},
# Username and password for accessing this database. The username and password need to be separated by a :
# Example: username:password"
{
name="user-password",
data="PostgreSQL接続用ユーザー名: vcryptで暗号化したPostgreSQL接続用パスワード" ← このルールで記述。
},
11
12. 2018年3月15日現在
設定ファイルの編集(2)-2
seeds/database-seed.conf を編集します。
# When specified, this string will override the JDBC Class used by the connector when (other) is chosen as the
# Database System.
{
name="jdbc-class",
data="org.postgresql.Driver" ← ダウンロードしたPostgreSQL用JDBCドライバのクラス名を入力。
},
# When specified, this string will override the automatically generated JDBC connection string. This allows you
# to provide more detailed configuration about the database connection, such as load-balancing or SSL
connections.
# Example: jdbc:netezza://127.0.0.1:5480/databasename
{
name="connection-string",
data="jdbc:postgresql://localhost:5432/sample" ← JDBC接続用URLを入力。サンプルデータベースとテーブルを指定。
},
12