Help us understand the problem. What is going on with this article?

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

はじめに

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のインストール手順と動作確認になります。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした