LoginSignup
2
2

More than 5 years have passed since last update.

Aerospike を Ubuntu 15.04 にインストールする手順

Last updated at Posted at 2016-04-12

概要

分散KVSである Aerospike をローカルの開発環境(Ubuntu15.04)にインストールします。
さらに、AMCと呼ばれる管理コンソールのインストールも行います。

Aerospikeとは

米Aerospike社が開発している分散KVSです。
SSDに最適化されており、RDBや他のNoSQL製品に比べ高速性が大きな特徴です。
高パフォーマンスが要求されるアドテクなどのサービスで多く採用されているそうです。
他にも、SPOFが無い・スケールしやすいといった特徴があります。
なお、Community Edition は OSS で公開されています。

開発環境

Aerospike インストール

まず、ubuntu に ssh でログインします。
公式ドキュメントに従い、以下の手順でインストールしてみます。

ダウンロード

最新版をaerospikeのサイトよりダウンロードします。

$ wget -O aerospike.tgz 'http://aerospike.com/download/server/latest/artifact/ubuntu14'

インストール

ダウンロードしたパッケージを展開します。

$ tar -xvf aerospike.tgz
aerospike-server-community-3.7.5.1-ubuntu14.04/
aerospike-server-community-3.7.5.1-ubuntu14.04/aerospike-server-community-3.7.5.1.ubuntu14.04.x86_64.deb
aerospike-server-community-3.7.5.1-ubuntu14.04/aerospike-tools-3.7.5.ubuntu14.04.x86_64.deb
aerospike-server-community-3.7.5.1-ubuntu14.04/aerospike-tools-deps/
aerospike-server-community-3.7.5.1-ubuntu14.04/asinstall
aerospike-server-community-3.7.5.1-ubuntu14.04/LICENSE
aerospike-server-community-3.7.5.1-ubuntu14.04/SHA256SUMS
aerospike-server-community-3.7.5.1-ubuntu14.04/aerospike-tools-deps/install.sh
aerospike-server-community-3.7.5.1-ubuntu14.04/aerospike-tools-deps/python-argparse/
aerospike-server-community-3.7.5.1-ubuntu14.04/aerospike-tools-deps/python-bcrypt/
aerospike-server-community-3.7.5.1-ubuntu14.04/aerospike-tools-deps/python-bcrypt/install.sh
aerospike-server-community-3.7.5.1-ubuntu14.04/aerospike-tools-deps/python-argparse/install.sh

2016/4/12時点での最新版は 3.7.5.1 のようですね。
最新バージョンはこちらから確認できます。

では、実際にインストールをしてみます。

$ cd aerospike-server-community-3.7.5.1-ubuntu14.04
$ sudo ./asinstall
Installing tools dependencies
Installing python-bcrypt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  python-bcrypt
0 upgraded, 1 newly installed, 0 to remove and 41 not upgraded.
Need to get 20.9 kB of archives.
After this operation, 92.2 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ vivid/main python-bcrypt amd64 0.4-2ubuntu1 [20.9 kB]
Fetched 20.9 kB in 1s (15.1 kB/s)  
Selecting previously unselected package python-bcrypt.
(Reading database ... 60954 files and directories currently installed.)
Preparing to unpack .../python-bcrypt_0.4-2ubuntu1_amd64.deb ...
Unpacking python-bcrypt (0.4-2ubuntu1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up python-bcrypt (0.4-2ubuntu1) ...
Installing tools
dpkg -i aerospike-tools-3.7.5.ubuntu14.04.x86_64.deb
Selecting previously unselected package aerospike-tools.
(Reading database ... 60966 files and directories currently installed.)
Preparing to unpack aerospike-tools-3.7.5.ubuntu14.04.x86_64.deb ...
Unpacking aerospike-tools (3.7.5) ...
Setting up aerospike-tools (3.7.5) ...
Installing /opt/aerospike
Writing /usr/local/lib/python2.7/dist-packages/aerospike.pth
Adding python path /opt/aerospike/lib/python
Installing server
dpkg -i aerospike-server-community-3.7.5.1.ubuntu14.04.x86_64.deb
Selecting previously unselected package aerospike-server-community.
(Reading database ... 61017 files and directories currently installed.)
Preparing to unpack aerospike-server-community-3.7.5.1.ubuntu14.04.x86_64.deb ...
Unpacking aerospike-server-community (3.7.5.1-1) ...
Setting up aerospike-server-community (3.7.5.1-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (219-7ubuntu3) ...

これで Aerospike がインストールできました。

起動

早速 Aerospike を起動してみます。

$ sudo /etc/init.d/aerospike start
[ ok ] Starting aerospike (via systemctl): aerospike.service.

ステータスの確認は以下でできます。

$ sudo /etc/init.d/aerospike status

AMC インストール

Aerospikeには、GUI管理コンソールの AMCAerospike Management Console)というツールがありますので、こちらもインストールしてみます。

ダウンロード

$ wget -O aerospike-amc.deb 'http://www.aerospike.com/download/amc/3.6.8/artifact/ubuntu12'

2016/4/12時点での最新版は 3.6.8 です。
最新バージョンはこちらから確認できます。

インストール

AMC をインストールします。

$ sudo dpkg -i aerospike-amc.deb
Selecting previously unselected package aerospike-amc-community.
(Reading database ... 61056 files and directories currently installed.)
Preparing to unpack aerospike-amc.deb ...
Unpacking aerospike-amc-community (3.6.8) ...
dpkg: dependency problems prevent configuration of aerospike-amc-community:
 aerospike-amc-community depends on python-dev; however:
  Package python-dev is not installed.

dpkg: error processing package aerospike-amc-community (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 aerospike-amc-community

エラーとなってしまいました。
公式ドキュメントによると、AMCを利用するには以下のインストールが必要なようです。

  • python (2.6+)
  • gcc
  • python-dev

以下のコマンドで不足しているパッケージをインストールの上、AMCをインストールし直します。

$ sudo apt-get -f install

以下のメッセージが表示されていれば AMC のインストールは完了です。

~省略~
Successfully installed AMC.
~省略~

起動

AMC を起動してみます。

$ sudo /etc/init.d/amc start
Starting AMC....
AMC is started.

ステータスの確認は以下でできます。

$ sudo /etc/init.d/amc status

コンソール確認

ホストマシンから AMC の管理画面を表示してみます。

まず、仮想マシンのポートフォワーディングを設定する必要がありますので、ホストマシンで vagrantfile を以下のように修正します。

vagrantfile
Vagrant.configure(2) do |config|

  config.vm.box = "ubuntu15.04"
  config.vm.network "forwarded_port", guest: 8081, host: 8081
  config.vm.network "private_network", ip: "192.168.33.10"

end

仮想マシンを再起動します。
ホストマシンのコマンドプロンプトで以下を実行します。

> vagrant reload

仮想マシンにsshでログインし、Aerospike, AMC を起動します。

$ sudo /etc/init.d/aerospike start
$ sudo /etc/init.d/amc start

ホストマシンのブラウザから、以下にアクセスします。
http://localhost:8081/

amc_cluster_seed_node.png

クラスタのIPアドレスとポートを聞かれますが、とりあえず localhost:3000 としておき、「Connect」を実行。

amc.png

AMCの管理画面が無事表示されました!

2
2
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
2
2