• Zookeeper Reconfig

    语法: server.<positive id> = <address1>:<port1>:<port2>[:role];[<client port address>:]<client port>

    https://zookeeper.apache.org/doc/r3.5.2-alpha/zookeeperReconfig.html

    The client port specification is to the right of the semicolon. The client port address is optional, and if not specified it defaults to “0.0.0.0”. As usual, role is also optional, it can be participant or observer (participant by default).

    client port 一般就是 2181

    但这个 /zookeeper/config 路径看起来默认是有权限控制的,直接 reconfig -add 会因为没权限而失败。

    有两个办法

    方法1

    1. ZK 启动的时候需要有一个 admin 用户,Environment=”SERVER_JVMFLAGS=-Dzookeeper.DigestAuthenticationProvider.superDigest=admin:cGFzc3dvcmQK” 通过启动的时候添加这个参数

    2. addauth digest admin:password zk shell 里面配置认证,然后再 reconfig

    方法2

    所有ZK 配置文件里面添加 skipACL=yes 然后依次重启。

    另外想吐槽一点点,觉得有些和普遍的观念相悖的地方:

    添加一个新 ZK 节点的时候,需要在 zoo.cfg 里面先配置上 server.xxx=xxx:xxx,否则启动失败。

    然而,添加这个配置启动之后,dynamic 配置又自动把它去掉了,还需要在 zkshell 里面再次 reconfig -add 添加一次。

  • 蠢就是坏

    如果你没有办法区分两个东西,那他们对你来说就是同一件事,比如:蠢就是坏。

  • 冷空气

    这几天的实践证明,冷空气里面跑步会导致喉咙轻微的不舒服。

  • Avro Schema Registry Auth

    cat schema-registry.properties
    authority.header=schema-registry-admin
    
    curl -H 'authority.header:schema-registry.properties' -XDELETE
    
  • Sort By Multi Fields

    sort -hk4,2 -k1,1
    
  • Sort Case Sensitive

    LC_COLLATE=C sort

    This variable governs the collation rules used for sorting and regular expressions. Setting the value to C can for example make the ls command sort dotfiles first, followed by uppercase and lowercase filenames

    https://wiki.archlinux.org/title/locale

  • Terminated Pod

    delete pod 卡在 “I0911 18:34:01.334912 825565 kubelet_pods.go:979] Pod “xxxx(689dec0e-6057-4221-aa29-d9618c20d3c7)” is terminated, but some volumes have not been cleaned up”。

    mount grep 689dec0e

    看到有一些相关的 mount 需要 umount。

  • Parameter Substitution

    Advanced Bash-Scripting Guide: Manipulating Variables

    ${parameter-default} and ${parameter:-default} are almost equivalent. The extra : makes a difference only when parameter has been declared, but is null.

    #!/bin/bash
    # param-sub.sh
    
    #  Whether a variable has been declared
    #+ affects triggering of the default option
    #+ even if the variable is null.
    
    username0=
    echo "username0 has been declared, but is set to null."
    echo "username0 = ${username0-`whoami`}"
    # Will not echo.
    
    echo
    
    echo username1 has not been declared.
    echo "username1 = ${username1-`whoami`}"
    # Will echo.
    
    username2=
    echo "username2 has been declared, but is set to null."
    echo "username2 = ${username2:-`whoami`}"
    #                            ^
    # Will echo because of :- rather than just - in condition test.
    # Compare to first instance, above.
    
    
    #
    
    # Once again:
    
    variable=
    # variable has been declared, but is set to null.
    
    echo "${variable-0}"    # (no output)
    echo "${variable:-1}"   # 1
    #               ^
    
    unset variable
    
    echo "${variable-2}"    # 2
    echo "${variable:-3}"   # 3
    
    exit 0
    
  • 自洽

    自洽未必是好人,但他至少是逻辑上讲的通的,也就是不能有矛盾。那这个必须基于一些大家都普遍认可的观点,比如“我不允许别人做这件事,就默认代表了我自己也不会做;如果我做了一件事,默认代表我也允许别人做这样的事。”

    我和不自洽的人相处就非常难受。

  • Disk Benchmark

    只读(随机读占大部分)不写的情况下, 70% 的饱和度

    如果再有写的时候,读被压缩,util 升到100%

    r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
    1753.00    0.00 85020.00     0.00    97.00     3.79    2.20    2.20    0.00   0.40  70.90
    956.00 1600.00 55700.00 1383128.00  1125.84    39.20   13.17    8.60   15.90   0.38  96.30
    111.00  901.00  7440.00 795104.00  1586.06   164.88  147.85  231.57  137.54   0.99 100.00