您好,登錄后才能下訂單哦!
SSDB簡(jiǎn)介
SSDB 是一個(gè) C/C++ 語(yǔ)言開發(fā)的高性能 NoSQL 數(shù)據(jù)庫(kù), 支持 KV, list, map(hash), zset(sorted set) 等數(shù)據(jù)結(jié)構(gòu), 用來(lái)替代或者與 Redis 配合存儲(chǔ)十億級(jí)別列表的數(shù)據(jù).
SSDB 是穩(wěn)定的, 生產(chǎn)環(huán)境使用的, 已經(jīng)在許多互聯(lián)網(wǎng)公司得到廣泛使用, 如奇虎 360, TOPGAME.
下載和安裝
wget --no-check-certificate https://github.com/ideawu/ssdb/archive/master.zip unzip master cd ssdb-master make # 將安裝在 /usr/local/ssdb 目錄下 sudo make install
# 啟動(dòng)主庫(kù), 此命令會(huì)阻塞住命令行 ./ssdb-server ssdb.conf # 或者啟動(dòng)為后臺(tái)進(jìn)程(不阻塞命令行) ./ssdb-server -d ssdb.conf # 停止 ssdb-server ./ssdb-server ssdb.conf -s stop # 對(duì)于舊版本 kill `cat ./var/ssdb.pid` # 重啟 ./ssdb-server ssdb.conf -s restart
雙主方案
master-1:10.105.10.77
work_dir = ./var pidfile = ./var/ssdb.pid server: ip: 0.0.0.0 port: 8888 replication: binlog: yes sync_speed: -1 slaveof: id: svc_2 type: sync host: 10.105.10.128 port: 8888 logger: level: info output: log.txt rotate: size: 1000000000 leveldb: cache_size: 500 block_size: 32 write_buffer_size: 64 compaction_speed: 1000 compression: yes
重啟ssdb
master-2:10.105.10.128
work_dir = ./var pidfile = ./var/ssdb.pid server: ip: 0.0.0.0 port: 8888 replication: binlog: yes sync_speed: -1 slaveof: id: svc_2 type: sync host: 10.105.10.77 port: 8888 logger: level: info output: log.txt rotate: size: 1000000000 leveldb: cache_size: 500 block_size: 32 write_buffer_size: 64 compaction_speed: 1000 compression: yes
重啟SSDB
安裝配置haproxy
yum -y install haproxy vim /etc/haproxy/haproxy.cfg
global log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4000 user haproxy group haproxy daemon stats socket /var/lib/haproxy/stats defaults mode http log global option dontlognull option redispatch retries 3 timeout http-request 10s timeout queue 1m timeout connect 10s timeout client 1m timeout server 1m timeout http-keep-alive 10s timeout check 10s maxconn 3000 listen test bind 0.0.0.0:8899 mode tcp balance roundrobin server s1 10.105.10.128:8888 weight 1 maxconn 10000 check inter 10s server s2 10.105.10.77:8888 weight 1 maxconn 10000 check inter 10s
重新啟動(dòng)haproxy,以后可以利用keepalive 將haproxy設(shè)計(jì)成雙主或準(zhǔn)備都可以
/etc/init.d/haproxy restart
測(cè)試(客戶端連接haproxy地址)
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。