实验室: 安装和启动 ScyllaDB (2的第1部分)

148 阅读2分钟

在这个实验中,我们将看到如何通过使用 Docker 运行单个实例来快速启动 ScyllaDB。然后我们将看到如何运行 CQLShell。 请确保您的环境满足以下先决条件:

  1. 适用于 Linux、 Mac 或 Windows 的 Docker。请注意,建议在 Docker 中运行 ScyllaDB 仅用于评估和尝试 ScyllaDB。为了获得最佳性能,建议安装常规操作系统。
  2. 3GB 内存或更大的内存为了使用 Docker。
  3. 如果您正在使用 Linux,那么您将需要 docker-compose。

注意: 除了这里提供的说明,它允许你在一台机器上运行实验室与多克,你可以在 Killercoda 的学习环境中找到这个实验室在这里。Killercoda 环境提供了一个交互式虚拟机,您可以直接从浏览器执行所有命令,而不需要配置任何东西。 在启动集群之前,请确保 aio-max-nr 值足够高(1048576或更高)。

这个参数决定了 Linux 内核允许的异步非阻塞 I/O (AIO)并发请求的最大数量,它有助于 ScyllaDB 在高负载的 I/O 工作负载环境中执行。 Check the value: 

cat /proc/sys/fs/aio-max-nr

If it needs to be changed:

echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf
ubuntu $ cat /proc/sys/fs/aio-max-nr
65536
ubuntu $ echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
ubuntu $ sysctl -p /etc/sysctl.conf
fs.inotify.max_user_watches = 524288
fs.aio-max-nr = 1048576
ubuntu $

view rawaio-max-nr-change.bash hosted with ❤ by GitHub

First, we’ll start a single instance and call it ScyllaDBU:

docker run --name scyllaU -d scylladb/scylla:5.2.0 --overprovisioned 1 --smp 1

Notice that some files might be downloaded in this step. After waiting for a few seconds, we’ll verify that the cluster is up and running with the Nodetool Status command:

docker exec -it scyllaU nodetool status

The node scyllaU has a UN status. “U” means up, and N means normal. Read more about Nodetool Status Here.

Finally, we use the CQL Shell to interact with ScyllaDB:

docker exec -it scyllaU cqlsh

The CQL Shell allows us to run Cassandra Query Language commands on ScyllaDB, as we will see in the next part.