SSDB一個高性能的支持豐富數據結構的 NoSQL 數據庫, 用於替代 Redis.
wget --no-check-certificate https://github.com/ideawu/ssdb/archive/master.zip unzip master.zip cd ssdb-master make make install # 安裝到 opt 目錄 make install PREFIX=/opt
cp tools/ssdb.sh /etc/init.d/ssdb
須要注意的是配置文件configs路徑,文件以下:
#!/bin/sh # # chkconfig: 2345 64 36 # description: SSDB startup scripts # ssdb_root=/usr/local/ssdb ssdb_bin=$ssdb_root/ssdb-server # each config file for one instance # configs="/data/ssdb_data/test/ssdb.conf /data/ssdb_data/test2/ssdb.conf" configs="/usr/local/ssdb/ssdb.conf" if [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions fi start() { for conf in $configs; do $ssdb_bin $conf -s restart -d done } stop() { for conf in $configs; do $ssdb_bin $conf -s stop -d done } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo $"Usage: $0 {start|stop|restart}" ;; esac exit $RETVAL
# ssdb-server config # MUST indent by TAB! # relative to path of this file, directory must exists work_dir = ./var pidfile = ./var/ssdb.pid server: ip: 127.0.0.1 port: 8888 # bind to public ip #ip: 0.0.0.0 # format: allow|deny: all|ip_prefix # multiple allows or denys is supported #deny: all #allow: 127.0.0.1 #allow: 192.168 # auth password must be at least 32 characters #auth: very-strong-password replication: binlog: yes # Limit sync speed to *MB/s, -1: no limit sync_speed: -1 slaveof: # to identify a master even if it moved(ip, port changed) # if set to empty or not defined, ip:port will be used. #id: svc_2 # sync|mirror, default is sync #type: sync #host: localhost #port: 8889 logger: level: debug output: log.txt rotate: size: 1000000000 leveldb: # in MB cache_size: 500 # in KB block_size: 32 # in MB write_buffer_size: 64 # in MB/s compaction_speed: 1000 # yes|no compression: yes
chkconfig --add ssdb chkconfig ssdb on #設置開機啓動 service ssdb restart # 重啓服務
待續html