码迷,mamicode.com
首页 > 数据库 > 详细

安装配置好openstack环境的虚拟机,须要改动ip时,在数据库中同步改动ip的方法

时间:2017-04-20 10:32:48      阅读:371      评论:0      收藏:0      [点我收藏+]

标签:mem   command   start   openstac   数据库   monit   log   article   iad   

感谢朋友支持本博客,欢迎共同探讨交流,因为能力和时间有限,错误之处在所难免,欢迎指正。
假设转载,请保留作者信息。


博客地址:http://blog.csdn.net/qq_21398167

原博文地址:http://blog.csdn.net/qq_21398167/article/details/46729717

因为配置openstack 环境的时候,创建了非常多表。都配置了本机的ip

所以当本机须要改动ip的 时候  就须要同步数据库中全部与环境有关的ip

方法:

1.进入数据库

[root@node Desktop]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.40-MariaDB-wsrep MariaDB Server, wsrep_25.11.r4026

Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

MariaDB [(none)]>

2.显示全部数据    show database。

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| glance             |
| keystone           |
| mysql              |
| nova               |
| performance_schema |
| test               |
+--------------------+
7 rows in set (0.12 sec)

MariaDB [(none)]>

3.进入keystone 数据库

MariaDB [(none)]> use keystone;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [keystone]>

4.查看 全部数据表

MariaDB [keystone]> show tables;
+-----------------------+
| Tables_in_keystone    |
+-----------------------+
| assignment            |
| credential            |
| domain                |
| endpoint              |
| group                 |
| migrate_version       |
| policy                |
| project               |
| region                |
| role                  |
| service               |
| token                 |
| trust                 |
| trust_role            |
| user                  |
| user_group_membership |
+-----------------------+
16 rows in set (0.00 sec)

MariaDB [keystone]>

5.查看 endpoint 数据表全部内容

MariaDB [keystone]> SELECT * FROM endpoint;
+----------------------------------+----------------------------------+-----------+-----------+----------------------------------+-------------------------------------------+-------+---------+
| id                               | legacy_endpoint_id               | interface | region    | service_id                       | url                                       | extra | enabled |
+----------------------------------+----------------------------------+-----------+-----------+----------------------------------+-------------------------------------------+-------+---------+
| 2c1bfecbc0354ce8998675ae511139b6 | f73717cab6d4464cb65171d31535efe3 | public    | regionOne | da28568989314cbcb6562a069a8c4c4e | http://192.168.0.22:5000/v2.0             | {}    |       1 |
| 458b7c2cf4614f2fade90836671795ea | e1d8e224bc434587941d00f42b1b3d88 | admin     | regionOne | 507666ec257f4090850853ce5fa06881 | http://192.168.0.22:9292                  | {}    |       1 |
| 565afe887f1244afb1bc2c75cb05b3f7 | 3f6df8dffd5745228130066c9521888a | public    | regionOne | 30162d7fd4c448f481a617a47138a087 | http://192.168.0.22:8774/v2/%(tenant_id)s | {}    |       1 |
| 849d71c20521483480a02ca7e248d2b3 | e1d8e224bc434587941d00f42b1b3d88 | internal  | regionOne | 507666ec257f4090850853ce5fa06881 | http://192.168.0.22:9292                  | {}    |       1 |
| 886f672ed16a4b4c9a1959846cdb6790 | f73717cab6d4464cb65171d31535efe3 | admin     | regionOne | da28568989314cbcb6562a069a8c4c4e | http://192.168.0.22:35357/v2.0            | {}    |       1 |
| 99b9f854f7ab409bad2902376cfa26e0 | f73717cab6d4464cb65171d31535efe3 | internal  | regionOne | da28568989314cbcb6562a069a8c4c4e | http://192.168.0.22:5000/v2.0             | {}    |       1 |
| b0ffbaf2b9854f07a9741fe7f7ee51f9 | 3f6df8dffd5745228130066c9521888a | internal  | regionOne | 30162d7fd4c448f481a617a47138a087 | http://192.168.0.22:8774/v2/%(tenant_id)s | {}    |       1 |
| cf450711e11547b3b03885e08bbdab5d | e1d8e224bc434587941d00f42b1b3d88 | public    | regionOne | 507666ec257f4090850853ce5fa06881 | http://192.168.0.22:9292                  | {}    |       1 |
| ee495ededf0b46bb9f8db1efef85da71 | 3f6df8dffd5745228130066c9521888a | admin     | regionOne | 30162d7fd4c448f481a617a47138a087 | http://192.168.0.22:8774/v2/%(tenant_id)s | {}    |       1 |
+----------------------------------+----------------------------------+-----------+-----------+----------------------------------+-------------------------------------------+-------+---------+
9 rows in set (0.00 sec)

MariaDB [keystone]>
6.用 命令改动 里面全部ip  就可以。

比如:

update endpoint set url=‘http://192.168.0.22:5000/v2.0 where id=‘2c1bfecbc0354ce8998675ae511139b6;



安装配置好openstack环境的虚拟机,须要改动ip时,在数据库中同步改动ip的方法

标签:mem   command   start   openstac   数据库   monit   log   article   iad   

原文地址:http://www.cnblogs.com/wzzkaifa/p/6736974.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!