【 使用环境 】测试环境
【 OB or 其他组件 】 OCP
【 使用版本 】3.1.1
【问题描述】 配置OCP:Take over primary OB cluster 的时候报observer的用户不对
【复现路径】 使用OBD安装的时候,操作系统使用了obadmin 用户安装
【问题现象及影响】
2022-08-04 00:14:30.076 INFO 42 — [pool-subtask-executor-thread-14,cea667871f0b48f3,2727b1362327] c.a.ocp.core.task.util.OcpAgentUtils : [OcpAgentUtils.runCmd] svrIp=10.249.240.16, port=62888, user=root, cmd=ps -o euser,cmd 555939 | grep observer | awk ‘{print $1}’
2022-08-04 00:14:30.189 INFO 42 — [pool-subtask-executor-thread-14,cea667871f0b48f3,2727b1362327] c.a.ocp.core.task.util.OcpAgentUtils : [OcpAgentUtils.runCmd] result=obadmin
2022-08-04 00:14:30.191 ERROR 42 — [pool-subtask-executor-thread-14,cea667871f0b48f3,2727b1362327] com.alipay.ocp.core.util.ExceptionUtils : Checked Exception: com.alipay.ocp.core.exception.UnexpectedException occurred with code error.ob.cluster.takeover.wrong.user, and args [obadmin]
2022-08-04 00:14:30.194 INFO 42 — [pool-subtask-executor-thread-14,cea667871f0b48f3,2727b1362327] c.a.o.c.m.j.model.SubtaskInstanceEntity : Set state for subtask: 1000954, current state: RUNNING, new state: FAILED
2022-08-04 00:14:30.198 WARN 42 — [pool-subtask-executor-thread-14,cea667871f0b48f3,2727b1362327] c.a.ocp.core.job.runner.RunnerFactory : Execute task failed, subtask=SubtaskInstanceEntity{id=1000954, name=Check observer process user, state=FAILED, operation=EXECUTE, className=com.alipay.ocp.service.task.business.host.CheckObserverProcessUserTask, seriesId=50, startTime=2022-08-04T00:14:29.919+08:00, endTime=2022-08-04T00:14:30.196+08:00}, failedMessage=The user of observer process must be admin, current is obadmin
com.alipay.ocp.core.exception.UnexpectedException: [OCP UnexpectedException]: status=500 INTERNAL_SERVER_ERROR, errorCode=OB_CLUSTER_TAKEOVER_OBSERVER_WRONG_USER, args=obadmin
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_312]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_312]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_312]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_312]
at com.alipay.ocp.core.util.ExceptionUtils.newException(ExceptionUtils.java:96) ~[ocp-core-3.1.1-20210916.jar!/:3.1.1-20210916]
at com.alipay.ocp.core.util.ExceptionUtils.throwException(ExceptionUtils.java:90) ~[ocp-core-3.1.1-20210916.jar!/:3.1.1-20210916]
at com.alipay.ocp.core.util.ExceptionUtils.unExpected(ExceptionUtils.java:77) ~[ocp-core-3.1.1-20210916.jar!/:3.1.1-20210916]
at com.alipay.ocp.service.task.business.host.CheckObserverProcessUserTask.run(CheckObserverProcessUserTask.java:47) ~[ocp-service-3.1.1-20210916.jar!/:3.1.1-20210916]
at com.alipay.ocp.core.metadb.job.model.SubtaskInstanceEntity.run(SubtaskInstanceEntity.java:216) ~[ocp-core-3.1.1-20210916.jar!/:3.1.1-20210916]
at com.alipay.ocp.core.job.runner.JavaTaskRunner.doExecute(JavaTaskRunner.java:26) ~[ocp-core-3.1.1-20210916.jar!/:3.1.1-20210916]
at com.alipay.ocp.core.job.runner.JavaTaskRunner.run(JavaTaskRunner.java:20) ~[ocp-core-3.1.1-20210916.jar!/:3.1.1-20210916]
at com.alipay.ocp.core.job.runner.RunnerFactory.doRun(RunnerFactory.java:103) ~[ocp-core-3.1.1-20210916.jar!/:3.1.1-20210916]
at com.alipay.ocp.core.job.runner.RunnerFactory.redirectOutputIfNotSysSchedule(RunnerFactory.java:147) ~[ocp-core-3.1.1-20210916.jar!/:3.1.1-20210916]
at com.alipay.ocp.core.job.runner.RunnerFactory.run(RunnerFactory.java:92) ~[ocp-core-3.1.1-20210916.jar!/:3.1.1-20210916]
at com.alipay.ocp.core.job.coordinator.worker.subtask.ReadySubtaskWorker.lambda$submitTask$2(ReadySubtaskWorker.java:123) ~[ocp-core-3.1.1-20210916.jar!/:3.1.1-20210916]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_312]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_312]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_312]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_312]