Ubuntu 22.04 Apache Cassandraをインストールする

環境
OSバージョンを確認します

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

Javaバージョンを確認します

# java --version
openjdk 18.0.2-ea 2022-07-19
OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)
OpenJDK 64-Bit Server VM (build 18.0.2-ea+9-Ubuntu-222.04, mixed mode, sharing)

pythonバージョンを確認します

# python --version
Python 3.10.6

操作方法
1.Apache Cassandraリポジトリに登録します

# echo "deb http://www.apache.org/dist/cassandra/debian 40x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
deb http://www.apache.org/dist/cassandra/debian 40x main

2.Apache Cassandraパッケージの更新を行います

# sudo apt update

3.公開鍵をインポートします

# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E91335D77E3E87CB
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.BSnw1ohZe0/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys E91335D77E3E87CB
gpg: 鍵E91335D77E3E87CB: 公開鍵"Michael Semb Wever <mick@thelastpickle.com>"をインポートしました
gpg: 処理数の合計: 1
gpg: インポート: 1

パッケージを更新します

# sudo apt update

4.インストール可能の最新のApache Cassandraを確認します

# sudo apt info cassandra
Package: cassandra
Version: 4.0.5
Priority: extra
Section: misc
Maintainer: Eric Evans <eevans@apache.org>
Installed-Size: 58.8 MB
Depends: openjdk-8-jre-headless | java8-runtime | openjdk-11-jre-headless | java11-runtime, adduser, python3 (>= 3.6), procps
Recommends: ntp | time-daemon
Suggests: cassandra-tools
Conflicts: apache-cassandra1
Replaces: apache-cassandra1
Homepage: http://cassandra.apache.org
Download-Size: 47.5 MB
APT-Sources: http://www.apache.org/dist/cassandra/debian 40x/main amd64 Packages
Description: distributed storage system for structured data
 Cassandra is a distributed (peer-to-peer) system for the management
 and storage of structured data.

5.Apache cassandraをインポートします

# sudo apt install -y cassandra

6.Apache Cassandraの起動状況を確認します

# sudo systemctl status cassandra
● cassandra.service - LSB: distributed storage system for structured data
     Loaded: loaded (/etc/init.d/cassandra; generated)
     Active: active (exited) since Sun 2022-10-23 22:55:48 JST; 3min 24s ago

7.クラスタの状況を確認します

# sudo systemctl status cassandra
● cassandra.service - LSB: distributed storage system for structured data
     Loaded: loaded (/etc/init.d/cassandra; generated)
     Active: active (exited) since Sun 2022-10-23 22:55:48 JST; 3min 24s ago

 

Ubuntu 22.04

Posted by arkgame