$ sudo wget --no-check-certificate https://github.com/ideawu/ssdb/archive/master.zip
$ sudo wget --no-check-certificate https://github.com/ideawu/ssdb/archive/master.zip
$ sudo unzip master
$ cd ssdb-master
$ sudo make 运行这个可会报错,有可能没有make 命令,需要安装autoconf 软件包
执行命令:yum -y install autoconf
然后再次运行:make
sudo make install
如果没有安装编译器:同样会出现错误,需要执行以下命令,安装编译器:yum -y install gcc-c++
# 启动主库, 此命令会阻塞住命令行
./ssdb-server ssdb.conf
# 或者启动为后台进程(不阻塞命令行)
./ssdb-server -d ssdb.conf
# 停止 ssdb-server
./ssdb-server ssdb.conf -s stop
启动客户端连接:
./tools/ssdb-cli -p 8888 设置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 exit 0
保存退出,然后设置权限
chmod 777 /etc/rc.d/init.d/ssdb #赋予文件执行权限
chkconfig ssdb on #设置开机启动
service ssdb start
python:
sudo pip install --upgrade pyssdb
时间: 2024-10-13 07:59:20