kafka常用命令
mac启动kafka
/usr/local/Cellar/kafka/3.0.0/bin/zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties &
/usr/local/Cellar/kafka/3.0.0/bin/kafka-server-start /usr/local/etc/kafka/server.properties &
window启动kafka
./zookeeper-server-start.sh ../config/zookeeper.properties &
./kafka-server-start.sh ../config/server.properties &
查看topic列表
./kafka-topics.sh --list --bootstrap-server localhost:9092
查看topic内容
./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic TRACK_PIPELINE --from-beginning
查看组
./kafka-consumer-groups.sh --bootstrap-server 127.0.0.1:9092 --list
查看组消费情况
./kafka-consumer-groups.sh --describe --bootstrap-server 127.0.0.1:9092 --group gateway_user_limit
curl -o /dev/null -s -w %{time_namelookup}::%{time_connect}::%{time_starttransfer}::%{time_total}::%{speed_download} -X GET “172.30.1.163:9200/service_all/search”
ES常用命令
查看响应时长
curl -o /dev/null -s -w %{time_namelookup}::%{time_connect}::%{time_starttransfer}::%{time_total}::%{speed_download} -X GET "127.0.0.1:9200/service_all/search"
批量删除索引
curl -XDELETE 'http://ip:port/*_v3'
修改template
curl -XPUT 'http://ip:port/_template/logstash' -H 'Content-Type: application/json' -d ''
内存占比
ps -p PID -o pid,%mem,cmd
ps -p PID -o pid,rss,cmd
K8S 常用命令
1、命令行界面输入命令“systemctl status firewalld.service”并按下回车键。
2、然后在下方可度以查看得到“active(running)”,此时说明防火墙已经被打开了。
3、在命令行中输入systemctl stop firewalld.service命令,进行关闭防火墙。
4、然后再使用命令systemctl status firewalld.service,在下方出现disavtive(dead),这权样就说明防火墙已经关闭。
5、再在命令行中输入命令“systemctl disable firewalld.service”命令,即可永久关闭防火墙。
kubectl get namespace//获得所有命名空间
kubectl get pod --all-namespaces -o wide//获得命名空间下的所有容器
通过kubectl get pods查询,然后通过下面命令进入
kubectl exec -it nas-all-0 /bin/bash
//进入命名空间下的容器,application是命名空间,psqls-0是容器
kubectl exec -it -n application psqls-0 /bin/bash
//拷贝内容内文件,拷贝出来
kubectl cp -n application psqls-0:/var/lib/postgresql/data/pg_wal /home
//拷贝进去
kubectl cp /home/dades/pg_wal -n application psqls-0:/var/lib/postgresql/data/pg_wal
追踪名称空间 nsA 下容器组 pod1 的日志
kubectl logs -f pod1 -n nsA
追踪名称空间 nsA 下容器组 pod1 中容器 container1 的日志
kubectl logs -f pod1 -c container1 -n nsA
查看容器组 nginx 下所有容器的日志
kubectl logs nginx --all-containers=true
查看带有 app=nginx 标签的所有容器组所有容器的日志
kubectl logs -lapp=nginx --all-containers=true
查看容器组 nginx 最近20行日志
kubectl logs --tail=20 nginx
查看容器组 nginx 过去1个小时的日志
kubectl logs --since=1h nginx
curl -u elastic: -X GET “http://127.0.0.1:8018/_cluster/settings”
curl -u elastic: -X PUT “http://127.0.0.1:8018/_cluster/settings” -H ‘Content-Type: application/json’ -d’
{
“persistent”: {
“cluster”: {
“max_shards_per_node”: 10000
}
}
}
’
curl -u elastic: -X GET “http://127.0.0.1:8018/_cat/shards?h=index,shard,prirep,state,unassigned.reason”
curl -u elastic: -X PUT “http://127.0.0.1:8029/_cluster/settings” -H ‘Content-Type: application/json’ -d ‘{
“persistent”: {
“script.context.filter.max_compilations_rate”: “15000/5m”
}
}’