채팅 데이터를 Scylladb에 넣어야해서 ubuntu에 설치한 걸 기록하고자 한다.
Server spec
AWS EC2 t2.medium
포트포워딩
- 9042
Scylladb에서 권장하는 ubuntu 설치를 따라 진행했다.
패키지를 받을 수 있게 설정
sudo mkdir -p /etc/apt/keyrings
sudo gpg --homedir /tmp --no-default-keyring --keyring /etc/apt/keyrings/scylladb.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys d0a112e067426ab2
sudo curl -L --output /etc/apt/sources.list.d/scylla.list http://downloads.scylladb.com/deb/ubuntu/scylla-5.1.list
sudo apt-get update
에러 1 - sudo apt-get install -y scylla
GPG error: http://downloads.scylladb.com/downloads/scylla/deb/debian-ubuntu/scylladb-5.1 stable InRelease: The following signatures couldn't be verified because the public key is not available
해결 1
NO_PUBKEY 뒤에 있는 문자들을 복사해놓고
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys '복사한문자열'
sudo apt-get install -y scylla
scylladb version 확인
scylla --version
설정파일 위치
vim /etc/scylla/scylla.yaml
변경한 내용
rpc_address : 0.0.0.0
//주석해제
broadcast_rpc_address : 1.2.3.4
//로그인설정 변경 - passwd
authenticator: PasswordAuthenticator
저장 - wq!
Scylladb Setup
sudo scylla_setup
설명은 잘 읽어보고 Yes or No로 원하는대로 설정하면 되고 내가 설정한 부분들을 참고하도록 남겨놓겠다.
Skip any of the following steps by answering 'no'
Do you want to run check your kernel version?
Yes - runs a script to verify that the kernel for this instance qualifies to run Scylla. No - skips the kernel check.
[YES/no]yes
INFO 2023-01-01 05:56:20,253 [shard 1] seastar - Created fair group io-queue-0, capacity rate 2147483:2147483, limit 12582912, rate 16777216 (factor 1), threshold 2000
INFO 2023-01-01 05:56:20,254 [shard 1] seastar - IO queue uses 0.75ms latency goal for device 0
INFO 2023-01-01 05:56:20,255 [shard 1] seastar - Created io group dev(0), length limit 4194304:4194304, rate 2147483647:2147483647
INFO 2023-01-01 05:56:20,257 [shard 0] seastar - Created io queue dev(0) capacities: 512:2000:2000 1024:3000:3000 2048:5000:5000 4096:9000:9000 8192:17000:17000 16384:33000:33000 32768:65000:65000 65536:129000:129000 131072:257000:257000
WARN 2023-01-01 05:56:20,348 [shard 0] iotune - Available space on filesystem at /var/tmp/mnt: 121 MB: is less than recommended: 10 GB
INFO 2023-01-01 05:56:20,348 [shard 0] iotune - /var/tmp/mnt passed sanity checks
This is a supported kernel version.
Do you want to verify the ScyllaDB packages are installed?
Yes - runs a script to confirm that ScyllaDB is installed. No - skips the installation check.
[YES/no]yes
Do you want the Scylla server service to automatically start when the Scylla node boots?
Yes - Scylla server service automatically starts on Scylla node boot. No - skips this step. Note you will have to start the Scylla Server service manually.
[YES/no]yes
Created symlink /etc/systemd/system/multi-user.target.wants/scylla-server.service → /lib/systemd/system/scylla-server.service.
Do you want to enable Scylla to check if there is a newer version of Scylla available?
Yes - start the Scylla-housekeeping service to check for a newer version. This check runs periodically. No - skips this step.
[YES/no]yes
Do you want to setup Network Time Protocol(NTP) to auto-synchronize the current time on the node?
Yes - enables time-synchronization. This keeps the correct time on the node. No - skips this step.
[YES/no]yes
ntp is already configured, skip setup
Do you want to setup RAID and XFS?
It is recommended to use RAID and XFS for Scylla data. If you select yes, you will be prompted to choose the unmounted disks to use for Scylla data. Selected disks are formatted as part of the process.
Yes - choose a disk/disks to format and setup for RAID and XFS. No - skip this step.
[YES/no]yes
Are you sure you want to setup RAID and XFS?
If you choose Yes, the selected drive will be reformated, erasing all existing data in the process.
[YES/no]no
Do you want to enable coredumps?
Yes - sets up coredump to allow a post-mortem analysis of the Scylla state just prior to a crash. No - skips this step.
[YES/no]no
Do you want to setup a system-wide customized configuration for Scylla?
Yes - setup the sysconfig file. No - skips this step.
[YES/no]yes
Do you want to enable Network Interface Card (NIC) and disk(s) optimization?
Yes - optimize the NIC queue and disks settings. Selecting Yes greatly improves performance. No - skip this step.
[yes/NO]yes
The clocksource is the physical device that Linux uses to take time measurements. In most cases Linux chooses the fastest available clocksource device as long as it is accurate. In some situations, however, Linux errs in the side of caution and does not choose the fastest available clocksource despite it being accurate enough. If you know your hardwares fast clocksource is stable enough, choose "yes" here. The safest is the choose "no" (the default)
Yes - enforce clocksource setting. No - keep current configuration.
[yes/NO]no
Do you want IOTune to study your disks IO profile and adapt Scylla to it? (*WARNING* Saying NO here means the node will not boot in production mode unless you configure the I/O Subsystem manually!)
Yes - let iotune study my disk(s). Note that this action will take a few minutes. No - skip this step.
[YES/no]yes
tuning /sys/devices/vbd-768/block/xvda/xvda1
tuning /sys/devices/vbd-768/block/xvda
tuning: /sys/devices/vbd-768/block/xvda/queue/nomerges 2
tuning /sys/devices/vbd-768/block/xvda/xvda1
tuning /sys/devices/vbd-768/block/xvda/xvda1
tuning /sys/devices/vbd-768/block/xvda/xvda1
INFO 2023-01-01 06:00:27,669 [shard 1] seastar - Created fair group io-queue-0, capacity rate 2147483:2147483, limit 12582912, rate 16777216 (factor 1), threshold 2000
INFO 2023-01-01 06:00:27,670 [shard 1] seastar - IO queue uses 0.75ms latency goal for device 0
INFO 2023-01-01 06:00:27,670 [shard 1] seastar - Created io group dev(0), length limit 4194304:4194304, rate 2147483647:2147483647
INFO 2023-01-01 06:00:27,670 [shard 0] seastar - Created io queue dev(0) capacities: 512:2000:2000 1024:3000:3000 2048:5000:5000 4096:9000:9000 8192:17000:17000 16384:33000:33000 32768:65000:65000 65536:129000:129000 131072:257000:257000
INFO 2023-01-01 06:00:28,494 [shard 0] iotune - /var/lib/scylla/view_hints passed sanity checks
WARN 2023-01-01 06:00:28,494 [shard 0] iotune - Scheduler for /sys/devices/vbd-768/block/xvda/queue/scheduler set to mq-deadline. It is recommend to set it to noop before evaluation so as not to skew the results.
INFO 2023-01-01 06:00:28,494 [shard 0] iotune - Disk parameters: max_iodepth=64 disks_per_array=1 minimum_io_size=512
Starting Evaluation. This may take a while...
Measuring sequential write bandwidth: yes
61 MB/s (deviation 10%)
Measuring sequential read bandwidth: 66 MB/s (deviation 24%)
Measuring random write IOPS: 3298 IOPS (deviation 24%)
Measuring random read IOPS: 3060 IOPS
Writing result to /etc/scylla.d/io_properties.yaml
Writing result to /etc/scylla.d/io.conf
Created symlink /etc/systemd/system/multi-user.target.wants/scylla-node-exporter.service → /lib/systemd/system/scylla-node-exporter.service.
Do you want to set the CPU scaling governor to Performance level on boot?
Yes - sets the CPU scaling governor to performance level. No - skip this step.
[YES/no]This computer doesn't supported CPU scaling configuration.
Do you want to enable fstrim service?
Yes - runs fstrim on your SSD. No - skip this step.
[yes/NO]NO'
[yes/NO]NP
[yes/NO]no
Will Scylla be the only service on this host?
Answer yes to lock all memory to Scylla, to prevent swapout. Answer no to do nothing.
[YES/no]yes
No swap is configured, it is highly recommended to setup swap on Scylla node.
Do you want to configure swapfile?
Answer yes to setup swapfile to Scylla, Answer no to do nothing.
[YES/no]no
Do you want to configure rsyslog to send log to a remote repository?
Answer yes to setup rsyslog to a remote server, Answer no to do nothing.
[YES/no]no
ScyllaDB setup finished.
scylla_setup accepts command line arguments as well! For easily provisioning in a similar environment than this, type:
scylla_setup --no-raid-setup --online-discard --nic eth0 \
--no-coredump-setup --io-setup 1 --no-fstrim-setup \
--no-swap-setup --no-rsyslog-setup
Also, to avoid the time-consuming I/O tuning you can add --no-io-setup and copy the contents of /etc/scylla.d/io*
Only do that if you are moving the files into machines with the exact same hardware
상태 확인
sudo nodetool status
서버 시작
service scylla-server start
내가 사용할 유저 생성
sudo cqlsh -u cassandra -p cassandra
> CREATE USER root WITH PASSWORD 'your_password' SUPERUSER;
> exit
sudo cqlsh -u root -p 'your_password'
> DROP USER cassandra;
> LIST USERS;
'DB' 카테고리의 다른 글
채팅 영구저장 - RDB vs NoSQL (0) | 2022.12.29 |
---|---|
Ubuntu 20.04 - Redis 설치 (0) | 2022.08.23 |
MariaDB - Ubuntu 20.04(LTS) DB Replication -ec2 mmm(multi master manager) 서버 설정 (1) | 2022.06.28 |
Mariadb-15.1 user의 host 변경 - ALTER TABLE error (0) | 2022.06.26 |
nodejs - socket.io & mysql 끔찍한 에러 Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:217:20) (0) | 2022.06.21 |
댓글