3.4. MongoDB のインストール

インストール可能な MongoDB は、内部データベースのインストール中に satellite-installer ツールでインストールされたものと同じバージョンの MongoDB のみになります。MongoDB はサポート対象のバージョンであれば、Red Hat Software Collections (RHSCL) リポジトリーからまたは外部ソースからインストールすることが可能です。Satellite は MongoDB バージョン 3.4 をサポートしています。

手順

  1. MongoDB をインストールするには、以下のコマンドを入力します。

    # yum install rh-mongodb34 rh-mongodb34-syspaths
  2. rh-mongodb34 サービスを起動して有効にします。

    # systemctl start rh-mongodb34-mongod
    # systemctl enable rh-mongodb34-mongod
  3. pulp_database データベース用に、MongoDB に Pulp ユーザーを作成します。

    # mongo pulp_database \
    --eval "db.createUser({user:'pulp',pwd:'pulp_password',roles:[{role:'dbOwner', db:'pulp_database'},{ role: 'readWrite', db: 'pulp_database'}]})"
  4. /etc/opt/rh/rh-mongodb34/mongod.conf ファイルでバインド IP を指定します。

    bindIp: your_mongodb_server_bind_IP,::1
  5. /etc/opt/rh/rh-mongodb34/mongod.conf ファイルを編集して security セクションの認証を有効にします。

    security:
      authorization: enabled
  6. rh-mongodb34-mongod サービスを再起動します。

    # systemctl restart rh-mongodb34-mongod
  7. MongoDB にポート 27017 を開きます。

    # firewall-cmd --add-port=27017/tcp
    # firewall-cmd --runtime-to-permanent
  8. Satellite Server から、データベースにアクセスできることをテストします。接続が成功すると、コマンドから 1 が返ります。

    # scl enable rh-mongodb34 " mongo --host mongo.example.com \
    -u pulp -p pulp_password --port 27017 --eval 'ping:1' pulp_database"