1
2

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 5 years have passed since last update.

OpenStack Keystoneのendpoint URLの更新方法

Posted at

OpenStack Keystoneでサービスのendpoint URLを設定したあと、そのURLを更新する必要に迫られました。きっとkeystone endpoint-updateとかいうコマンドがあるのだろう。。。と思ったのですが、サポートされているのはendpoint-createendpoint-deleteのみ。設定を更新する、というコマンドはありませんでした(OpenStack Junoで検証)。Googleで調べてみると、どうやら同じ問題で悩んでいる人は他にもいるようなのですが、DBを直接いじって解決しているようでした。この記事ではDBの更新によるendpoint URLの変更方法についてお伝えします。

1. Databaseサーバーに接続する。
mysql -u root -p
2. keystone DBに接続する。
MariaDB [(none)]> connect keystone;
3. endpointテーブルを表示する。
MariaDB [keystone]> select * from endpoint;
+----------------------------------+----------------------------------+-----------+----------------------------------+-----------------------------------------+-------+---------+-----------+
| id                               | legacy_endpoint_id               | interface | service_id                       | url                                     | extra | enabled | region_id |
+----------------------------------+----------------------------------+-----------+----------------------------------+-----------------------------------------+-------+---------+-----------+
| 024c7a0d2734456cbcbec529b8dec3f8 | ef81cd642ef94ada960c08c79388b3b6 | internal  | 7eb8c12a399c42f9bf8af02b8f949ad5 | http://xxxxxx:5000/v2.0                  | {}    |       1 | regionOne |
| 832f7fcac1234879aa6b1e688d39c22d | ef81cd642ef94ada960c08c79388b3b6 | admin     | 7eb8c12a399c42f9bf8af02b8f949ad5 | http://xxxxxx:35357/v2.0                 | {}    |       1 | regionOne |
| 84ee7820fadc4d3ab7b4758762b9a4ec | f7a0da4c046f4d3890294a20fb048666 | internal  | 72f3a3d6717d4371a1eedfb82a1b5fbd | http://xxxxxx:8080/v1/AUTH_%(tenant_id)s | {}    |       1 | regionOne |
| b789b9d3af774ea298b917607baa3a0a | f7a0da4c046f4d3890294a20fb048666 | public    | 72f3a3d6717d4371a1eedfb82a1b5fbd | http://xxxxxx:8080/v1/AUTH_%(tenant_id)s | {}    |       1 | regionOne |
| ca67c7cb5b0b4086914f1662a7d7ed97 | f7a0da4c046f4d3890294a20fb048666 | admin     | 72f3a3d6717d4371a1eedfb82a1b5fbd | http://xxxxxx:8080                       | {}    |       1 | regionOne |
| df76cb0e66e4468cb1db4381fba3a07b | ef81cd642ef94ada960c08c79388b3b6 | public    | 7eb8c12a399c42f9bf8af02b8f949ad5 | http://xxxxxx:5000/v2.0                  | {}    |       1 | regionOne |
+----------------------------------+----------------------------------+-----------+----------------------------------+-----------------------------------------+-------+---------+-----------+

4. 変更したいURLの行を選び、新しいURLを設定する。
MariaDB [keystone]> update endpoint set url='http://yyyyyy:8080/v1/AUTH_%(tenant_id)s' where id='b789b9d3af774ea298b917607baa3a0a';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
5. 新しいURLが設定されたことを確認する。
MariaDB [keystone]> select * from endpoint;
+----------------------------------+----------------------------------+-----------+----------------------------------+-----------------------------------------+-------+---------+-----------+
| id                               | legacy_endpoint_id               | interface | service_id                       | url                                     | extra | enabled | region_id |
+----------------------------------+----------------------------------+-----------+----------------------------------+-----------------------------------------+-------+---------+-----------+
| 024c7a0d2734456cbcbec529b8dec3f8 | ef81cd642ef94ada960c08c79388b3b6 | internal  | 7eb8c12a399c42f9bf8af02b8f949ad5 | http://xxxxxx:5000/v2.0                  | {}    |       1 | regionOne |
| 832f7fcac1234879aa6b1e688d39c22d | ef81cd642ef94ada960c08c79388b3b6 | admin     | 7eb8c12a399c42f9bf8af02b8f949ad5 | http://xxxxxx:35357/v2.0                 | {}    |       1 | regionOne |
| 84ee7820fadc4d3ab7b4758762b9a4ec | f7a0da4c046f4d3890294a20fb048666 | internal  | 72f3a3d6717d4371a1eedfb82a1b5fbd | http://xxxxxx:8080/v1/AUTH_%(tenant_id)s | {}    |       1 | regionOne |
| b789b9d3af774ea298b917607baa3a0a | f7a0da4c046f4d3890294a20fb048666 | public    | 72f3a3d6717d4371a1eedfb82a1b5fbd | http://yyyyyy:8080/v1/AUTH_%(tenant_id)s | {}    |       1 | regionOne |
| ca67c7cb5b0b4086914f1662a7d7ed97 | f7a0da4c046f4d3890294a20fb048666 | admin     | 72f3a3d6717d4371a1eedfb82a1b5fbd | http://xxxxxx:8080                       | {}    |       1 | regionOne |
| df76cb0e66e4468cb1db4381fba3a07b | ef81cd642ef94ada960c08c79388b3b6 | public    | 7eb8c12a399c42f9bf8af02b8f949ad5 | http://xxxxxx:5000/v2.0                  | {}    |       1 | regionOne |
+----------------------------------+----------------------------------+-----------+----------------------------------+-----------------------------------------+-------+---------+-----------+
6. DBの接続を切る
MariaDB [keystone]> quit
Bye
7. keystone endpoint-listコマンドで新しいURLが設定されたことを確認する。
keystone endpoint-list
+----------------------------------+-----------+------------------------------------------------------------+-----------------------------------------+-------------------------+----------------------------------+
|                id                |   region  |                         publicurl                          |               internalurl               |         adminurl        |            service_id            |
+----------------------------------+-----------+------------------------------------------------------------+-----------------------------------------+-------------------------+----------------------------------+
| ef81cd642ef94ada960c08c79388b3b6 | regionOne |         http://xxxxxx:5000/v2.0          |          http://xxxxxx:5000/v2.0         | http://xxxxxx:35357/v2.0 | 7eb8c12a399c42f9bf8af02b8f949ad5 |
| f7a0da4c046f4d3890294a20fb048666 | regionOne | http://yyyyyy:8080/v1/AUTH_%(tenant_id)s | http://xxxxxx:8080/v1/AUTH_%(tenant_id)s |    http://xxxxxx:8080    | 72f3a3d6717d4371a1eedfb82a1b5fbd |
+----------------------------------+-----------+------------------------------------------------------------+-----------------------------------------+-------------------------+----------------------------------+

以上で、endpointのURLを更新することができました。

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?