Debian 爱好者社区 为您找到相关结果 753

nsenter 及 Linux命名空间 简介

); /* Get file descriptor for namespace */ if (fd == -1) errExit("open"); if (setns(fd, 0) == -1) /* Join that namespace */ errExit("setns"); execvp(argv[2], &argv[2]); /* Execute a command in namespace */ errExit("execvp"); } 使用示例: ./ns_exec /proc/3550/ns/uts /bin/bash nsenter 那么,最后就是nsenter了,nsenter相当于在setns的示例程序之做了一层封装,使我们无需指定命名空间的文件描述符,而是指定进程号即可。 指定进程...阅读全文

博文 2020-12-15 11:22:44 debian.cn

Kubernetes常用命令大全(持续更新)

nginx RC 创建服务,启用本地 80 端口连接到容器的 8000 端口 kubectl expose rc nginx --port=80 --target-port=8000 更新单容器 pod 的镜像版本(tag)到 v4 kubectl get pod nginx-pod -o yaml | sed 's/(image: myimage):.*$/\1:v4/' | kubectl replace -f - kubectl label pods nginx-pod new-label=awesome #### 添加标签 kubectl annotate pods nginx-pod icon-url=http://goo.gl/XXBTWq #### 添加注解 kubectl...阅读全文

博文 2020-03-13 12:35:13 debian.cn

Cortex: 高可用和水平扩展Prometheus监控系统

复制。有三个Prometheus配置文件。它们具有外部标签,在执行远程写入时将标签添加到所有指标。Prometheus1和Prometheus3容器写入Cortex1,而Prometheus2容器写入Cortex2。我们将在Cortex3运行查询。以下代码片段显示了三个Prometheus实例的配置差异。# Prometheus one global: # ... external_labels: cluster: two # ... remote_write: - url: http://cortex2:9009/api/prom/push # Prometheus two global: # ... external_labels: cluster: two...阅读全文

博文 2021-10-09 17:00:22 知乎