CentOS 6.5配置SSDB 1.8.0

分类:CentOS教程 阅读:85290 次

环境说明:

  1. wget--no-check-certificatehttps://github.com/ideawu/ssdb/archive/master.zip
  2. unzipmaster
  3. cdssdb-master
  4. make
  5. #将安装在/usr/local/ssdb目录下
  6. sudomakeinstall


开机启动 注册成服务:

1.在 /etc/init.d 目录下新建文件ssdb 内容如下:

#!/bin/sh
# chkconfig:345 98 98
# description: SSDB is a fast NoSQL database for storing big list of billions of elements
# processname:ssdb
case "$1" in
'start')
/usr/local/ssdb/ssdb-server -d /usr/local/ssdb/ssdb.conf
echo "ssdb started."
;;
'stop')
kill `cat /usr/local/ssdb/var/ssdb.pid`
echo "ssdb stopped."
;;
'restart')
kill `cat /usr/local/ssdb/var/ssdb.pid`
echo "ssdb stopped."
sleep 0.5
/usr/local/ssdb/ssdb-server -d /usr/local/ssdb/ssdb.conf
echo "ssdb started."
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac


2.给予此文件权限:

chmoda+wrx/etc/init.d/ssdb

 3.$ service ssdb start 就可以启动ssdb了
 
 打印出
 ssdb 1.8.0 Copyright (c) 2012-2014 ssdb.io ssdb started. 
 则证明启动成功。

启动SSDB 命令行客户端(ssdb-cli)

 $ /usr/local/ssdb/ssdb-cli -h 127.0.0.1 -p 8888 
 打印出
 ssdb (cli) - ssdb command line tool. Copyright (c) 2012-2014 ssdb.io 'h' or 'help' for help, 'q' to quit. server version: 1.8.0 ssdb 127.0.0.1:8888> 
 则启动成功