在UOS操作系统下OceanBase 开发者中心WEB版没有安装成功

在UOS操作系统下 OceanBase 开发者中心 WEB版没有安装成功

【 使用环境 】测试环境 obd demo

【 OB or 其他组件 】obproyx obd;

oceanbase-all-in-one-4.0.0.0-100120230113164218.el7.x86_64.tar.gz

obodc4.0.0.tar.gz

【 使用版本 】 oceanbase 4.0.0

问题描述

登录OceanBase 开发者中心WEB版odc.oceanbase.com没有成功;

OceanBase安装在单机上;以obd demo快速启动;

在同一台电脑上,obodc镜像安装完成;

在同一台电脑上,ob_nginx镜像安装完成;

疑难

OceanBase 开发者中心WEB版程序需要读写odc_metadb数据库吗?

在obd demo快速启动条件下,以下obodc镜像加载命令正确吗?

docker run -v /var/log/odc:/opt/odc/log -v /var/data/odc:/opt/odc/data -d -i --network host --cpu-period 100000 --cpu-quota 400000 --memory 8G --name “obodc” -e “DATABASE_HOST=127.0.0.1” -e “DATABASE_PORT=2881” -e “DATABASE_USERNAME=obodc@odc_tenant” -e “DATABASE_PASSWORD=obodc” -e “DATABASE_NAME=odc_metadb” -e “ODC_PROFILE_MODE=alipay” reg.docker.alibaba-inc.com/oceanbase/odc-server:4.0.0-20221101
有在UOS操作系统下正确安装OceanBase 开发者中心WEB版程序的书面指南吗?

![|643x552](file:////tmp/wps-quanping/ksohtml/wpsY6kuMA.jpg)

OceanBase 安装

quanping@TPW542Deepin:~$ su - root

请输入密码:

验证成功

root@TPW542Deepin:~# which obd

/root/.oceanbase-all-in-one/obd/usr/bin/obd

root@TPW542Deepin:~# which obclient

/root/.oceanbase-all-in-one/obclient/u01/obclient/bin/obclient

root@TPW542Deepin:~# obd cluster list

±-----------------------------------------------------+

| Cluster List |

±-------±--------------------------±----------------+

| Name | Configuration Path | Status (Cached) |

±-------±--------------------------±----------------+

| demo | /root/.obd/cluster/demo | deployed |

| obtest | /root/.obd/cluster/obtest | destroyed |

±-------±--------------------------±----------------+

root@TPW542Deepin:~# obd cluster start demo

Get local repositories ok

Search plugins ok

Open ssh connection ok

Load cluster param plugin ok

Check before start observer ok

[WARN] (127.0.0.1) failed to get open files

[WARN] (127.0.0.1) failed to get max user processes

[WARN] OBD-2000: (127.0.0.1) not enough memory. (Free: 2.8G, Need: 6.0G)

Check before start obagent ok

Check before start obproxy ok

Check before start prometheus ok

Check before start grafana ok

Start observer ok

observer program health check ok

Connect to observer ok

Initialize cluster ok

Start obagent ok

obagent program health check ok

Start obproxy ok

obproxy program health check x

[WARN] failed to start 127.0.0.1 obproxy

[ERROR] obproxy-ce start failed

Wait for observer init ok

±--------------------------------------------+

| observer |

±----------±--------±-----±------±-------+

| ip | version | port | zone | status |

±----------±--------±-----±------±-------+

| 127.0.0.1 | 4.0.0.0 | 2881 | zone1 | ACTIVE |

±----------±--------±-----±------±-------+

obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A

±----------------------------------------------+

| obagent |

±----------±------------±-----------±-------+

| ip | server_port | pprof_port | status |

±----------±------------±-----------±-------+

| 127.0.1.1 | 8088 | 8089 | active |

±----------±------------±-----------±-------+

See https://www.oceanbase.com/product/ob-deployer/error-codes .

root@TPW542Deepin:~# obd cluster list

±-----------------------------------------------------+

| Cluster List |

±-------±--------------------------±----------------+

| Name | Configuration Path | Status (Cached) |

±-------±--------------------------±----------------+

| demo | /root/.obd/cluster/demo | deployed |

| obtest | /root/.obd/cluster/obtest | destroyed |

±-------±--------------------------±----------------+

root@TPW542Deepin:~# obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A

Welcome to the OceanBase. Commands end with ; or \g.

Your OceanBase connection id is 3221487618

Server version: OceanBase_CE 4.0.0.0 (r103000022023011215-05bbad0279302d7274e1b5ab79323a2c915c1981) (Built Jan 12 2023 15:28:27)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

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

obclient [oceanbase]>

![|642x613](file:////tmp/wps-quanping/ksohtml/wps90GzyL.jpg)

![|642x613](file:////tmp/wps-quanping/ksohtml/wpsNlHIkW.jpg)

root@TPW542Deepin:~# obclient -h 127.0.0.1 -P 2881 -u obodc@odc_tenant -p -D dc_metadb -A

Enter password:

Welcome to the OceanBase. Commands end with ; or \g.

Your OceanBase connection id is 3221487619

Server version: OceanBase_CE 4.0.0.0 (r103000022023011215-05bbad0279302d7274e1b5ab79323a2c915c1981) (Built Jan 12 2023 15:28:27)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

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

obclient [dc_metadb]>

![|646x172](file:////tmp/wps-quanping/ksohtml/wpsJWkW66.jpg)

root@TPW542Deepin:~# docker container list

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

root@TPW542Deepin:~# docker container start obodc

obodc

root@TPW542Deepin:~# docker container start ob_nginx

ob_nginx

root@TPW542Deepin:~# docker container list

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

719ac0cd4721 nginx “/docker-entrypoint.…” 18 hours ago Up 8 seconds ob_nginx

2f1124108de1 reg.docker.alibaba-inc.com/oceanbase/odc-server:4.0.0-20221101 “/usr/bin/supervisor…” 32 hours ago Up About a minute obodc

root@TPW542Deepin:~#

![|642x182](file:////tmp/wps-quanping/ksohtml/wpsc96dTh.jpg)

nginx.conf.https.template

此文件没有修改,并复制进入on_nginx镜像中;

docker cp -a obodc:/opt/odc/conf/nginx.conf.https.template ~/obodc

/etc/security/limits.conf

![|643x597](file:////tmp/wps-quanping/ksohtml/wpsl4JyFs.jpg)

/etc/security/limits.conf

![|643x758](file:////tmp/wps-quanping/ksohtml/wpsdaZWrD.jpg)

etc/sysctl.conf

![|642x837](file:////tmp/wps-quanping/ksohtml/wpsCpjpeO.jpg)

default-example.yaml

![|643x340](file:////tmp/wps-quanping/ksohtml/wpsB5HV0Y.jpg)

计算机硬件信息

![|642x468](file:////tmp/wps-quanping/ksohtml/wpsECEuN9.jpg)

UOS 操作系统信息

![|641x313](file:////tmp/wps-quanping/ksohtml/wpsChn6zk.jpg)

在UOS操作系统下OceanBase 开发者中心WEB版没有安装成功.docx (1.4 MB)


哈喽,内在不足了,你的硬件配置和observer 部署配置是怎么样的

内存16GB,应该足够。上次是应用程序打开较多的原因。
root@TPW542Deepin:~# obd cluster start demo
Get local repositories ok
Search plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start observer ok
[WARN] (127.0.0.1) failed to get open files
[WARN] (127.0.0.1) failed to get max user processes

Check before start obagent ok
Check before start obproxy ok
Check before start prometheus ok
Check before start grafana ok
Start observer ok
observer program health check ok
Connect to observer ok
Initialize cluster ok
Start obagent ok
obagent program health check ok
Start obproxy ok
obproxy program health check x
[WARN] failed to start 127.0.0.1 obproxy
[ERROR] obproxy-ce start failed
Wait for observer init ok
±--------------------------------------------+
| observer |
±----------±--------±-----±------±-------+
| ip | version | port | zone | status |
±----------±--------±-----±------±-------+
| 127.0.0.1 | 4.0.0.0 | 2881 | zone1 | ACTIVE |
±----------±--------±-----±------±-------+
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A

±----------------------------------------------+
| obagent |
±----------±------------±-----------±-------+
| ip | server_port | pprof_port | status |
±----------±------------±-----------±-------+
| 127.0.1.1 | 8088 | 8089 | active |
±----------±------------±-----------±-------+
See https://www.oceanbase.com/product/ob-deployer/error-codes .
root@TPW542Deepin:~#

Observer 看上去一切OK,还需要如何配置?OceanBase安装部署指南是没有啊?请指教Observer 配置方法和指导文档。

看截图 ODC Server 已经启动了,页面已经打开只是初始化报错,可能是 nginx 配置问题。
前端浏览器也可以调试模式看下出错的请求,返回的 response 会可能包含相关错误信息。
另外能否提供下 nginx 配置?

可能,我复制进镜像中的配置文件是下面这个/root/obodcnginx.conf.https.template,没有修改。

Nginx conf template for https deployment

For more information on configuration, see:

* Official English Documentation: nginx documentation

#/root/obodcnginx.conf.https.template

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.

include /usr/share/nginx/modules/*.conf;

events {
worker_connections 1024;
}

http {
log_format main '$remote_addr - $remote_user [$time_local] “$request” ’
'$status $body_bytes_sent “$http_referer” ’
‘"$http_user_agent" “$http_x_forwarded_for”’;

access_log  /var/log/nginx/access.log  main;

sendfile            on;
tcp_nopush          on;
tcp_nodelay         on;
keepalive_timeout   65;
types_hash_max_size 2048;

#set 0 to disable request body size check, for support large size file upload
client_max_body_size 0;

include             /etc/nginx/mime.types;
default_type        application/octet-stream;

# for websocket configuration
map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

# load balancing configuration
# notice under_score character are not allowed for upsteram name, 400 Bad Request happens if used
# please use ip_hash strategy
# one server line for each odc-server node
upstream odcbackends {
  ip_hash;
  # PLEASE CHANGE to real odc-server address
  # 请修改为实际的 odc-server 地址(非必改内容)
  server 127.0.0.1:8989;
  #add more servers here
}

# redirect http to https
server {
    listen 80 default_server;

    # uncomment below if ipv6 enabled
    # 如启用 ipv6,请取消以下注释
    #listen [::]:80 default_server;

    location / {
        return 301 https://$host$request_uri;
    }
}

# https server, proxy to odc-server 8989 port
server {
    listen 443 ssl http2;
    # uncomment below if ipv6 enabled
    # 如启用 ipv6,请取消以下注释
    #listen [::]:443 ssl http2;

    # PLEASE CHANGE to your site domain
    # 请修改为实际的站点域名(非必改内容)
    server_name  odc.oceanbase.com;

    # you can use /opt/odc/bin/generate-odc-ssl-certificate.sh
    # to generate self certificated SSL certificates
    # 您可以使用 /opt/odc/bin/generate-odc-ssl-certificate.sh 生成自签证书

    # PLEASE CHANGE certificate file location if unmatched
    # 如不匹配,请修改证书文件路径
    ssl_certificate /etc/pki/nginx/odcserver.crt;
    ssl_certificate_key /etc/pki/nginx/odcserver.key;
    ssl_session_timeout 1d;
    ssl_session_cache shared:MozSSL:10m;  # about 40000 sessions
    ssl_session_tickets off;

    # intermediate configuration
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
    ssl_prefer_server_ciphers off;

    # HSTS (ngx_http_headers_module is required) (63072000 seconds)
    add_header Strict-Transport-Security "max-age=63072000" always;

    location / {
        proxy_pass http://odcbackends;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_read_timeout 1800;
        proxy_send_timeout 1800;
        proxy_connect_timeout 75;
        proxy_next_upstream off;
    }
}

}

我感觉Obodc 镜像ob_nginx镜像没有对接上:请帮检查这两个镜像运行是否配置正确?

docker run -v /var/log/odc:/opt/odc/log -v /var/data/odc:/opt/odc/data -d -i --network host --cpu-period 100000 --cpu-quota 400000 --memory 8G --name “obodc” -e “DATABASE_HOST=127.0.0.1” -e “DATABASE_PORT=2881” -e “DATABASE_USERNAME=obodc@odc_tenant” -e “DATABASE_PASSWORD=obodc” -e “DATABASE_NAME=odc_metadb” -e “ODC_PROFILE_MODE=alipay” reg.docker.alibaba-inc.com/oceanbase/odc-server:4.0.0-20221101

docker run --network host --name ob_ nginx -v ~/obodc / nginx.conf.https.template:/etc/nginx/nginx.conf -v /etc/pki/nginx/:/etc/pki/nginx/ -d nginx

在UOS操作系统下OceanBase 开发者中心WEB版没有安装成功.docx (1.4 MB)

nginx 配置文件看了下没有发现有问题。

单节点部署的话,直接访问 ODC 端口 http://127.0.0.1:8989 就可以,不部署 nginx 也可以的。nginx 主要是提供多节点负载均衡,是 HA 部署方案需要用到的。

初始化失败的问题可以先从浏览器端的错误信息分析下。