当前位置: 首页 > news >正文

做评测好的视频网站有哪些长沙好的seo外包公司

做评测好的视频网站有哪些,长沙好的seo外包公司,淄博做网站电话,西红柿怎么做网站OceanBase社区版单节点安装搭建(Docker) 文章目录 OceanBase社区版单节点安装搭建(Docker)一、环境检查及Docker配置1.1 安装docker1.2 配置docker镜像源 二、OB镜像下载三、obd部署单节点数据库四、创建业务租户、数据库、表4.1 …

OceanBase社区版单节点安装搭建(Docker)

文章目录

  • OceanBase社区版单节点安装搭建(Docker)
    • 一、环境检查及Docker配置
      • 1.1 安装docker
      • 1.2 配置docker镜像源
    • 二、OB镜像下载
    • 三、obd部署单节点数据库
    • 四、创建业务租户、数据库、表
      • 4.1 创建租户
      • 4.2 创建数据库、表
    • 五、参考链接

一、环境检查及Docker配置

本文采用redhat7.9作为测试环境,虚拟机安装操作系统的步骤不再列出。

官方的docker镜像要求主机资源至少为2C10G。本机主机资源配置(4c16G,磁盘100G)

[root@rac04 ~]# lscpu
CPU(s):                4
[root@rac04 ~]# free -mtotal        used        free      shared  buff/cache   available
Mem:          15866         981       14534          12         350       14606
Swap:          8063           0        8063
[root@rac04 ~]# df -h
文件系统               容量  已用  可用 已用% 挂载点
devtmpfs               7.8G     0  7.8G    0% /dev
tmpfs                  7.8G     0  7.8G    0% /dev/shm
tmpfs                  7.8G   13M  7.8G    1% /run
tmpfs                  7.8G     0  7.8G    0% /sys/fs/cgroup
/dev/mapper/rhel-root   92G  4.2G   87G    5% /
/dev/sda1             1014M  183M  832M   19% /boot
tmpfs                  1.6G  8.0K  1.6G    1% /run/user/42
tmpfs                  1.6G     0  1.6G    0% /run/user/0

1.1 安装docker

#内核版本不低于3.10。
uname -a#设置docker源仓库
yum install -y yum-utils  device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo#安装docker
yum install -y docker-ce docker-ce-cli containerd.io#启动docker服务
systemctl start docker
#激活docker服务开机自启动
systemctl enable docker.service#校验
[root@rac04 ~]# docker version
Client: Docker Engine - CommunityVersion:           25.0.3API version:       1.44Go version:        go1.21.6Git commit:        4debf41Built:             Tue Feb  6 21:17:10 2024OS/Arch:           linux/amd64Context:           defaultServer: Docker Engine - CommunityEngine:Version:          25.0.3API version:      1.44 (minimum version 1.24)Go version:       go1.21.6Git commit:       f417435Built:            Tue Feb  6 21:16:08 2024OS/Arch:          linux/amd64Experimental:     falsecontainerd:Version:          1.6.28GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bbrunc:Version:          1.1.12GitCommit:        v1.1.12-0-g51d5e94docker-init:Version:          0.19.0GitCommit:        de40ad0

1.2 配置docker镜像源

国内从 DockerHub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务,参考Docker Hub 镜像源 - 掘金 (juejin.cn)

vi /etc/docker/daemon.json{"registry-mirrors": ["https://dockerproxy.com","https://hub-mirror.c.163.com","https://mirror.baidubce.com","https://ccr.ccs.tencentyun.com"]
}#重启docker服务
systemctl restart docker.service #校验镜像源
[root@rac04 ~]# docker info |grep Mirrors -A 5Registry Mirrors:https://dockerproxy.com/https://hub-mirror.c.163.com/https://mirror.baidubce.com/https://ccr.ccs.tencentyun.com/Live Restore Enabled: false

二、OB镜像下载

下载地址:https://hub.docker.com/r/oceanbase/oceanbase-ce/tags,该地址可能需要使用代理访问。这里直接贴出来docker pull oceanbase/oceanbase-ce:3.1.3

找到3.1.3版本,复制拉取命令

[root@rac04 ~]# docker pull oceanbase/oceanbase-ce:3.1.3
3.1.3: Pulling from oceanbase/oceanbase-ce
13add961a70d: Pull complete 
1cf396138e36: Pull complete 
de207e7387d3: Pull complete 
Digest: sha256:22c2d82e5e7223ee510b1c53400edd05e622d9a09bc33987bd85ce560bb0781a
Status: Downloaded newer image for oceanbase/oceanbase-ce:3.1.3
docker.io/oceanbase/oceanbase-ce:3.1.3
[root@rac04 ~]# docker images
REPOSITORY               TAG       IMAGE ID       CREATED         SIZE
oceanbase/oceanbase-ce   3.1.3     66c986c2d478   23 months ago   783MB

三、obd部署单节点数据库

运行docker容器

[root@rac04 ~]# docker run -d -m 12G --cpus 4 --name oceanbase-ce oceanbase/oceanbase-ce:3.1.3
61d0ccd3ea95e36938527701c07d85f89fe950921004c4b133302dd32051dc5c[root@rac04 ~]# docker ps
CONTAINER ID   IMAGE                          COMMAND              CREATED         STATUS         PORTS     NAMES
61d0ccd3ea95   oceanbase/oceanbase-ce:3.1.3   "/bin/sh -c _boot"   8 seconds ago   Up 8 seconds             oceanbase-ce

检查docker日志

[root@rac04 ~]# docker logs oceanbase-ce 
generate boot.yaml ...
create boot dirs and deploy ob cluster ...
Package oceanbase-ce-3.1.3 is available.
install oceanbase-ce-3.1.3 for local ok
Cluster param config check ok
Open ssh connection ok
Generate observer configuration ok
oceanbase-ce-3.1.3 already installed.
+-------------------------------------------------------------------------------------------+
|                                          Packages                                         |
+--------------+---------+-----------------------+------------------------------------------+
| Repository   | Version | Release               | Md5                                      |
+--------------+---------+-----------------------+------------------------------------------+
| oceanbase-ce | 3.1.3   | 10000292022032916.el7 | eab08e5d473bd4884fdf2ac4d7dff6a329b68abe |
+--------------+---------+-----------------------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Open ssh connection ok
Remote oceanbase-ce-3.1.3-eab08e5d473bd4884fdf2ac4d7dff6a329b68abe repository install ok
Remote oceanbase-ce-3.1.3-eab08e5d473bd4884fdf2ac4d7dff6a329b68abe repository lib check !!
[WARN] 127.0.0.1 oceanbase-ce-3.1.3-eab08e5d473bd4884fdf2ac4d7dff6a329b68abe require: libmariadb.so.3Try to get lib-repository
Package oceanbase-ce-libs-3.1.3 is available.
install oceanbase-ce-libs-3.1.3 for local ok
Use oceanbase-ce-libs-3.1.3-c68c3aca8a1329a360fe5d65e1c3d4fa0f93f2d5 for oceanbase-ce-3.1.3-eab08e5d473bd4884fdf2ac4d7dff6a329b68abe
Remote oceanbase-ce-libs-3.1.3-c68c3aca8a1329a360fe5d65e1c3d4fa0f93f2d5 repository install ok
Remote oceanbase-ce-3.1.3-eab08e5d473bd4884fdf2ac4d7dff6a329b68abe repository lib check ok
Cluster status check ok
Initializes observer work home ok
obcluster deployed
Get local repositories and plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start observer ok
[WARN] (127.0.0.1) clog and data use the same disk (/)Start observer ok
observer program health check ok
Connect to observer ok
Initialize cluster
Cluster bootstrap ok
Wait for observer init ok
+---------------------------------------------+
|                   observer                  |
+-----------+---------+------+-------+--------+
| ip        | version | port | zone  | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 3.1.3   | 2881 | zone1 | active |
+-----------+---------+------+-------+--------+obcluster running
Get local repositories and plugins ok
Open ssh connection ok
Connect to observer ok
Create tenant test ok
start ob cluster ...
Get local repositories and plugins ok
Open ssh connection ok
Load cluster param plugin ok
Cluster status check ok
Deploy "obcluster" is running
boot success!
#切换终端到docker容器
[root@rac04 ~]# docker exec -it oceanbase-ce bash
#检查集群状态
[root@61d0ccd3ea95 /]# obd cluster list
+------------------------------------------------------------+
|                        Cluster List                        |
+-----------+------------------------------+-----------------+
| Name      | Configuration Path           | Status (Cached) |
+-----------+------------------------------+-----------------+
| obcluster | /root/.obd/cluster/obcluster | running         |

docker镜像已经部署好了一个集群——obcluster,这里不再部署。附上obd操作集群的常用命令

#启动集群
obd cluster start 集群名
#停止集群
obd cluster stop 集群名
#重启集群
obd cluster restart 集群名
#查看集群状况
obd cluster list
obd cluster display 集群名
#查看集群配置,也可以根据模板,重新建一个配置文件,重新部署新集群
obd cluster edit-config 集群名

四、创建业务租户、数据库、表

连接数据库,默认root密码为空

obclient -h127.0.0.1 -P2881 -uroot@sys -p -c -A -Doceanbase
-- 修改root密码
alter user root identified by 'root';

4.1 创建租户

检查资源状况


select zone,
concat(svr_ip, ':', svr_port) observer,
cpu_capacity,
cpu_total,
cpu_assigned,
cpu_assigned_percent,
mem_capacity/1024/1024,
mem_total/1024/1024,
mem_assigned/1024/1024,
mem_assigned_percent,
disk_total/1024/1024,
disk_assigned/1024/1024,
disk_assigned_percent,
unit_Num,
round('load', 2) 'load',
round('cpu_weight', 2) 'cpu_weight',
round('memory_weight', 2) 'mem_weight',
leader_count
from __all_virtual_server_stat
order by zone, svr_ip\G*************************** 1. row ***************************zone: zone1observer: 127.0.0.1:2882cpu_capacity: 14cpu_total: 14cpu_assigned: 11.5cpu_assigned_percent: 82mem_capacity/1024/1024: 4096.00000000mem_total/1024/1024: 4096.00000000mem_assigned/1024/1024: 3891.20000076mem_assigned_percent: 95disk_total/1024/1024: 27648.00000000
disk_assigned/1024/1024: 55296.00000000disk_assigned_percent: 200unit_Num: 2load: 0.00cpu_weight: 0.00mem_weight: 0.00leader_count: 1318
1 row in set, 3 warnings (0.001 sec)MySQL [oceanbase]> show parameters like 'system_memory'\G
*************************** 1. row ***************************zone: zone1svr_type: observersvr_ip: 127.0.0.1svr_port: 2882name: system_memorydata_type: NULLvalue: 4Ginfo: the memory reserved for internal use which cannot be allocated to any outer-tenant, and should be determined to guarantee every server functions normally. Range: [0M,)section: OBSERVERscope: CLUSTERsource: DEFAULT
edit_level: DYNAMIC_EFFECTIVE
1 row in set (0.002 sec)MySQL [oceanbase]> select * from __all_unit_config;
+----------------------------+----------------------------+----------------+-----------------+---------+---------+------------+------------+----------+----------+---------------+---------------------+
| gmt_create                 | gmt_modified               | unit_config_id | name            | max_cpu | min_cpu | max_memory | min_memory | max_iops | min_iops | max_disk_size | max_session_num     |
+----------------------------+----------------------------+----------------+-----------------+---------+---------+------------+------------+----------+----------+---------------+---------------------+
| 2024-03-07 14:35:29.704258 | 2024-03-07 14:35:29.704258 |              1 | sys_unit_config |       5 |     2.5 | 1288490188 | 1073741824 |    10000 |     5000 |   28991029248 | 9223372036854775807 |
| 2024-03-07 14:35:40.537529 | 2024-03-07 14:35:40.537529 |           1001 | test_unit       |       9 |       9 | 3006477108 | 3006477108 |      128 |      128 |   28991029248 |                  64 |
+----------------------------+----------------------------+----------------+-----------------+---------+---------+------------+------------+----------+----------+---------------+---------------------+
2 rows in set (0.001 sec)MySQL [oceanbase]> select * from gv$unit;
+---------+----------------+------------------+------------------+--------------------+-------+-----------+-------------+-----------+----------+---------------------+-----------------------+---------+---------+------------+------------+----------+----------+---------------+---------------------+
| unit_id | unit_config_id | unit_config_name | resource_pool_id | resource_pool_name | zone  | tenant_id | tenant_name | svr_ip    | svr_port | migrate_from_svr_ip | migrate_from_svr_port | max_cpu | min_cpu | max_memory | min_memory | max_iops | min_iops | max_disk_size | max_session_num     |
+---------+----------------+------------------+------------------+--------------------+-------+-----------+-------------+-----------+----------+---------------------+-----------------------+---------+---------+------------+------------+----------+----------+---------------+---------------------+
|       1 |              1 | sys_unit_config  |                1 | sys_pool           | zone1 |         1 | sys         | 127.0.0.1 |     2882 |                     |                     0 |       5 |     2.5 | 1288490188 | 1073741824 |    10000 |     5000 |   28991029248 | 9223372036854775807 |
|    1001 |           1001 | test_unit        |             1001 | test_pool          | zone1 |      1001 | test        | 127.0.0.1 |     2882 |                     |                     0 |       9 |       9 | 3006477108 | 3006477108 |      128 |      128 |   28991029248 |                  64 |
+---------+----------------+------------------+------------------+--------------------+-------+-----------+-------------+-----------+----------+---------------------+-----------------------+---------+---------+------------+------------+----------+----------+---------------+---------------------+
2 rows in set (0.001 sec)-- 剩余的资源已经不足,修改system_memory参数为2G,调小test租户的资源占用
alter system set system_memory='2G';
alter resource unit test_unit min_cpu=1,max_cpu=2,min_memory='1G',max_memory='1G';-- 再次检查资源
*************************** 1. row ***************************zone: zone1observer: 127.0.0.1:2882cpu_capacity: 14cpu_total: 14cpu_assigned: 3.5cpu_assigned_percent: 25mem_capacity/1024/1024: 6144.00000000mem_total/1024/1024: 6144.00000000mem_assigned/1024/1024: 2048.00000000mem_assigned_percent: 33disk_total/1024/1024: 27648.00000000
disk_assigned/1024/1024: 55296.00000000disk_assigned_percent: 200unit_Num: 2load: 0.00cpu_weight: 0.00mem_weight: 0.00leader_count: 1318

创建资源单元

CREATE resource unit u1 max_cpu=1, min_cpu=1, max_memory='1G', min_memory='1G', max_iops=10000,
min_iops=1000, max_session_num=1000000, max_disk_size='5G';

创建资源池

create resource pool pool1 unit='u1', unit_num=1, zone_list=('zone1') ;

创建mysql类型业务租户,允许所有连接,关闭回收站

create tenant yw charset='utf8mb4',zone_list=('zone1'),resource_pool_list=('pool1'),comment='业务租户1' 
set ob_compatibility_mode=mysql,ob_tcp_invited_nodes='%',recyclebin = off;

检查

MySQL [oceanbase]> select * from __all_tenant where tenant_name='yw'\G
*************************** 1. row ***************************gmt_create: 2024-03-07 15:50:54.994276gmt_modified: 2024-03-07 15:50:54.994276tenant_id: 1002tenant_name: ywreplica_num: -1zone_list: zone1primary_zone: RANDOMlocked: 0collation_type: 0info: 业务租户1read_only: 0rewrite_merge_version: 0locality: FULL{1}@zone1logonly_replica_num: 0previous_locality: storage_format_version: 0
storage_format_work_version: 0default_tablegroup_id: -1compatibility_mode: 0drop_tenant_time: -1status: TENANT_STATUS_NORMALin_recyclebin: 0
1 row in set (0.002 sec)

4.2 创建数据库、表

连接业务租户yw

 obclient -h127.0.0.1 -P2881 -uroot@yw -p -c -A -Doceanbase
alter user root identified by 'root';-- 创建数据库
MySQL [oceanbase]> create database ywdb charset='utf8mb4' read write;
Query OK, 1 row affected (0.013 sec)
MySQL [oceanbase]> use ywdb
Database changed
MySQL [ywdb]> create table t1(name char(20));
Query OK, 0 rows affected (0.072 sec)
-- 创建分区表
MySQL [ywdb]> create table t3(id int(10),t3name char(20)) partition by hash(id) partitions 5;
Query OK, 0 rows affected (0.058 sec)
-- 创建表组
MySQL [ywdb]> create tablegroup tbgroup1 partition by hash partitions 5;
Query OK, 0 rows affected (0.019 sec)
-- 创建分区表并加入表组
MySQL [ywdb]> create table t4(t4id int(10)) tablegroup=tbgroup1 partition by hash(t4id) partitions 5;
Query OK, 0 rows affected (0.033 sec)
-- 将表加入表组
MySQL [ywdb]> alter table t3 tablegroup=tbgroup1;
Query OK, 0 rows affected (0.021 sec)
-- 查看表的创建语句
MySQL [ywdb]> SHOW CREATE TABLE t3;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                                                                                                                                                                                        |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t3    | CREATE TABLE `t3` (`id` int(10) DEFAULT NULL,`t3name` char(20) DEFAULT NULL
) DEFAULT CHARSET = utf8mb4 ROW_FORMAT = COMPACT COMPRESSION = 'zstd_1.3.8' REPLICA_NUM = 1 BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE TABLET_SIZE = 134217728 PCTFREE = 0 TABLEGROUP = 'tbgroup1'partition by hash(id)
(partition p0,
partition p1,
partition p2,
partition p3,
partition p4) |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.027 sec)

五、参考链接

Linux安装Docker完整教程 - 哈哈哈嗝 - 博客园 (cnblogs.com)

Docker Hub 镜像源 - 掘金 (juejin.cn)

快速体验 OceanBase-OceanBase 数据库-OceanBase文档中心-分布式数据库使用文档

http://www.mmbaike.com/news/101495.html

相关文章:

  • 简述网站开发的三层架构游戏推广代理
  • 上海个人医疗网站备案表东莞seo优化排名
  • 微信做网站的公司关键词排名优化怎么样
  • 简洁大气的网站百度seo自动优化
  • 福田网站建设龙岗网站建设天津网站建设
  • 成都网站建设网杭州网站优化效果
  • 网站建设技能考试试题品牌维护
  • 网站建设专业网站设计公司物格网关键词优化排名查询
  • 秦皇岛一日游必去景点郑州seo优化公司
  • 做网站要排版吗全网最低价24小时自助下单平台
  • 青州专业网站建设手机优化什么意思
  • 蛋糕设计网站广州营销型网站
  • 博客网站怎么做网络推广方法怎么样
  • 建筑工地网站互联网营销师考试内容
  • 温州网站推广驭明宿迁网站建设制作
  • 国外网站建设方案百度推广登陆平台
  • 深圳网站建设 东毅虎图片识别
  • 网站服务器安全部署云浮新增确诊病例30例
  • 做植物提取物的专业网站学生个人网页优秀模板
  • 凡客建站网宁波免费建站seo排名
  • web前端响应式布局网站优化的方法与技巧
  • 专业做网站费用网上全网推广
  • 哪个网站做效果图好网络营销策划方案怎么写
  • 深圳哪家建设网站公司好google中文搜索引擎入口
  • 做网站开票内容是什么移动营销
  • 吕梁做网站公司重庆关键词搜索排名
  • 重庆网站建设有限公司如何在百度上开店铺
  • 在线接入网页客服湖南seo优化
  • 网页设计素材网站有哪些你对网络营销的理解
  • 网站开发适合什么工作促销方法100种