zoukankan      html  css  js  c++  java
  • Cockroachdb 三、副本设置

    三 副本配置

    CockroachDB 副本配置可分为三个等级,集群级别>数据库级别>表级别

    格式 YAML

    range_min_bytes: <size-in-bytes> //
    range_max_bytes: <size-in-bytes> // 默认64M
    gc:
    ttlseconds: <time-in-seconds> //默认24h
    num_replicas: <number-of-replicas> //默认3
    constraints: [comma-separated constraint list] //由于指定区域或存储类型

    constraints 特别说明

    a 节点启动时属性描述 cockroach start

    --locality 举例:--locality=region=east,datacenter=us-east-1
    --attrs 举例:--attrs=ram:64gb、ssd、hhd

    --store attrs 举例: --store=path=/mnt/ssd01,attrs=ssd 、 --store=path=/mnt/hda1,attrs=hdd:7200rpm

    b 语法
    constraints:[+ssd] 使用
    constraints:[-ssd] 禁用

    基本命令
    # View the replication zone for a database:
    cockroach zone get <database> <flags>

    # View the replication zone for a table:
    cockroach zone get <database.table> <flags>

    # Edit the default replication zone for the cluster:
    cockroach zone set .default --file=<zone-content.yaml> <flags>

    # Create/edit the replication zone for a database:
    cockroach zone set <database> --file=<zone-conent.yaml> <flags>

    # Create/edit the replication zone for a table:
    cockroach zone set <database.table> --file=<zone-content.yaml> <flags>

    # Remove the replication zone for a database:
    cockroach zone rm <database> <flags>

    # Remove the replication zone for a table:
    cockroach zone rm <database.table> <flags>

    应用场景举例

  • 相关阅读:
    linux开机启动服务配置
    流媒体服务器配置安装SRS及nginx+rtmp
    WEBRTC配置安装
    linux操作20200825
    转载流媒体服务器相关收藏
    RabbitMQ中间件使用
    如何查找删除指定进程
    硬件接口,串行比并行快的原因
    JavaBean+jsp开发模式 --结合form表单 实例
    session会话
  • 原文地址:https://www.cnblogs.com/zhangeamon/p/7338161.html
Copyright © 2011-2022 走看看