gpt4 book ai didi

docker - 无法在 Docker 中将 nodetool 命令和 cqlsh 运行到 Scylla

转载 作者:行者123 更新时间:2023-12-05 01:27:18 27 4
gpt4 key购买 nike

我是 Scylla 的新手,我按照此页面的说明在容器中试用它:https://hub.docker.com/r/scylladb/scylla/ .

以下命令运行良好。

docker run --name some-scylla --hostname some-scylla -d scylladb/scylla

我看到容器正在运行。

CONTAINER ID   IMAGE             COMMAND                  CREATED          STATUS          PORTS                                                            NAMES
e6c4e19ff1bd scylladb/scylla "/docker-entrypoint.…" 14 seconds ago Up 13 seconds 22/tcp, 7000-7001/tcp, 9042/tcp, 9160/tcp, 9180/tcp, 10000/tcp some-scylla

但是,我无法使用 nodetoolcqlsh。我得到以下输出。

$ docker exec -it some-scylla nodetool status
Using /etc/scylla/scylla.yaml as the config file
nodetool: Unable to connect to Scylla API server: java.net.ConnectException: Connection refused (Connection refused)
See 'nodetool help' or 'nodetool help <command>'.

$ docker exec -it some-scylla cqlsh
Connection error: ('Unable to connect to any servers', {'172.17.0.2': error(111, "Tried connecting to [('172.17.0.2', 9042)]. Last error: Connection refused")})

有什么想法吗?

更新

查看 docker logs some-scylla 我看到日志中有一些错误,最后一个如下。

2021-10-03 07:51:04,771 INFO spawned: 'scylla' with pid 167
Scylla version 4.4.4-0.20210801.69daa9fd0 with build-id eb11cddd30e88ef39c32c847e70181b5cf786355 starting ...
command used: "/usr/bin/scylla --log-to-syslog 0 --log-to-stdout 1 --default-log-level info --network-stack posix --developer-mode=1 --overprovisioned --listen-address 172.17.0.2 --rpc-address 172.17.0.2 --seed-provider-parameters seeds=172.17.0.2 --blocked-reactor-notify-ms 999999999"
parsed command line options: [log-to-syslog: 0, log-to-stdout: 1, default-log-level: info, network-stack: posix, developer-mode: 1, overprovisioned, listen-address: 172.17.0.2, rpc-address: 172.17.0.2, seed-provider-parameters: seeds=172.17.0.2, blocked-reactor-notify-ms: 999999999]
ERROR 2021-10-03 07:51:05,203 [shard 6] seastar - Could not setup Async I/O: Resource temporarily unavailable. The most common cause is not enough request capacity in /proc/sys/fs/aio-max-nr. Try increasing that number or reducing the amount of logical CPUs available for your application
2021-10-03 07:51:05,316 INFO exited: scylla (exit status 1; not expected)
2021-10-03 07:51:06,318 INFO gave up: scylla entered FATAL state, too many start retries too quickly

更新 2

在上面链接的 docker hub 页面上描述了错误的原因。我必须使用 --smp 1 启动指定 CPU 数量的容器,如下所示。

docker run --name some-scylla --hostname some-scylla -d scylladb/scylla --smp 1

根据上面的页面:

This command will start a Scylla single-node cluster in developer mode(see --developer-mode 1) limited by a single CPU core (see --smp).Production grade configuration requires tuning a few kernel parameterssuch that limiting number of available cores (with --smp 1) is thesimplest way to go.

Multiple cores requires setting a proper value to the/proc/sys/fs/aio-max-nr. On many non production systems it will beequal to 65K. ...

最佳答案

正如您所发现的,为了能够使用额外的 CPU 内核,您需要增加 fs.aio-max-nr 内核参数。

您可以以 root 身份运行:

# sysctl -w fs.aio-max-nr=65535

对于大多数系统来说应该足够了。如果您仍然有任何错误阻止它使用您的所有 CPU 内核,请进一步增加它的值。

请注意上面的配置不是持久的。编辑 /etc/sysctl.conf 以使其在重新启动后保持不变。

关于docker - 无法在 Docker 中将 nodetool 命令和 cqlsh 运行到 Scylla,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69423156/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com