您好,登錄后才能下訂單哦!
SSDB簡介
SSDB 是一個 C/C++ 語言開發的高性能 NoSQL 數據庫, 支持 KV, list, map(hash), zset(sorted set) 等數據結構, 用來替代或者與 Redis 配合存儲十億級別列表的數據.
SSDB 是穩定的, 生產環境使用的, 已經在許多互聯網公司得到廣泛使用, 如奇虎 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
# 啟動主庫, 此命令會阻塞住命令行 ./ssdb-server ssdb.conf # 或者啟動為后臺進程(不阻塞命令行) ./ssdb-server -d ssdb.conf # 停止 ssdb-server ./ssdb-server ssdb.conf -s stop # 對于舊版本 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
重新啟動haproxy,以后可以利用keepalive 將haproxy設計成雙主或準備都可以
/etc/init.d/haproxy restart
測試(客戶端連接haproxy地址)
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。