小编Fra*_*iat的帖子

每个inode有多少个字节?

我需要创建非常多的文件,这些文件不是很大(如4kb,8kb).这在我的计算机上是不可能的,因为它使所有inode达到100%并且我无法创建更多文件:

$ df -i /dev/sda5
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda5            54362112 36381206 17980906   67% /scratch
Run Code Online (Sandbox Code Playgroud)

(我开始删除文件,这就是为什么它现在是67%)

我的文件系统上每个节点的字节数为256(ext4)

$ sudo tune2fs -l /dev/sda5 | grep Inode
Inode count:              54362112
Inodes per group:         8192
Inode blocks per group:   512
Inode size:               256
Run Code Online (Sandbox Code Playgroud)

我想知道是否可以将此值设置得非常低,甚至低于128(在重新格式化期间).如果是,我应该使用什么价值?谢谢

filesystems inode ext4

24
推荐指数
2
解决办法
6万
查看次数

Docker standard_init_linux.go:228: exec 用户进程导致:没有这样的文件或目录

每当我尝试运行 docker 镜像时,它都会立即退出。

CONTAINER ID   IMAGE                      COMMAND                CREATED          STATUS                      PORTS     NAMES
ae327a2bdba3   k8s-for-beginners:v0.0.1   "/k8s-for-beginners"   11 seconds ago   Exited (1) 10 seconds ago             focused_booth
Run Code Online (Sandbox Code Playgroud)

根据容器日志

standard_init_linux.go:228: exec user process caused: no such file or directory
Run Code Online (Sandbox Code Playgroud)

我已经在linux本身中创建了所有文件:

FROM alpine:3.10
COPY k8s-for-beginners /
CMD ["/k8s-for-beginners"]
Run Code Online (Sandbox Code Playgroud)

前往代码:

package main

import (
    "fmt"
    "log"
    "net/http"
)

func main() {
    http.HandleFunc("/", handler)
    log.Fatal(http.ListenAndServe("0.0.0.0:8080", nil))
}

func handler(w http.ResponseWriter, r *http.Request) {
    log.Printf("Ping from %s", r.RemoteAddr)
    fmt.Fprintln(w, "Hello Kubernetes Beginners!")
}
Run Code Online (Sandbox Code Playgroud)

这是 KUBERNETES WORKSHOP 书中的第一个练习。

我在此过程中使用的命令:

CGO_ENABLED=0 …
Run Code Online (Sandbox Code Playgroud)

linux containers go docker kubernetes

22
推荐指数
3
解决办法
5万
查看次数

Prometheus 在计算两个指标的比率时不返回任何数据

我想计算两个指标的比率,但我没有得到任何数据...

我有一些指标,例如:

fs_bytes{filesystem="/var",instance="localhost:9108",job="graphite",metric="Used"}   50.0
fs_bytes{filesystem="/var",instance="localhost:9108",job="graphite",metric="Total"}   100.0
Run Code Online (Sandbox Code Playgroud)

当我尝试执行任何操作(设备、乘法、加法、减法)时,例如:

fs_bytes{instance="localhost:9108",metric="Used"} / fs_bytes{instance="localhost:9108",metric="Total"}
Run Code Online (Sandbox Code Playgroud)

普罗米修斯返回:

no data
Run Code Online (Sandbox Code Playgroud)

当我在 Prometheus 表达式浏览器中单独查询每个指标时,我确实得到了指标值。

怎么了?

prometheus promql

12
推荐指数
1
解决办法
8557
查看次数

替换python statvfs?

自python 2.6以来,python statvfs模块被标记为已弃用,现在它已从python 3.0中删除.如果他们想要获取有关磁盘的信息,特别是如何检查给定路径的容量和可用空间,我无法弄清楚应该使用哪些应用程序.有人有什么想法吗?这是在os x上,如果这有所不同,虽然跨平台将是一个加号.

python

7
推荐指数
1
解决办法
3969
查看次数

如何使用pywinauto模拟游戏中的键

我一直在尝试各种各样的事情.我是初学者在python中的水平.Project Euler中的前两个问题.

我尝试了一些方法来尝试和模拟我玩的游戏中的键.我可以使用autohotkey和宏键盘/鼠标轻松完成此操作.但是,我想通过Python或C来实现这一目标.

我的猜测是在视频游戏中忽略了win32 api,我需要通过Direct X来模拟按键.

先感谢您.这是我最近的尝试......它失败了.

每次运行游戏的新实例时,我都必须抓取/更改句柄.

我的模拟按键可以在浏览器和记事本中使用,而不是在游戏中.不工作,我的意思是没有用户输入.

以下代码将切换到窗口,但不会模拟用户的输入.

import pywinauto
import time
from pywinauto import application
app = application.Application()
app.connect_(handle = 0x14002a)
dialogs = app.windows_(handle = 0x14002a)
dlg = app.top_window_()
time.sleep(1)
app.MapleStory.TypeKeys("%A")
time.sleep(1)
app.MapleStory.TypeKeys("%A")
time.sleep(1)
app.MapleStory.TypeKeys("%A")
time.sleep(1)
app.MapleStory.TypeKeys("%A")
time.sleep(1)
app.MapleStory.TypeKeys("%A")
time.sleep(1)
app.MapleStory.TypeKeys("%A")
Run Code Online (Sandbox Code Playgroud)

python windows directx

5
推荐指数
1
解决办法
2427
查看次数

列出Jenkins插件和依赖项(带图)

我已经为Jenkins添加了许多插件.如何列出插件和依赖项?哪些插件取决于哪些插件?哪些是孤儿或未使用的等

理想情况下,解释如何制作图表(graphviz/dot ...)?

dot jenkins jenkins-plugins

4
推荐指数
1
解决办法
1904
查看次数

移动或更改卷命名空间

我们在 Kubernetes 中重新组织了我们的命名空间。我们希望将存储类创建的持久卷声明从一个命名空间移动到另一个命名空间。

(我们的备份工具没有帮助)。

storage volume kubernetes kubernetes-pvc

4
推荐指数
1
解决办法
1375
查看次数

CDash 是一个持续集成系统吗?

前几天我在关于持续集成的对话中提到了CDash。有同事说CDash不是CI系统,是测试系统。我们没有机会详细说明。

CDash 真的不是 CI 系统吗?

那么有什么区别呢?

continuous-integration cdash

3
推荐指数
1
解决办法
857
查看次数

为什么 cAdvisor 指标中的容器内存使用量翻倍?

我测试了这些查询。第一个查询的值是第二个查询的一半:

sum(container_memory_working_set_bytes{image!="",name=~"^k8s_.*",pod=~"$pod"}) by (pod)

sum (container_memory_working_set_bytes{pod=~"$pod"}) by (pod)

为什么写作的image! = "", name = ~ "^ k8s_. *"价值会减半?

cgroups kubernetes prometheus cadvisor kubernetes-pod

3
推荐指数
1
解决办法
6068
查看次数

使用插件 metrics-reporter-prometheus 通过 Prometheus 监控 Gerrit 内部

我想用Prometheus监视Gerrit守护进程。

如何配置 Gerrit 的插件metrics-reporter-prometheus和 Prometheus 进行白盒监控?

免责声明:此导出器主要公开 Gerrit 守护进程内部指标,由Dropwizard 指标生成。项目数、待审...未报告

注 2:我对使用通用导出器(JMX 导出器、Javamelody...)不感兴趣

这个出口商的典型指标如下:

# HELP caches_disk_cached_git_tags Generated from Dropwizard metric import (metric=caches/disk_cached/git_tags, type=com.google.gerrit.metrics.dropwizard.BucketedCallback$ValueGauge)
# TYPE caches_disk_cached_git_tags gauge
caches_disk_cached_git_tags 0.0
# HELP http_server_rest_api_response_bytes_project_ListProjects Generated from Dropwizard metric import (metric=http/server/rest_api/response_bytes/project.ListProjects, type=com.codahale.metrics.Histogram)
# TYPE http_server_rest_api_response_bytes_project_ListProjects summary
http_server_rest_api_response_bytes_project_ListProjects{quantile="0.5",} 216.0
http_server_rest_api_response_bytes_project_ListProjects{quantile="0.75",} 216.0
http_server_rest_api_response_bytes_project_ListProjects{quantile="0.95",} 216.0
http_server_rest_api_response_bytes_project_ListProjects{quantile="0.98",} 216.0
http_server_rest_api_response_bytes_project_ListProjects{quantile="0.99",} 216.0
http_server_rest_api_response_bytes_project_ListProjects{quantile="0.999",} 216.0
http_server_rest_api_response_bytes_project_ListProjects_count 3.0
# HELP http_server_rest_api_response_bytes_query_change_QueryChanges Generated from Dropwizard metric import (metric=http/server/rest_api/response_bytes/query.change.QueryChanges, type=com.codahale.metrics.Histogram)
# TYPE http_server_rest_api_response_bytes_query_change_QueryChanges …
Run Code Online (Sandbox Code Playgroud)

monitor gerrit prometheus

1
推荐指数
1
解决办法
1384
查看次数