kafka修改 topic retention


# bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic provider-service --config retention.ms=60000
WARNING: Altering topic configuration from this script has been deprecated and may be removed in future releases.
Going forward, please use kafka-configs.sh for this functionality
Updated config for topic "provider-service".

查看

# bin/kafka-configs.sh --zookeeper localhost:2181 --describe --entity-name provider-service --entity-type topics
Configs for topics:provider-service are retention.ms=60000

bash countdown

输入 countdown + 秒数,就开始倒计时了

gnu date

function countdown(){  
    local now=$(date +%s)
    local end=$((now + $1))
    while (( now < end )); do   
        printf "%s\r" "$(date -u -d @$((end - now)) +%T)"  
        sleep 0.25  
        now=$(date +%s)
    done  
    echo
}

osx date

function countdown(){  
    echo $2
    local now=$(date +%s)
    local end=$((now + $1))
    while (( now < end )); do   
        printf "%s\r" "$(date -u -j -f %s $((end - now)) +%T)"  
        sleep 0.25  
        now=$(date +%s)
    done
}

参考:https://superuser.com/questions/850368/osx-bash-command-line-countdown-timer?answertab=votes#tab-top

docker image 迁移

要迁移 docker image 有三个方法

1.拿到 docker repo, Dockerfile 重新 build

docker build .

2.通过 docker registry

 docker pull image

3.打包后通过文件迁移

保存一个 tar 文件

docker save -o  

把文件传输到目标机器

docker load -i