php ssdb扩展安装,搭建配置SSDB

测试环境

# cat /etc/redhat-release

CentOS release 6.4 (Final)

1.1 必备软件

yum install –y wget unzip gcc gcc-c++

1.2 下载安装

wget --no-check-certificate https://github.com/ideawu/ssdb/archive/master.zip

unzip master

cd ssdb-master

make

# optional, install ssdb in /usr/local/ssdb

sudo make install

1.3 启动

# start master

./ssdb-server ssdb.conf

# or start as daemon

./ssdb-server -d ssdb.conf

# ssdb command line

./tools/ssdb-cli -p 8888

# stop ssdb-server

kill `cat ./var/ssdb.pid`

1.4 制作启动脚本

copy tools/ssdb.sh /etc/init.d/ssdb

vim /etc/init.d/init.d/ssdb.conf    #修改配置文件路径

---------------------------------------------------# ssdb      Start ssdb

#

# chkconfig: 2345 08 92

# description:  Starts, stops and saves tomcat

#

# config: /usr/local/ssdb/ssdb.conf

#

### BEGIN INIT INFO

# Provides: ssdb

# Required-Start:

# Required-Stop:

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: start and stop ssdb

# Description: Start, stop and save ssdb

### END INIT INFO

configs=/usr/local/ssdb/ssdb.conf---------------------------------------------------

#设置开机自启动

chkconfig --add ssdb

chkconfig ssdb on

1.5 设置环境变量

vim /etc/profile

--------------------------------------------------SSDB_HOME=/usr/local/ssdb

PATH=$SSDB_HOME:$PATH

export SSDB_HOME PATH--------------------------------------------------

source /etc/profile

1.6 SSDB主从复制

主:

# cat /usr/local/ssdb/ssdb.confserver:

ip: 192.168.16.202            #修改

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                #修改从:

# cat /usr/local/ssdb/ssdb.confserver:

ip: 192.168.16.201        #修改

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            #修改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            #修改

ip: 192.168.16.202        #修改

port: 8888            #修改主从:

#./ssdb-server -d ssdb.conf

# /etc/init.d/ssdb restart

主从:

# /usr/local/ssdb/ssdb-cli -h 192.168.16.201 -p 8888

# /usr/local/ssdb/ssdb-cli -h 192.168.16.202 -p 8888

1.6 修改jar包启动脚本

-Dapplication.ssdb.master.host=192.168.16.202 -Dapplication.ssdb.master.port=8888 -Dapplication.ssdb.slave.host=192.168.16.201 -Dapplication.ssdb.slave.port=8888

参考:

http://ssdb.io/docs/install.html

http://ssdb.io/docs/config.html

https://github.com/ssdb/phpssdbadmin

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值