我是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
然而,我无法使用nodetool
或cqlsh
。我得到以下输出:
$ 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
根据上面的页面:
该命令将以开发者模式启动Scylla单节点集群(参见
--developer-mode 1
)受单个CPU核心(参见--smp
)的限制。生产级配置需要调优一些内核参数因此,限制可用内核的数量(使用--smp 1
)是最重要的这是最简单的办法。多核需要设置合适的值
/proc/sys/fs/aio-max-nr
。在许多非生产系统中,它将是等于65K. ...
正如您所发现的,为了能够使用额外的CPU内核,您需要增加fs.aio-max-nr
内核参数。
您可以以root用户运行:
# sysctl -w fs.aio-max-nr=65535
对于大多数系统来说应该足够了。如果您仍然有任何错误阻止它使用所有CPU内核,请进一步增加其值。
请注意,上面的配置不是持久的。编辑/etc/sysctl.conf
,使其在重启时保持不变。