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

    应用场景举例

  • 相关阅读:
    js中盒子模型常用的属性你还记得几个?
    编写一个关于浏览器盒子模型的方法
    Javascript中关于作用域和闭包和域解释的面试题
    时间格式转换
    HDU Subset sequence
    bugku never give up
    HDU 2136 Largest prime factor
    HDU 2099 整除的尾数
    杭电acm 2070
    ACM Elevator
  • 原文地址:https://www.cnblogs.com/zhangeamon/p/7338161.html
Copyright © 2020-2023  润新知