当源代码有过修改之后,自动 build 重启
~/go/bin/bee run logan
当源代码有过修改之后,自动 build 重启
~/go/bin/bee run logan
查看所有的 topic
bin/kafka-topics.sh --list --zookeeper localhost:2181
修改为 60s
# bin/kafka-configs.sh --zookeeper localhost:2181 --alter --entity-name provider-service --entity-type topics --add-config retention.ms=60000
查看
# bin/kafka-configs.sh --zookeeper localhost:2181 --describe --entity-name provider-service --entity-type topics Configs for topics:provider-service are retention.ms=60000
输入 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
查看索引
http://127.0.0.1:9200/_cat/indices
查看节点
http://10.18.19.93:9200/_nodes
查看 mappings
http://10.18.19.70:9200/_mappings
查看健康状态
_cluster/health
每个 index 状态
_cluster/health?level=indices
删除 index
curl -XDELETE 1.2.3.4:9200/notification_msgcount_logs-2019.24
按存储大小排序
curl -XGET 'http://127.0.0.1:9200/_cat/indices/_all?v&s=store.size'
查看未分配 shard 的原因
GET _cluster/allocation/explain?pretty
FORBIDDEN/12/index read-only 报错
es磁盘已满而无法索引更多文档,则elasticsearch将切换为只读。它确保了只读查询的可用性。
blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];: [cluster_block_exception] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];
进行 index 的删除的同时。Elasticsearch不会自动切换回来,可以使用如下方法切换回正常模式:
PUT _settings
{
“index.blocks.read_only_allow_delete”: “false”
}
# 检查
GET _settings
要迁移 docker image 有三个方法
1.拿到 docker repo, Dockerfile 重新 build
docker build .
2.通过 docker registry
docker pull image
3.打包后通过文件迁移
保存一个 tar 文件
docker save -o fedora-latest.tar fedora:latest
把文件传输到目标机器
docker load -i path to image tar file
在进行 docker build 时,遇到
Could not resolve host: mirrors.aliyun.com; Unknown error
解决办法
docker build --network=host --no-cache .