README_CN.md 4.0 KB
Newer Older
K
KernelMaker 已提交
1
# Pika
S
SongZhao 已提交
2
## 简介 [English](https://github.com/Qihoo360/pika/blob/master/README.md)
L
Lonre Wang 已提交
3
Pika是一个可持久化的大容量redis存储服务,兼容string、hash、list、zset、set的绝大接口([兼容详情](https://github.com/Qihoo360/pika/wiki/pika-支持的redis接口及兼容情况)),解决redis由于存储数据量巨大而导致内存不够用的容量瓶颈,并且可以像redis一样,通过slaveof命令进行主从备份,支持全同步和部分同步
K
KernelMaker 已提交
4 5 6 7 8

## 特点
* 容量大,支持百G数据量的存储
* 兼容redis,不用修改代码即可平滑从redis迁移到pika
* 支持主从(slaveof)
S
SongZhao 已提交
9
* 完善的[运维](https://github.com/Qihoo360/pika/wiki/pika的一些管理命令方式说明)命令
K
KernelMaker 已提交
10

B
baotiao 已提交
11 12 13 14 15 16 17 18 19 20 21 22 23 24

## 快速试用
  如果想快速试用pika,目前提供了Centos5,Centos6的binary版本,可以在[release页面](https://github.com/Qihoo360/pika/releases)看到,具体文件是pikaX.Y.Z_centosK_bin.tar.gz。

```
# 1. unzip file
tar zxf pikaX.Y.Z_centosK_bin.tar.gz
# 2. change working directory to output
#     note: we should in this directory, caz the RPATH is ./lib;
cd output
# 3. run pika:
./bin/pika -c conf/pika.conf
```

K
KernelMaker 已提交
25
## 编译安装
W
wuxiaofei-xy 已提交
26 27 28 29

1.在编译机上安装snappy-devel bz2 libzip-dev libsnappy-dev libprotobuf-dev libevent-dev protobuf-compiler libgoogle-glog-dev protobuf-devel libevent-devel bzip2-devel l ibbz2-dev zlib-devel等。CentOS系统可以用yum安装,Ubuntu可以用apt-get安装。如是CentOS系统,执行如下命令:

```
J
JacketWoo 已提交
30
    yum install snappy-devel bz2 libzip-dev libsnappy-dev libprotobuf-dev libevent-dev protobuf-compiler libgoogle-glog-dev protobuf-devel libevent-devel bzip2-    devel libbz2-dev zlib-devel
W
wuxiaofei-xy 已提交
31 32 33 34
```

2.安装g++(若没有安装), 在CentOS上执行如下命令:

K
KernelMaker 已提交
35
```
W
wuxiaofei-xy 已提交
36
    yum install gcc-c++
K
KernelMaker 已提交
37 38
```

W
wuxiaofei-xy 已提交
39 40 41 42 43
3.把gcc版本临时切换到4.7(若已是,则忽略), 在CentOs上执行如下命令:

```
	a. sudo wget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo
	b. yum install --nogpgcheck devtoolset-1.1
J
JacketWoo 已提交
44
	c. scl enable devtoolset-1.1 bash
W
wuxiaofei-xy 已提交
45 46 47 48
```
4.获取源代码

```
S
SongZhao 已提交
49
	git clone https://github.com/Qihoo360/pika.git && cd pika
W
wuxiaofei-xy 已提交
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
```
5.获取依赖的第三方源代码

```
	a. git submodule init
	b. git submodule update
```

6.编译

```
	make __REL=1
```
若编译过程中,提示有依赖的库没有安装,则有提示安装后再重新编译

K
KernelMaker 已提交
65 66
## 使用
```
J
JacketWoo 已提交
67
	./output/bin/pika -c ./conf/pika.conf
K
KernelMaker 已提交
68
```
W
wuxiaofei-xy 已提交
69 70 71 72 73 74 75 76
若启动失败,把./lib/_VERSION/的内容拷贝到Makefile定义的rpath目录下,然后重新启动

```
	cp PIKA_SOURCE/lib/_VERSION/* RPATH
```
PIKA_SOURCE表示的pika的源代码根目录;
_VERSION表示的是编译机的CenOS版本,如6.2, 5.4...
RPATH在Makefile定义,表示的是程序运行的库预先加载路径
K
KernelMaker 已提交
77

Z
zhaoanan 已提交
78

K
KernelMaker 已提交
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
## 性能
```
服务端配置:
	处理器:24核 Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz
	内存:165157944 kB
	操作系统:CentOS release 6.2 (Final)
	网卡:Intel Corporation I350 Gigabit Network Connection
客户端配置:
	同服务端
	
测试结果:
	pika配置18个worker,用40个客户端;
	1. 写性能测试:
		方法:客户端依次执行set、hset、lpush、zadd、sadd接口写入数据,每个数据结构10000个key;
		结果:qps 110000
	2. 读性能测试:
		方法:客户端一次执行get、hget、lindex、zscore、smembers,每个数据结构5000000个key;
		结果:qps 170000
```
S
SongZhao 已提交
98 99 100 101 102

##Pika用户

<img src="http://i.imgur.com/dcHpCm4.png" height = "100" width = "120" alt="Qihoo">
<img src="http://i.imgur.com/jjZczkN.png" height = "100" width = "120" alt="Weibo">
S
SongZhao 已提交
103
<img src="http://i.imgur.com/zoel46r.gif" height = "100" width = "120" alt="Garena">
S
SongZhao 已提交
104 105 106
<img src="http://i.imgur.com/kHqACbn.png" height = "100" width = "120" alt="Apus">
<img src="http://i.imgur.com/2c57z8U.png" height = "100" width = "120" alt="Ffan">

S
SongZhao 已提交
107 108
<img src="http://i.imgur.com/rUiO5VU.png" height = "100" width = "120" alt="Meituan">

S
SongZhao 已提交
109 110
[更多](https://github.com/Qihoo360/pika/blob/master/USERS.md)

K
KernelMaker 已提交
111
## 文档
S
SongZhao 已提交
112
1. [Wiki] (https://github.com/Qihoo360/pika/wiki)
K
KernelMaker 已提交
113 114

## 联系方式
S
SongZhao 已提交
115 116 117
邮箱:songzhao@360.cn

QQ群:294254078