连接集群sys租户(root用户),黑屏创建unit后,ocp的资源规格管理界面看不到的解决方法
1. 找到getpass.sh,执行得到ocp的meta租户的root密码
[root@obocp tools]# pwd
/root/t-oceanbase-antman/tools
[root@obocp tools]# ls
deploy_docker deploy_physical getpass.sh ob-checker obctl
oceanbase_dba_helper setpass.sh update_meta_VIP.sh
[root@obocp tools]# ./getpass.sh
sys: YXdw@0+6rE
meta: kD5InIB1%o
monitor: 0f9pxw^W0P
sysmonitor: c0bP%oWO^z
omsmeta: 0}Rl82u8lR
odcmeta: uUbCcSN9j+
proxysys: 5WkbsYkv+9
proxyro: 6i%diJsP6}
2. 找到meta租户的进程和端口号
[root@obocp tools]# ps -ef|grep meta
root 12549 41111 0 13:44 pts/2 00:00:00 grep --color=auto meta
root 25535 1 0 Jul28 ? 00:00:00 /usr/sbin/lvmetad -f
admin 27398 24052 6 Jul29 ? 6-18:31:40 ./bin/obproxy -p2888 -n ocp_obproxy -o obproxy_config_server_url=http://127.0.0.1:8080/services?Action=GetObProxyConfig&User_ID=alibaba&UID=admin,syslog_level=INFO,skip_proxyro_check=true,skip_proxy_sys_private_check=true,enable_strict_kernel_release=false,enable_metadb_used=false,enable_proxy_scramble=true,proxy_mem_limited=1G,log_dir_size_threshold=10G
admin 33235 32730 4 Jul29 ? 5-06:18:01 ./bin/obproxy -p 2883 -n AntObproxy -r 10.51.252.233:2881 -o obproxy_sys_password=b2f171fd30b839c514b80bc4d7c0fa9ace662c87,observer_sys_password=74f0c645fa14b4754c57bdd5a2fd11bb985b4d42,enable_strict_kernel_release=false,enable_metadb_used=false,enable_proxy_scramble=true,log_dir_size_threshold=10G,automatic_match_work_thread=false,work_thread_num=16,proxy_mem_limited=4G,client_max_connections=16384,enable_compression_protocol=false -c obcluster
**2881端口的就是ocp的meta租户的实例端口号
3. 进行登录
mysql -h10.51.252.233 -P2881 -uroot@ocp_meta -p
密码为 kD5InIB1%o
4. 进入schema(ocp),找到table(ob_unit_spec),这个表就是 ocp图形界面 Unit规格管理的 unit列表的数据存放表。
MySQL [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| oceanbase |
| information_schema |
| mysql |
| test |
| ocp |
| backup21 |
| backup2230 |
| backup1472 |
| backup147x |
+--------------------+
9 rows in set (0.00 sec)
MySQL [(none)]> use ocp;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MySQL [ocp]> show tables like '%unit%';
+------------------------+
| Tables_in_ocp (%unit%) |
+------------------------+
| ob_unit_spec |
+------------------------+
1 row in set (0.00 sec)
5. 插入使用黑屏命令 创建的unit 的信息。
先到 sys租户中 查询unit的信息
MySQL [oceanbase]> select * from __all_unit_config where name = ‘aaaa1’\G
*************************** 1. row ***************************
gmt_create: 2022-11-17 12:46:09.528914
gmt_modified: 2022-11-17 12:46:09.528914
unit_config_id: 1014
name: aaaa1
max_cpu: 16
min_cpu: 16
max_memory: 34359738368
min_memory: 34359738368
max_iops: 128
min_iops: 128
max_disk_size: 10737418240
max_session_num: 64
1 row in set (0.00 sec)
插入aaaa1的相关信息到meta租户的ocp.ob_unit_spec表中
MySQL [ocp]> desc ocp.ob_unit_spec
-> ;
+-----------------+-------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-------------+------+-----+-------------------+-----------------------------+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
| create_time | datetime | NO | | CURRENT_TIMESTAMP | |
| update_time | datetime | YES | | CURRENT_TIMESTAMP | ON UPDATE CURRENT_TIMESTAMP |
| creator | varchar(64) | YES | | NULL | |
| name | varchar(64) | NO | UNI | NULL | |
| max_cpu | float(5,2) | NO | | NULL | |
| min_cpu | float(5,2) | YES | | 0.25 | |
| max_memory | bigint(20) | NO | | NULL | |
| min_memory | bigint(20) | YES | | 1073741824 | |
| max_iops | bigint(20) | YES | | 5000 | |
| min_iops | bigint(20) | YES | | 128 | |
| max_disk_size | bigint(20) | YES | | 536870912000 | |
| max_session_num | bigint(20) | YES | | 75 | |
| group | varchar(64) | YES | | default | |
| type | varchar(64) | NO | | NULL | |
+-----------------+-------------+------+-----+-------------------+-----------------------------+
15 rows in set (0.00 sec)
MySQL [ocp]> insert into ob_unit_spec(creator,name,max_cpu,min_cpu,max_memory,min_memory,type) values('admin','aaaa1',16,16,34359738368,34359738368,'CUSTOM');
Query OK, 1 row affected (0.01 sec)