本页面为您介绍当 OCP 创建集群失败,系统错误代码为 4216 时的处理方法。
影响版本
OCP V2.3.5
问题现象
OCP 创建集群过程中,创建任务流时,在子任务流 at_bootstrap_observer 环节报错,日志信息如下:
2020-08-31 16:57:57 - info - 94730 - ob_operate_plus:412 - execute cmd:mysql -uroot -hxx.xxx.xx.xx -Pxxxx -e "set ob_query_timeout=1000000000; alter system bootstrap REGION 'BEIJING' ZONE 'BEIJING-OB_1' SERVER 'xx.xxx.xx.xx:2882', REGION 'BEIJING' ZONE 'BEIJING-OB_2' SERVER 'xx.xxx.xx.xx:2882', REGION 'BEIJING' ZONE 'BEIJING-OB_3' SERVER 'xx.xxx.xx.xx:2882'"
2020-08-31 16:58:11 - error - 94730 - ob_operate_plus:425 - ERROR 4216 (HY000) at line 1: curl error
2020-08-31 16:58:11 - info - 94730 - ob_operate_plus:412 - execute cmd:mysql -uroot -hxx.xxx.xx.xx -Pxxxx -e "set ob_query_timeout=1000000000; alter system bootstrap REGION 'BEIJING' ZONE 'BEIJING-OB_1' SERVER 'xx.xxx.xx.xx:2882', REGION 'BEIJING' ZONE 'BEIJING-OB_2' SERVER 'xx.xxx.xx.xx:2882', REGION 'BEIJING' ZONE 'BEIJING-OB_3' SERVER 'xx.xxx.xx.xx:2882'"
2020-08-31 16:58:11 - error - 94730 - ob_operate_plus:425 - ERROR 1227 (42501) at line 1: Access denied; you need (at least one of) the BOOTSTRAP privilege(s) for this operation
此时登录部署集群 3 节点,通过 2881 端口连接实例,查看集群已经初始化正常状态,如下所示:
obclient> SELECT id, svr_ip, svr_port, inner_port, zone, with_rootserver, status FROM __all_server;
+----+--------------+----------+------------+-------------+-----------------+--------+
| id | svr_ip | svr_port | inner_port | zone | with_rootserver | status |
+----+--------------+----------+------------+-------------+-----------------+--------+
| 2 | xx.xxx.xx.xx | 2882 | 2881 | EIJING-OB_1 | 0 | active |
| 1 | xx.xxx.xx.xx | 2882 | 2881 | EIJING-OB_2 | 1 | active |
| 3 | xx.xxx.xx.xx | 2882 | 2881 | EIJING-OB_3 | 0 | active |
+----+--------------+----------+------------+-------------+-----------------+--------+
3 rows in set (0.00 sec)
可能原因
根据报错信息可知,当前问题是由于无法调用 curl 检测集群 RootService 服务状态导致的任务中断。
在任一同网段的主机中执行如下操作,验证手动 curl 调用是否可以调用成功:
[root@hostname /]# curl -l 'http://ocp.oceanbase.com:80/services?Action=ObRootServiceInfo&User_ID=alibaba&UID=admin&ObRegion=cluster_name'
当返回信息如下时,则表示在部署 OCP 负载均衡时,配置了域名 oceanbase.com 导致主机名解析失败。
curl: (6) Could not resolve host: ocp.oceanbase.com; Name or service not known
说明
在使用 OAT 部署 OCP 时,如果 负载均衡模式 选择了 DNS,则 OAT 会为 OCP 的机器配置默认域名 oceanbase.com,该域名仅在部署的 OCP 的节点可以自由访问,其他节点访问需要配置 /etc/hosts 解析。
解决方式
在创建集群的主机中加上 OCP 部署设置的域名,即修改
/etc/hosts文件。[root@hostname /]# echo "<ocp1_ip> ocp.oceanbase.com">>/etc/hosts在 OCP 中重试子任务。
- 登录 OCP,在系统页面右上角单击 任务中心,进入任务列表页面。
- 在任务列表中选择需要查看的任务,单击任务名,进入任务详情页。
- 单击运行失败的子步骤右侧 ... 中的 重新运行 按钮,重试子任务。