• oceanbase 基于docker install



    #download images
    docker pull oceanbase/oceanbase-ce

    #start containerd
    docker run -p 2881:2881 --name oceanbase-ce -d -e OB_HOME_PATH="/root/obce" -e OB_TENANT_NAME="obmysql" oceanbase/oceanbase-ce


    #into containerd
    docker exec -it oceanbase-ce bash

    #list OBD deployment config
    obd cluster list

    ####start use oceanbase cluster
    ob-mysql mysql

    ob-mysql root

    ob-mysql test

     

    [root@be5b79ccd2d9 ~]# obd cluster list
    +------------------------------------------------------------+
    | Cluster List |
    +-----------+------------------------------+-----------------+
    | Name | Configuration Path | Status (Cached) |
    +-----------+------------------------------+-----------------+
    | obcluster | /root/.obd/cluster/obcluster | running |
    +-----------+------------------------------+-----------------+
    [root@be5b79ccd2d9 ~]# obd cluster display obcluster
    Get local repositories and plugins ok
    Open ssh connection ok
    Cluster status check ok
    Connect to observer ok
    Wait for observer init ok
    +---------------------------------------------+
    | observer |
    +-----------+---------+------+-------+--------+
    | ip | version | port | zone | status |
    +-----------+---------+------+-------+--------+
    | 127.0.0.1 | 3.1.3 | 2881 | zone1 | active |
    +-----------+---------+------+-------+--------+

     


    MySQL [oceanbase]> select tenant_id,tenant_name,primary_zone from __all_tenant;
    +-----------+-------------+--------------+
    | tenant_id | tenant_name | primary_zone |
    +-----------+-------------+--------------+
    | 1 | sys | zone1 |
    | 1001 | obmysql | RANDOM |
    +-----------+-------------+--------------+
    2 rows in set (0.003 sec)


    [root@be5b79ccd2d9 ~]# obd cluster obcluster status
    Usage: obd cluster <command> [options]

    Available commands:

    autodeploy Deploy a cluster automatically by using a simple configuration file.

    change-repo Change repository for a deployed component

    check4ocp Check Whether OCP Can Take Over Configurations in Use

    chst Change Deployment Configuration Style

    deploy Deploy a cluster by using the current deploy configuration or a deploy yaml file.

    destroy Destroy a deployed cluster.

    display Display the information for a cluster.

    edit-config Edit the configuration file for a specific deployment.

    list List all the deployments.

    redeploy Redeploy a started cluster.

    reload Reload a started cluster.

    restart Restart a started cluster.

    start Start a deployed cluster.

    stop Stop a started cluster.

    tenant Create or drop a tenant.

    upgrade Upgrade a cluster.


    Options:
    -h, --help Show help and exit.
    -v, --verbose Activate verbose output.

     

    [root@be5b79ccd2d9 ~]# obd cluster list
    +------------------------------------------------------------+
    | Cluster List |
    +-----------+------------------------------+-----------------+
    | Name | Configuration Path | Status (Cached) |
    +-----------+------------------------------+-----------------+
    | obcluster | /root/.obd/cluster/obcluster | running |
    +-----------+------------------------------+-----------------+
    [root@be5b79ccd2d9 ~]# obd cluster start obcluster
    Get local repositories and plugins ok
    Open ssh connection ok
    Load cluster param plugin ok
    Cluster status check ok
    Deploy "obcluster" is running

     

     

     

     


    ####
    查看OceanBase集群所有节点可用资源情况

    select a.zone,concat(a.svr_ip,':',a.svr_port) observer, cpu_total, (cpu_total-cpu_assigned) cpu_free,
    round(mem_total/1024/1024/1024) mem_total_gb, round((mem_total-mem_assigned)/1024/1024/1024) mem_free_gb,
    round(disk_total/1024/1024/1024) disk_total_gb,
    substr(a.build_version,1,6) version,usec_to_time(b.start_service_time) start_service_time
    from __all_virtual_server_stat a join __all_server b on (a.svr_ip=b.svr_ip and a.svr_port=b.svr_port)
    order by a.zone, a.svr_ip;


    +-------+----------------+-----------+----------+--------------+-------------+---------------+---------+----------------------------+
    | zone | observer | cpu_total | cpu_free | mem_total_gb | mem_free_gb | disk_total_gb | version | start_service_time |
    +-------+----------------+-----------+----------+--------------+-------------+---------------+---------+----------------------------+
    | zone1 | 127.0.0.1:2882 | 16 | 2.5 | 13 | 1 | 10 | 3.1.3_ | 2022-06-23 16:33:07.584955 |
    +-------+----------------+-----------+----------+--------------+-------------+---------------+---------+----------------------------+
    1 row in set (0.011 sec)


    ####查看集群资源池具体使用情况
    select t1.name resource_pool_name, t2.`name` unit_config_name, t2.max_cpu, t2.min_cpu,
    round(t2.max_memory/1024/1024/1024) max_mem_gb, round(t2.min_memory/1024/1024/1024) min_mem_gb,
    t3.unit_id, t3.zone, concat(t3.svr_ip,':',t3.`svr_port`) observer,t4.tenant_id, t4.tenant_name
    from __all_resource_pool t1 join __all_unit_config t2 on (t1.unit_config_id=t2.unit_config_id)
    join __all_unit t3 on (t1.`resource_pool_id` = t3.`resource_pool_id`)
    left join __all_tenant t4 on (t1.tenant_id=t4.tenant_id)
    order by t1.`resource_pool_id`, t2.`unit_config_id`, t3.unit_id
    ;
    +--------------------+------------------+---------+---------+------------+------------+---------+-------+----------------+-----------+-------------+
    | resource_pool_name | unit_config_name | max_cpu | min_cpu | max_mem_gb | min_mem_gb | unit_id | zone | observer | tenant_id | tenant_name |
    +--------------------+------------------+---------+---------+------------+------------+---------+-------+----------------+-----------+-------------+
    | sys_pool | sys_unit_config | 5 | 2.5 | 4 | 3 | 1 | zone1 | 127.0.0.1:2882 | 1 | sys |
    | obmysql_pool | obmysql_unit | 11 | 11 | 9 | 9 | 1001 | zone1 | 127.0.0.1:2882 | 1001 | obmysql |
    +--------------------+------------------+---------+---------+------------+------------+---------+-------+----------------+-----------+-------------+

     

    ###查看OB集群资源单元unit配置情况
    select unit_config_id,name,max_cpu,min_cpu,round(max_memory/1024/1024/1024) max_mem_gb,
    round(min_memory/1024/1024/1024) min_mem_gb, round(max_disk_size/1024/1024/1024) max_disk_size_gb
    from __all_unit_config
    order by unit_config_id;


    +----------------+-----------------+---------+---------+------------+------------+------------------+
    | unit_config_id | name | max_cpu | min_cpu | max_mem_gb | min_mem_gb | max_disk_size_gb |
    +----------------+-----------------+---------+---------+------------+------------+------------------+
    | 1 | sys_unit_config | 5 | 2.5 | 4 | 3 | 10 |
    | 1001 | obmysql_unit | 11 | 11 | 9 | 9 | 10 |
    +----------------+-----------------+---------+---------+------------+------------+------------------+

     


    ###集群初始化参数配置
    mysql -h127.1 -uroot@sys -P2881 -p -c -A
    Enter password:
    -- observer log自清理设置
    alter system set enable_syslog_recycle=true;
    alter system set max_syslog_file_count=10;
    show parameters where name in ('enable_syslog_recycle', 'max_syslog_file_count');
    mysql -h127.1 -uroot@sys -P2881 -p -c -A
    Enter password:
    -- observer log自清理设置
    alter system set enable_syslog_recycle=true;
    alter system set max_syslog_file_count=10;
    show parameters where name in ('enable_syslog_recycle', 'max_syslog_file_count');

  • 相关阅读:
    修改Windows上MySQL的数据文件路径
    【转】Analysis Services 2005中数据完整性处理
    设置Bitvise Ssh Client 为Windows服务
    Finalize/Dispose资源清理模式
    ACM HDU BFS 题目
    BFS专题之hdu1242 rescue
    bfs专题之HUD 1429 胜利大逃亡(续)
    ACM HDU 1010 Tempter of the Bone
    流水线作业调度问题
    系统原型
  • 原文地址:https://www.cnblogs.com/chinaops/p/16406047.html
Copyright © 2020-2023  润新知