Home > Software design >  Failed to connect Oceanbase Control Platform with the correct password
Failed to connect Oceanbase Control Platform with the correct password

Time:01-17

During the installation of OCP (OceanBase Control Platform), i was trying to use secret key to login oceanbase database. but it happened with an error "KeyError: 'password'", which prevented me completing the OCP installation.

I use testing environment,the ocp version is: ocp-4.0.0-ce-x86-64.

Actual Behavior

[root@1f06 ocp-4.0.0-ce-x86_64 09:30:11]# sh -x ./ocp_installer.sh install -c /data/ocp.yaml  -k ~/.ssh/id_rsa -i ./ocp-installer.tar.gz -o ./ocp.tar.gz  
  LOG_DIR=/tmp/log
  TASK_DIR=/tmp/task
  OBD_DIR=/tmp/.obd/cluster
  PORT=3000
   readlink -f ./ocp-installer.tar.gz
  INSTALLER_IMAGE=/data/pc/ob_soft/ocp-4.0.0-ce-x86_64/ocp-installer.tar.gz
   readlink -f ./ocp.tar.gz
  OCP_IMAGE=/data/pc/ob_soft/ocp-4.0.0-ce-x86_64/ocp.tar.gz
   readlink -f /root/.ssh/id_rsa
  SSH_KEY=/root/.ssh/id_rsa
   readlink -f ./config.yaml
  CONF_FILE=/data/pc/ob_soft/ocp-4.0.0-ce-x86_64/config.yaml
   hostname -i
  HOST=192.168.1.6
  subcommand=install
  shift
  '[' install = launch ']'
  '[' install = install ']'
  verbose 'install ocp command'
  '[' '' = TRUE ']'
  getopts :hvc:i:o:k:p: OPT
  case $OPT in
   readlink -f /data/ocp.yaml
  CONF_FILE=/data/ocp.yaml
  getopts :hvc:i:o:k:p: OPT
  case $OPT in
   readlink -f /root/.ssh/id_rsa
  SSH_KEY=/root/.ssh/id_rsa
  getopts :hvc:i:o:k:p: OPT
  case $OPT in
   readlink -f ./ocp-installer.tar.gz
  INSTALLER_IMAGE=/data/pc/ob_soft/ocp-4.0.0-ce-x86_64/ocp-installer.tar.gz
  getopts :hvc:i:o:k:p: OPT
  case $OPT in
   readlink -f ./ocp.tar.gz
  OCP_IMAGE=/data/pc/ob_soft/ocp-4.0.0-ce-x86_64/ocp.tar.gz
  getopts :hvc:i:o:k:p: OPT
  eval install
   install
   info 'install start'
   echo -e '\e[1;32minstall start\e[0m'
install start
   check_docker
   info 'check docker on host'
   echo -e '\e[1;32mcheck docker on host\e[0m'
check docker on host
   command -v docker
   load_installer_image
   info 'load installer docker image'
   echo -e '\e[1;32mload installer docker image\e[0m'
load installer docker image
   docker load -i /data/pc/ob_soft/ocp-4.0.0-ce-x86_64/ocp-installer.tar.gz
Loaded image: reg.docker.alibaba-inc.com/ocp2/ocp-installer:4.0.0-ce-x86_64
    tar -xpf /data/pc/ob_soft/ocp-4.0.0-ce-x86_64/ocp-installer.tar.gz manifest.json --warning=no-timestamp -O
    awk '-FRepoTags":\\["' '{print $2}'
    awk '-F"' '{print $1}'
   INSTALLER_REPO_TAG=reg.docker.alibaba-inc.com/ocp2/ocp-installer:4.0.0-ce-x86_64
   make_log_dir
   info 'make log dir'
   echo -e '\e[1;32mmake log dir\e[0m'
make log dir
   mkdir -p log
    readlink -f ./log
   LOG_DIR=/data/pc/ob_soft/ocp-4.0.0-ce-x86_64/log
   make_obd_dir
   info 'make obd dir'
   echo -e '\e[1;32mmake obd dir\e[0m'
make obd dir
   mkdir -p .obd/cluster
    readlink -f ./.obd/cluster
   OBD_DIR=/data/pc/ob_soft/ocp-4.0.0-ce-x86_64/.obd/cluster
   '[' -z /root/.ssh/id_rsa ']'
   docker run --rm -v /root/.ssh/id_rsa:/root/keys/id_rsa -v /data/pc/ob_soft/ocp-4.0.0-ce-x86_64/.obd/cluster:/root/.obd/cluster -v /data/pc/ob_soft/ocp-4.0.0-ce-x86_64/log:/tmp/log -v /data/ocp.yaml:/root/installer/config.yaml -v /data/pc/ob_soft/ocp-4.0.0-ce-x86_64/ocp.tar.gz:/root/ocp.tar.gz --workdir=/root/installer --net=host --entrypoint=python3 -e PYTHONUNBUFFERED=1 reg.docker.alibaba-inc.com/ocp2/ocp-installer:4.0.0-ce-x86_64 pipeline/install_ocp.py /root/installer/config.yaml
Traceback (most recent call last):
  File "pipeline/install_ocp.py", line 43, in <module>
    run(context)
  File "pipeline/install_ocp.py", line 33, in run
    install_ocp_pipeline.run()
  File "/root/installer/core/pipeline.py", line 10, in run
    task.run()
  File "/root/installer/task/ocp_precheck.py", line 19, in run
    ssh_client = self.get_ssh_client(ip)
  File "/root/installer/task/base.py", line 18, in get_ssh_client
    password = self.context['ssh']['password']
KeyError: 'password'

other information

The configuration of the ssh part in "ocp.yaml" as following:

ssh:
  port: 22
  user: root
  auth_method: pubkey
  timeout: 10
  key_file: /root/keys/id_rsa 

Does anyone know how to configure correctly? Any help would be greatly appreciated!

CodePudding user response:

Did you remove the password configuration from your profile? Leave this configuration. In fact, the configuration is determined by the auth_method and takes effect.

  • Related