• 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>

    应用场景举例

  • 相关阅读:
    C#运行Javascript脚本Utility
    SQL Mail XPs Options
    TSQL AVG Functions
    eclipse编译时过滤SVN版本控制信息方法(转)
    追MM与设计模式
    android的性能调优
    对象的赋值和复制(转)
    SVN Working Copy xxx locked and cleanup failed
    HTTP协议详解(转)
    atoi和itoa函数的实现
  • 原文地址:https://www.cnblogs.com/zhangeamon/p/7338161.html
Copyright © 2020-2023  润新知