我是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
设置适当的值。在许多非生产系统中,它将等于65,000...