1. 修改/etc/hosts中的IP为新IP
2. 进入mysql
[root@YXnode01 ~]# /usr/local/mysql/bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9593
Server version: 5.6.31-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
3. 找到hosts表
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| amon |
| cm |
| hive |
| mysql |
| performance_schema |
| rman |
| test |
+--------------------+
8 rows in set (0.00 sec)
mysql> use cm
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
mysql> show tables;
+--------------------------------+
| Tables_in_cm |
+--------------------------------+
| AUDITS |
| CLIENT_CONFIGS |
| CLIENT_CONFIGS_TO_HOSTS |
| CLUSTERS |
| CLUSTERS_AUD |
| CLUSTER_ACTIVATED_RELEASES |
| CLUSTER_ACTIVATED_RELEASES_AUD |
| CLUSTER_MANAGED_RELEASES |
| CLUSTER_UNDISTRIBUTED_RELEASES |
| CM_PEERS |
| CM_VERSION |
| COMMANDS |
| COMMANDS_DETAIL |
| COMMAND_SCHEDULES |
| CONFIGS |
| CONFIGS_AUD |
| CONFIG_CONTAINERS |
| CREDENTIALS |
| DIAGNOSTICS_EVENTS |
| EXTERNAL_ACCOUNTS |
| EXTERNAL_ACCOUNTS_AUD |
| GLOBAL_SETTINGS |
| HOSTS |
| HOSTS_AUD |
| HOST_TEMPLATES |
| HOST_TEMPLATE_TO_ROLE_CONF_GRP |
| METRICS |
| PARCELS |
| PARCEL_COMPONENTS |
| PROCESSES |
| PROCESSES_DETAIL |
| PROCESS_ACTIVE_RELEASES |
| RELEASES |
| RELEASES_AUD |
| REVISIONS |
| ROLES |
| ROLES_AUD |
| ROLE_CONFIG_GROUPS |
| ROLE_CONFIG_GROUPS_AUD |
| ROLE_STALENESS_STATUS |
| SCHEMA_VERSION |
| SERVICES |
| SERVICES_AUD |
| SNAPSHOT_POLICIES |
| USERS |
| USER_ROLES |
| USER_SETTINGS |
+--------------------------------+
47 rows in set (0.00 sec)
4. 查询HOSTS
mysql> select * from hosts;
ERROR 1146 (42S02): Table 'cm.hosts' doesn't exist
mysql> select * from HOSTS;
+---------+-------------------------+--------------------------------------+-------------------+----------------+----------+--------+----
| HOST_ID | OPTIMISTIC_LOCK_VERSION | HOST_IDENTIFIER | NAME | IP_ADDRESS | RACK_ID | STATUS | CONFIG_CONTAINER_ID | MAINTENANCE_COUNT | DECOMMISSION_COUNT | CLUSTER_ID | NUM_CORES | TOTAL_PHYS_MEM_BYTES | PUBLIC_NAME | PUBLIC_IP_ADDRESS | CLOUD_PROVIDER |
+---------+-------------------------+--------------------------------------+-------------------+----------------+----------+--------+----
|1 |25 | d3c2a68c-8f3a-4b81-bfd9-fddfe91fba9c | YXnode01.esgyn.cn | 172.16.253.117 | /default |NA|1 |0 |0 |1 |8 |25112600576 | NULL| NULL| NULL|
|2 |21 | 897848be-cbe1-4171-93ef-53750cbfd156 | YXnode03.esgyn.cn | 172.16.253.119 | /default |NA|1 |0 |0 |1 |8 |16657936384 | NULL| NULL| NULL|
|3 |23 | 41569980-d8db-418e-88fd-26cbd3898499 | YXnode02.esgyn.cn | 172.16.253.118 | /default |NA|1 |0 |0 |1 |8 |16657936384 | NULL| NULL| NULL|
+---------+-------------------------+--------------------------------------+-------------------+----------------+----------+--------+----
3 rows in set (0.00 sec)
5. 更新HOSTS中的IP
update HOSTS set IP_ADDRESS='172.16.253.217' where IP_ADDRESS='172.16.253.117';
update HOSTS set IP_ADDRESS='172.16.253.218' where IP_ADDRESS='172.16.253.118';
update HOSTS set IP_ADDRESS='172.16.253.219' where IP_ADDRESS='172.16.253.119';
6. 检查是否修改成功
mysql> select * from HOSTS;
+---------+-------------------------+--------------------------------------+-------------------+----------------+----------+--------+----
| HOST_ID | OPTIMISTIC_LOCK_VERSION | HOST_IDENTIFIER | NAME | IP_ADDRESS | RACK_ID | STATUS | CONFIG_CONTAINER_ID | MAINTENANCE_COUNT | DECOMMISSION_COUNT | CLUSTER_ID | NUM_CORES | TOTAL_PHYS_MEM_BYTES | PUBLIC_NAME | PUBLIC_IP_ADDRESS | CLOUD_PROVIDER |
+---------+-------------------------+--------------------------------------+-------------------+----------------+----------+--------+----
|1 |25 | d3c2a68c-8f3a-4b81-bfd9-fddfe91fba9c | YXnode01.esgyn.cn | 172.16.253.217 | /default | NA|1 |0 |0 |1 |8 |25112600576 | NULL| NULL| NULL|
|2 |21 | 897848be-cbe1-4171-93ef-53750cbfd156 | YXnode03.esgyn.cn | 172.16.253.219 | /default | NA|1 |0 |0 |1 |8 |16657936384 | NULL| NULL| NULL|
|3 |23 | 41569980-d8db-418e-88fd-26cbd3898499 | YXnode02.esgyn.cn | 172.16.253.218 | /default | NA|1 |0 |0 |1 |8 |16657936384 | NULL| NULL| NULL|
+---------+-------------------------+--------------------------------------+-------------------+----------------+----------+--------+----
3 rows in set (0.00 sec)
7. 修改所有节点的/etc/cloudera-scm-agent/config.ini
8. 重启Cloudera agent及server服务