0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MongoDBをCloud Pak for Dataに接続

Last updated at Posted at 2022-07-22

今回はCloud Pak for DataにMongoDBを繋げてみたので忘れないうちにメモ

MongoDBはクラウドのサービスを使いました。
MongoDB Atlas
https://www.mongodb.com/atlas/database

アカウントを作成して無料のデータベースを作成。サンプルのコレクションをロードしておく

image.png
サンプルはこちらでダウンロードできます。
image.png

ここでCloud Pak for Dataとの接続に必要となってくるのが
-データベース名
-接続のためのURL
-ポート
-ユーザー名
-パスワード
です。
データベース名は作成されたデータベースから任意のものを選んでください。
下の例だとsample.... のどれかですね。
image.png
URL情報は以下のようにして取得しました。
Browse Colectionをクリック
image.png
Overviewをクリック
image.png
PrimaryのURLとポートを取得
image.png

ユーザー名とパスワードはデータベースを最初に作ったときに設定します。あるいは以下のように確認することも
左ペインにあるDatabase accessを選択するとユーザー名やパスワードの設定画面が出てきます。
image.png

以上でMongoDBの側の設定はできました。
次にCloud Pak for dataの方です。カタログ、プロジェクトを開き接続を作成してください。
image.png
MongoDBを選択して
image.png

MongoDBの接続情報を入れてください。
image.png

接続が完成、Cloud Pak for DataからmongoDBのcollectionが見れます。
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?