Linux下安装ssdb

安装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

 

posted on 2017-10-25 18:14  婵婵  阅读(2512)  评论(0编辑  收藏  举报

导航