2016-11-28

Installing AeroSpike on ArchLinux

As benchmarked previously (more than half year ago since this blog post written), AeroSpike has awesome search/retrieval performance. In this tutorial we will learn how to install AeroSpike on ArchLinux

wget -O aerospike.tgz 'http://aerospike.com/download/server/latest/artifact/tgz'
tar -xvfz aerospike.tgz
cd aerospike-server
./bin/aerospike init

Configure the etc/aerospike.conf into something like this:

service {
  user YOUR_USERNAME
  group YOUR_GROUP
  run-as-daemon
  paxos-single-replica-limit 1 
  pidfile /home/YOUR_USERNAME/aerospike-server/var/run/aerospike.pid
  transaction-queues 8
  transaction-threads-per-queue 8
  transaction-pending-limit 255 # HOT KEY ERROR WORKAROUND FOR INCREMENT
  proto-fd-max 15000
  work-directory /home/YOUR_USERNAME/aerospike-server/var
}

logging {
  file /home/YOUR_USERNAME/aerospike-server/var/log/aerospike.log {
    context any info
  }
}

mod-lua {
  system-path /home/YOUR_USERNAME/aerospike-server/share/udf/lua
  user-path /home/YOUR_USERNAME/aerospike-server/var/udf/lua
}

network {
  service {
    address any
    port 3333 # USE DIFFERENT PORT IF CONFLICT 
    #reuse-address # COMMENT/REMOVE THIS PART
  }
  heartbeat {
    mode multicast
    multicast-group 239.1.99.222 # CHANGE address INTO multicast-group
    port 9918
    interval 150
    timeout 10
  }
  fabric {
    port 3331 # USE DIFFERENT PORT IF CONFLICT 
  }
  info {
    port 3332 # USE DIFFERENT PORT IF CONFLICT 
  }
}

namespace test {
  replication-factor 2
  memory-size 4G # CHANGE DEPENDS ON YOUR RAM
  default-ttl 0 # CHANGE 30 days, use 0 to never expire/evict.
  storage-engine device {
    file /home/YOUR_USERNAME/aerospike-server/data
    filesize 128M # MAX SIZE OF EACH FILE
  }
}

Then start the server:

./bin/aerospike restart
tail -f var/log/aerospike.log &
./bin/aerospike status

First and last command should show something like this:

info: stopped
info: started
info: process running

Done, now you can test your aerospike server using any client :3

No comments :

Post a Comment

THINK: is it True? is it Helpful? is it Inspiring? is it Necessary? is it Kind?