LoginSignup
0
0

More than 3 years have passed since last update.

Ubuntu16.04でCassandraをインストール

Last updated at Posted at 2019-09-24

はじめに

Ubuntu16.04によるCassandraインストール手順と動作確認が意外と大変だったため、
共有します。

CassandoraのApacheリポジトリの追加(バージョン3.11の場合)

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

Apache Cassandraリポジトリキーを追加

$ curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -

リポジトリを更新

$ sudo apt-get update

※以下のエラーが発生した場合

GPG error: http://www.apache.org 311x InRelease: 
The following signatures couldn't be verified because the public key is not available: 
NO_PUBKEY A278B781FE4B2BDA

公開鍵の追加

$ sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key A278B781FE4B2BDA

もう一度リポジトリの更新

$ sudo apt-get update

Cassandraをインストール

$ sudo apt-get install cassandra

Cassandraの起動

$ sudo service cassandra start

※メモリが少ないとCassandraが起動直後に落ちるため、ログを確認する

$ sudo tail -f /var/log/cassandra/system.log

Cassandraの起動確認

$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh>

※以下のエラーがでた場合

tttt@XXXXXX:~$ cqlsh
Connection error: ('Unable to connect to any servers', 
{'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)].
 Last error: Connection refused")})

Cassandra起動には時間がかかるため、30秒ほど待ってからもう一度起動確認を行う。

おわりに

以上がCassandraのインストール手順と動作確認になります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0