Audacity音频编辑终极指南:免费开源软件从入门到精通
2026/6/3 11:51:17
首先需要用 root 用户或具有 CREATE TENANT 权限的管理员登录 sys 租户。
在10.14.1.150服务器进行如下命令操作
[root@bogon ~]# obclient -h127.0.0.1 -P2881 -uroot@sys -p'EWSXBHoK0DMQefGi1s2k' -A -c第 2 步:创建最小资源单元(根据实际资源调整)
-- 创建最小资源单元配置 obclient(root@sys)[(none)]> CREATE RESOURCE UNIT pdll_unit -> MAX_CPU = 1, -> MIN_CPU = 1, -> MEMORY_SIZE = '1G', -> LOG_DISK_SIZE = '2G', -> MAX_IOPS = 1024, -> MIN_IOPS = 1024; Query OK, 0 rows affected (0.004 sec)第3步:创建资源池
-- 创建资源池 obclient(root@sys)[(none)]> CREATE RESOURCE POOL pdll_pool -> UNIT = 'pdll_unit', -> UNIT_NUM = 1, -> ZONE_LIST = ('zone1'); Query OK, 0 rows affected (0.010 sec)如果不知道 Zone 名称,可以先查询:
SELECT * FROM oceanbase.DBA_OB_ZONES;创建 pdll 租户
-- 创建租户 obclient(root@sys)[(none)]> CREATE TENANT pdll -> CHARSET = 'utf8mb4', -> ZONE_LIST = ('zone1'), -> PRIMARY_ZONE = 'RANDOM', -> RESOURCE_POOL_LIST = ('pdll_pool') -> SET OB_TCP_INVITED_NODES = '%', -> OB_COMPATIBILITY_MODE = 'mysql'; Query OK, 0 rows affected (26.069 sec)检查租户创建状态
obclient(root@sys)[(none)]> -- 查看租户状态 Query OK, 0 rows affected (0.000 sec) obclient(root@sys)[(none)]> SELECT tenant_id, tenant_name, status FROM oceanbase.DBA_OB_TENANTS; +-----------+-------------+--------+ | tenant_id | tenant_name | status | +-----------+-------------+--------+ | 1 | sys | NORMAL | | 1001 | META$1002 | NORMAL | | 1002 | pdll | NORMAL | +-----------+-------------+--------+ 3 rows in set (0.010 sec)连接到 pdll 租户
# 退出当前连接,重新连接到 pdll 租户 ----切换链接时,租户pdll的root用户得密码一般未设置,默认空,直接回车即可,不需要输入密码----- [root@bogon ~]# obclient -h127.0.0.1 -P2881 -uroot@pdll -p -A -c Enter password: Welcome to the OceanBase. Commands end with ; or \g. Your OceanBase connection id is 3221519748 Server version: OceanBase_CE 4.2.1.11 (r111000162025032610-66056127ec794d942b9e0c1118730e14f060a08b) (Built Mar 26 2025 10:15:51) 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(root@pdll)[(none)]>在 pdll 租户中创建用户和数据库
obclient(root@pdll)[(none)]> obclient(root@pdll)[(none)]> -- 创建数据库 Query OK, 0 rows affected (0.000 sec) obclient(root@pdll)[(none)]> CREATE DATABASE com; Query OK, 1 row affected (0.032 sec) obclient(root@pdll)[(none)]> CREATE DATABASE quartz; Query OK, 1 row affected (0.019 sec) obclient(root@pdll)[(none)]> obclient(root@pdll)[(none)]> -- 授权给 ciom 用户 Query OK, 0 rows affected (0.000 sec) obclient(root@pdll)[(none)]> GRANT ALL PRIVILEGES ON com.* TO ciom; Query OK, 0 rows affected (0.027 sec) obclient(root@pdll)[(none)]> GRANT ALL PRIVILEGES ON quartz.* TO ciom; Query OK, 0 rows affected (0.020 sec) obclient(root@pdll)[(none)]> obclient(root@pdll)[(none)]> -- 授予连接权限和其他必要权限 Query OK, 0 rows affected (0.000 sec) obclient(root@pdll)[(none)]> GRANT CREATE, DROP, ALTER, INSERT, UPDATE, DELETE, SELECT ON *.* TO ciom; Query OK, 0 rows affected (0.022 sec) obclient(root@pdll)[(none)]> obclient(root@pdll)[(none)]> -- 查看创建结果 Query OK, 0 rows affected (0.000 sec) obclient(root@pdll)[(none)]> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | com | | information_schema | | mysql | | oceanbase | | quartz | | test | +--------------------+ 6 rows in set (0.003 sec) obclient(root@pdll)[(none)]> SELECT user, host FROM mysql.user; +------+------+ | user | host | +------+------+ | root | % | | ciom | % | +------+------+ 2 rows in set (0.003 sec) obclient(root@pdll)[(none)]>验证 ciom 用户连接
-- 退出当前用户登录 obclient(root@pdll)[(none)]> exit Bye [root@bogon ~]# # 使用 ciom 用户连接测试 [root@bogon ~]# obclient -h127.0.0.1 -P2881 -uciom@pdll -p'CiomUser@123' -A Welcome to the OceanBase. Commands end with ; or \g. Your OceanBase connection id is 3221521811 Server version: OceanBase_CE 4.2.1.11 (r111000162025032610-66056127ec794d942b9e0c1118730e14f060a08b) (Built Mar 26 2025 10:15:51) 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(ciom@pdll)[(none)]> USE com; -- 切换到com数据库 Database changed obclient(ciom@pdll)[com]> -- 创建测试表验证权限 Query OK, 0 rows affected (0.000 sec) obclient(ciom@pdll)[com]> CREATE TABLE test_permission (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); Query OK, 0 rows affected (0.095 sec) obclient(ciom@pdll)[com]> -- 确认表创建成功 Query OK, 0 rows affected (0.000 sec) obclient(ciom@pdll)[com]> SHOW TABLES; +-----------------+ | Tables_in_com | +-----------------+ | test_permission | +-----------------+ 1 row in set (0.003 sec) obclient(ciom@pdll)[com]> -- 切换到数据库quartz Query OK, 0 rows affected (0.000 sec) obclient(ciom@pdll)[com]> use quartz; Database changed obclient(ciom@pdll)[quartz]> -- 同样创建测试表 Query OK, 0 rows affected (0.000 sec) obclient(ciom@pdll)[quartz]> CREATE TABLE test_permission (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); Query OK, 0 rows affected (0.116 sec) obclient(ciom@pdll)[quartz]> -- 确认表创建成功 Query OK, 0 rows affected (0.000 sec) obclient(ciom@pdll)[quartz]> SHOW TABLES; +------------------+ | Tables_in_quartz | +------------------+ | test_permission | +------------------+ 1 row in set (0.002 sec) obclient(ciom@pdll)[quartz]> -- 清理测试表 Query OK, 0 rows affected (0.000 sec) obclient(ciom@pdll)[quartz]> DROP TABLE test_permission; Query OK, 0 rows affected (0.095 sec) obclient(ciom@pdll)[quartz]> USE com; Database changed obclient(ciom@pdll)[com]> DROP TABLE test_permission; Query OK, 0 rows affected (0.037 sec) obclient(ciom@pdll)[com]>#卸载之前的 [root@bogon bin]# ./uninstall.sh The current user is a root user and can uninstall obclient and obd globally. This will affect all other users. Do you want to proceed? [y/n] y successfully removed, obd meta data is still in /root/.obd, please delete it manually if needed. [root@bogon bin]# ls -ltr 总用量 16 -rwxr-xr-x. 1 root root 2058 8月 19 2025 uninstall.sh -rwxr-xr-x. 1 root root 6405 8月 19 2025 install.sh -rw-r--r--. 1 root root 209 8月 19 2025 env.sh #重新安装 [root@bogon bin]# ./install.sh install obd as root No previous obd installed, try install..., wait a moment name: grafana version: 7.5.17 release:1 arch: x86_64 md5: 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 size: 177766248 add /home/oceanbase-all-in-one/rpms/grafana-7.5.17-1.el7.x86_64.rpm to local mirror name: obagent version: 4.2.2 release:100000042024011120.el7 arch: x86_64 md5: 19739a07a12eab736aff86ecf357b1ae660b554e size: 72919140 add /home/oceanbase-all-in-one/rpms/obagent-4.2.2-100000042024011120.el7.x86_64.rpm to local mirror name: ob-configserver version: 1.0.0 release:2.el7 arch: x86_64 md5: feca6b9c76e26ac49464f34bfa0780b5a8d3f4a0 size: 24259515 add /home/oceanbase-all-in-one/rpms/ob-configserver-1.0.0-2.el7.x86_64.rpm to local mirror name: ob-deploy version: 3.5.0 release:5.el7 arch: x86_64 md5: 9f0daac3c324e745d860048bbca55f0bc77bb055 size: 185869137 add /home/oceanbase-all-in-one/rpms/ob-deploy-3.5.0-5.el7.x86_64.rpm to local mirror name: obproxy-ce version: 4.3.5.0 release:3.el7 arch: x86_64 md5: f17b277b681adb1c86bfc3cfda369ad88896da9d size: 123559862 add /home/oceanbase-all-in-one/rpms/obproxy-ce-4.3.5.0-3.el7.x86_64.rpm to local mirror name: ob-sysbench version: 1.0.20 release:21.el7 arch: x86_64 md5: 34eb6ecba0ebc4c31c4cfa01162045cbbbec55f7 size: 1566511 add /home/oceanbase-all-in-one/rpms/ob-sysbench-1.0.20-21.el7.x86_64.rpm to local mirror name: obtpcc version: 5.0.0 release:1.el7 arch: x86_64 md5: 8624590be4bfe16f28bdd9fc5e4849cda19577d6 size: 1890344 add /home/oceanbase-all-in-one/rpms/obtpcc-5.0.0-1.el7.x86_64.rpm to local mirror name: obtpch version: 3.0.0 release:1.el7 arch: x86_64 md5: 3e3e88f87527677998fedf25087f5c87779dee62 size: 1856985 add /home/oceanbase-all-in-one/rpms/obtpch-3.0.0-1.el7.x86_64.rpm to local mirror name: oceanbase-ce version: 4.2.1.11 release:111000162025032610.el7 arch: x86_64 md5: 7b406f4a49a44c710ca3c0590ef24ef2f0492a53 size: 471259388 add /home/oceanbase-all-in-one/rpms/oceanbase-ce-4.2.1.11-111000162025032610.el7.x86_64.rpm to local mirror name: oceanbase-ce version: 4.2.1.8 release:108000022024072217.el7 arch: x86_64 md5: 499b676f2ede5a16e0c07b2b15991d1160d972e8 size: 457041540 add /home/oceanbase-all-in-one/rpms/oceanbase-ce-4.2.1.8-108000022024072217.el7.x86_64.rpm to local mirror name: oceanbase-ce-libs version: 4.2.1.11 release:111000162025032610.el7 arch: x86_64 md5: 238b9ee162405e593e27cb583edda85b3f86d784 size: 7848 add /home/oceanbase-all-in-one/rpms/oceanbase-ce-libs-4.2.1.11-111000162025032610.el7.x86_64.rpm to local mirror name: oceanbase-ce-libs version: 4.2.1.8 release:108000022024072217.el7 arch: x86_64 md5: d02f4bfd321370a02550424293beb1be31204038 size: 468528 add /home/oceanbase-all-in-one/rpms/oceanbase-ce-libs-4.2.1.8-108000022024072217.el7.x86_64.rpm to local mirror name: oceanbase-ce-utils version: 4.2.1.11 release:111000162025032610.el7 arch: x86_64 md5: 229e4b9fc52938c29f12c43d63a7c1160388a764 size: 408176624 add /home/oceanbase-all-in-one/rpms/oceanbase-ce-utils-4.2.1.11-111000162025032610.el7.x86_64.rpm to local mirror name: oceanbase-ce-utils version: 4.2.1.8 release:108000022024072217.el7 arch: x86_64 md5: 6f87392f95b399a21382323f256cfda5969375c4 size: 403350984 add /home/oceanbase-all-in-one/rpms/oceanbase-ce-utils-4.2.1.8-108000022024072217.el7.x86_64.rpm to local mirror name: oceanbase-diagnostic-tool version: 3.4.0 release:12025051517.el7 arch: x86_64 md5: c1a7d5038425acc9324b1716da1abca94b7d68d7 size: 71624836 add /home/oceanbase-all-in-one/rpms/oceanbase-diagnostic-tool-3.4.0-12025051517.el7.x86_64.rpm to local mirror name: ocp-agent-ce version: 4.3.6 release:20250709105610.el7 arch: aarch64 md5: b9f6c657117bcec2ec3772cc35086dcc5dbc270d size: 123007815 add /home/oceanbase-all-in-one/rpms/ocp-agent-ce-4.3.6-20250709105610.el7.aarch64.rpm to local mirror name: ocp-agent-ce version: 4.3.6 release:20250709105610.el7 arch: x86_64 md5: 261bf2f6fe9b32c2f30fa5e6a038a1b28765c609 size: 179044109 add /home/oceanbase-all-in-one/rpms/ocp-agent-ce-4.3.6-20250709105610.el7.x86_64.rpm to local mirror name: ocp-express version: 4.2.2 release:100000022024011120.el7 arch: x86_64 md5: 09ffcf156d1df9318a78af52656f499d2315e3f7 size: 78426196 add /home/oceanbase-all-in-one/rpms/ocp-express-4.2.2-100000022024011120.el7.x86_64.rpm to local mirror name: ocp-server-ce version: 4.3.6 release:20250709105610.el7 arch: noarch md5: 9cb90dad471bb9ff8fe94c67402ce9560cc0b6fe size: 446411765 add /home/oceanbase-all-in-one/rpms/ocp-server-ce-4.3.6-20250709105610.el7.noarch.rpm to local mirror name: openjdk-jre version: 1.8.0_322 release:b09.el7 arch: x86_64 md5: 051aa69c5abb8697d15c2f0dcb1392b3f815f7ed size: 69766947 add /home/oceanbase-all-in-one/rpms/openjdk-jre-1.8.0_322-b09.el7.x86_64.rpm to local mirror name: prometheus version: 2.37.1 release:10000102022110211.el7 arch: x86_64 md5: 58913c7606f05feb01bc1c6410346e5fc31cf263 size: 211224073 add /home/oceanbase-all-in-one/rpms/prometheus-2.37.1-10000102022110211.el7.x86_64.rpm to local mirror Trace ID: 60ce6234-5e6b-11f1-89fa-005056b0553a If you want to view detailed obd logs, please run: obd display-trace 60ce6234-5e6b-11f1-89fa-005056b0553a Disable remote ok Trace ID: 6386ecd0-5e6b-11f1-bf4e-005056b0553a If you want to view detailed obd logs, please run: obd display-trace 6386ecd0-5e6b-11f1-bf4e-005056b0553a add auto set env logic to profile: /root/.bash_profile ######################################################################################### Install Finished ========================================================================================= Setup Environment: source ~/.oceanbase-all-in-one/bin/env.sh Quick Start: obd demo Use Web Service to install: obd web Use Web Service to upgrade: obd web upgrade More Details: obd -h ========================================================================================= ## 检查 obd 版本 [root@bogon bin]# obd --version OceanBase Deploy: 3.5.0 REVISION: 44567bd3badf6bd36a6b73f5ddcd66682da47574 BUILD_BRANCH: HEAD BUILD_TIME: Aug 19 2025 17:18:14OURCE Copyright (C) 2025 OceanBase License Apache 2.0: Apache version 2 or later <https://www.apache.org/licenses/LICENSE-2.0>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. ## 检查 obclient 版本 [root@bogon bin]# obclient --version obclient Ver 2.2.10 Distrib 10.4.18-MariaDB, for Linux (x86_64) using readline 5.1 #手动加载一下环境变量 [root@bogon bin]# source ~/.oceanbase-all-in-one/bin/env.sh [root@bogon bin]# pwd /home/oceanbase-all-in-one/bin [root@bogon bin]# ls -tlr 总用量 16 -rwxr-xr-x. 1 root root 2058 8月 19 2025 uninstall.sh -rwxr-xr-x. 1 root root 6405 8月 19 2025 install.sh -rw-r--r--. 1 root root 209 8月 19 2025 env.sh [root@bogon bin]# [root@bogon bin]# cat ~/.obd/cluster/demo/config.yaml prometheus: servers: - 127.0.0.1 global: home_path: /root/prometheus basic_auth_users: admin: ZAQ9qkPbdv depends: - obagent grafana: servers: - 127.0.0.1 global: home_path: /root/grafana login_password: ZnxOfaargP depends: - prometheus 127.0.0.1: login_password: ZnxOfaargP oceanbase-ce: servers: - 127.0.0.1 global: home_path: /root/oceanbase-ce appname: demo cluster_id: 1761923838 enable_syslog_wf: false max_syslog_file_count: 16 production_mode: false memory_limit: 8G __min_full_resource_pool_memory: 1073741824 system_memory: 4G cpu_count: 8 # 使用百分比而不是固定大小 datafile_disk_percentage: 50 # 使用磁盘空间的50% log_disk_percentage: 30 # 使用磁盘空间的30% # datafile_size: 20G # datafile_maxsize: 40G datafile_next: 2G # log_disk_size: 20G root_password: EWSXBHoK0DMQefGi1s2k ocp_agent_monitor_password: kwaj9yj4XY proxyro_password: f4wQeWqGyG obproxy-ce: servers: - 127.0.0.1 global: home_path: /root/obproxy-ce skip_proxy_sys_private_check: true enable_strict_kernel_release: false enable_cluster_checkout: false proxy_mem_limited: 500M rs_list: 127.0.0.1:2881 cluster_name: demo observer_root_password: EWSXBHoK0DMQefGi1s2k obproxy_sys_password: npmWIzPHRB 127.0.0.1: proxy_id: 7882 client_session_id_version: 2 depends: - oceanbase-ce obagent: servers: - 127.0.0.1 global: home_path: /root/obagent ob_monitor_status: active http_basic_auth_password: Ji3z0QN2n depends: - oceanbase-ce [root@bogon bin]# ps -ef | grep observer | grep -v grep [root@bogon bin]# ss -lntp | grep 2881 #修改很多单机环境起不来的根本原因 [root@bogon bin]# cat ~/.obd/cluster/demo/config.yaml |grep memory_limit memory_limit: 8G [root@bogon bin]# cat ~/.obd/cluster/demo/config.yaml |grep system_memory system_memory: 4G [root@bogon bin]# vi ~/.obd/cluster/demo/config.yaml #memory_limit: 4G #system_memory: 2G [root@bogon bin]# cat ~/.obd/cluster/demo/config.yaml |grep memory_limit memory_limit: 4G [root@bogon bin]# cat ~/.obd/cluster/demo/config.yaml |grep system_limit [root@bogon bin]# cat ~/.obd/cluster/demo/config.yaml |grep system_memory system_memory: 2G [root@bogon bin]# obd cluster stop demo Get local repositories ok Get local repositories and plugins ok Open ssh connection ok Stop observer ok Stop obshell ok Stop obproxy-ce ok Stop obagent ok Stop prometheus ok Stop grafana ok demo stopped Trace ID: b9bcd316-5e6c-11f1-9acb-005056b0553a If you want to view detailed obd logs, please run: obd display-trace b9bcd316-5e6c-11f1-9acb-005056b0553a