安裝ssdb
1 wget --no-check-certificate https://github.com/ideawu/ssdb/archive/master.zip 2 unzip master 3 cd ssdb-master 4 make
報以下錯誤
ERROR! autoconf required! install autoconf first
Makefile:4: build_config.mk: No such file or directory
make: *** No rule to make target `build_config.mk'. Stop.
安裝 autoconf
yum update
yum install -y autoconf
安裝autoconf成功后,繼續make
1 make
報以下錯誤
make[1]: Entering directory `/root/ssdb-master/deps/leveldb-1.18'
g++ -I. -I./include -fno-builtin-memcmp -pthread -DOS_LINUX -DLEVELDB_PLATFORM_POSIX -DSNAPPY -I../snappy-1.1.0 -O2 -DNDEBUG -c db/builder.cc -o db/builder.o
make[1]: g++: Command not found
make[1]: *** [db/builder.o] Error 127
make[1]: Leaving directory `/root/ssdb-master/deps/leveldb-1.18'
make: *** [all] Error 2
安裝g++
yum -y install gcc+ gcc-c++
安裝g++成功后,繼續make
1 make
報以下錯誤
g++: error: /root/ssdb-master/deps/snappy-1.1.0/.libs/libsnappy.a: No such file or directory
make[1]: *** [all] Error 1
make[1]: Leaving directory `/root/ssdb-master/src'
make: *** [all] Error 2
這是因為 snappy 沒有編譯成功, 這一般是因為你的系統時鍾有問題. 可以這樣解決
1 cd deps/snappy-1.1.0; 2 ./configure 3 make
安裝Snappy成功后,返回到ssdb-master目錄
1 cd ../.. 2 make 3 make install
這樣ssdb就安裝成功了。
ssdb命令
跳轉到ssdb的安裝目錄
1 [root@localhost ~]# whereis ssdb 2 ssdb: /usr/local/ssdb 3 [root@localhost ~]# cd /usr/local/ssdb
啟動ssdb服務器
1 ./ssdb-server -d ./ssdb.conf -s start
停止ssdb服務器
法一:
1 ./ssdb-server -d ./ssdb.conf -s stop
法二:
1 [root@localhost ssdb]# ps -ef|grep ssdb 2 root 14152 1 0 19:45 ? 00:00:01 ./ssdb-server -d ./ssdb.conf -s restart 3 root 14269 13599 0 19:54 pts/1 00:00:00 grep --color=auto ssdb 4 [root@localhost ssdb]# kill -9 1
重啟ssdb服務器
1 ./ssdb-server -d ./ssdb.conf -s restart
連接ssdb客戶端
1 ./ssdb-cli
終止ssdb客戶端
1 quit
window上訪問虛擬機ssdb
1)首先要修改ssdb 的配置文件ssdb.conf,修改server的節點下ip如下:
server節點下的ip意思是綁定哪個ip地址能夠訪問服務 ,也就是說只能通過的ip可以訪問ssdb server。
ps: 127.0.0.1 //綁定虛擬機上自己的ip,也就是說本地機子可以訪問到ssdb server
0.0.0.0 // 所有的機子都可以訪問到ssdb server
192.168.1.253 //這個外部的機子可以訪問ssdb server
1 server: 2 ip: 0.0.0.0 3 port: 8888 4 # bind to public ip 5 #ip: 0.0.0.0 6 # format: allow|deny: all|ip_prefix 7 # multiple allows or denys is supported 8 #deny: all 9 #allow: 127.0.0.1 10 #allow: 192.168 11 # auth password must be at least 32 characters 12 #auth: very-strong-password 13 #readonly: yes
2)開放ssdb的服務端口,也就是在linux上放開8888的端口號
打開端口號:iptables -A INPUT -ptcp --dport 端口號(8888) -j ACCEPT
保存端口號; iptables-save
3) 如果第二步驟,不生效,則執行以下操作
systemctl stop firewalld.service
systemctl disable firewalld.service
iptables -I INPUT -p tcp -j ACCEPT
iptables-save
4)再重啟ssdb