Skip to content

Commit 0197e41

Browse files
committed
First public release.
0 parents  commit 0197e41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+41832
-0
lines changed

.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Makefile.in
2+
aclocal.m4
3+
compile
4+
config.guess
5+
config.h.in
6+
config.sub
7+
configure
8+
depcomp
9+
aclocal.m4
10+
ar-lib
11+
install-sh
12+
missing
13+
test-driver
14+
kids-*.tar.gz
15+
16+
debug/
17+
src/store/.dirstamp
18+
core.*
19+
epm/kids.list
20+
client/c/sample/loggen
21+
client/c/sample/echo2kids
22+
client/c/sample/subscribe
23+
client/python/build/
24+
client/python/dist/
25+
*.egg-info/
26+
.installed.cfg
27+
Makefile
28+
*.a
29+
*.heap
30+
*.la
31+
linux/
32+
autom4te.cache/
33+
.deps
34+
.lib
35+
*.log
36+
*.pyc
37+
*.dSYM/
38+
*.o
39+
*~
40+
*.out
41+
*.bak
42+
*.scan
43+
*core
44+
config.h
45+
*.status
46+
src/kids
47+
stamp-h1
48+
epm/linux-*/
49+
50+
*.deps
51+
*.dirstamp
52+
debug/*
53+
callgrind.*
54+
!client/c/sample/Makefile
55+
\#*\#
56+
.\#*
57+
test/runtest*

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Kids ChangeLog
2+
==============
3+
4+
Version 1.0.0
5+
-------------
6+
First public version

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Copyright (c) 2014, Zhihu Inc.
2+
Some rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
* Neither the name of the Kids nor the
12+
names of its contributors may be used to endorse or promote products
13+
derived from this software without specific prior written permission.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
19+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile.am

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SUBDIRS = deps/ae src doc test
2+
3+
all-am:
4+
cd deps/ae && $(MAKE)
5+
6+
install:
7+
cd src && $(MAKE) install
8+
9+
deb:
10+
cd epm && epm -a amd64 -f deb kids
11+
12+
test: check

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
kids
2+
====
3+
4+
Kids is a log aggregation system.
5+
6+
It aggregates messages like [Scribe](https://github.com/facebookarchive/scribe) and its pub/sub pattern is ported from [Redis](http://redis.io/).
7+
8+
9+
Features
10+
--------
11+
12+
* Real-time subscription
13+
* Distributed collection
14+
* Message persistence
15+
* Multithreading
16+
* Redis protocol
17+
* No third-party dependencies
18+
19+
20+
Installation
21+
------------
22+
23+
You need a complier with C++11 support like GCC 4.7 (or later) or [Clang](http://clang.llvm.org).
24+
25+
./autogen.sh
26+
./configure # --prefix=/your/path
27+
make
28+
make test # optional
29+
make install
30+
31+
By default, it will be installed to `/usr/local/bin/kids`.
32+
You can use the `--prefix` option to specify the installation location.
33+
Run `./configure --help` for more config options.
34+
35+
36+
Quickstart
37+
----------
38+
39+
In the distributed mode, first start kids with the `server.conf`:
40+
41+
kids -c sample/server.conf
42+
43+
Next, edit `host` and `port` in `networkstore` in `sample/agent.conf` as:
44+
45+
store network primary {
46+
host kidsserver;
47+
port 3388;
48+
}
49+
50+
Then, run kids with the modified config file:
51+
52+
kids -c sample/agent.conf
53+
54+
Finally, use `publish` command in Redis protocol to send log to kids agent.
55+
All the log will be resent to your kids server and persistently stored to disk for analysis later.
56+
You can also use `subscribe` or `psubscribe` in Redis protocol to get real-time log from kids server.
57+
58+
Full explanation of config file, see [here](doc/config.md).
59+
60+
You can directly run `kids -c sample/server.conf` on single-server mode without agent, but it is NOT recommended.
61+
62+
Run `kids --help` for more running options.
63+
64+
65+
License
66+
-------
67+
68+
Kids is BSD-licensed, see LICENSE for more details.
69+
70+
71+
FAQ
72+
---
73+
74+
Q: What is the meaning of "kids"?
75+
A: "kids" is the recursive acronym of "__K__ids __I__s a __D__ata __S__tream".
76+
77+
78+
Architecture
79+
------------
80+
81+
![image](doc/image/arch.jpg)
82+
83+
You can view the Chinese version README [here](README.zh_CN.md)
84+

README.zh_CN.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
kids
2+
====
3+
4+
Kids 是一个日志聚合系统。
5+
6+
采用 [Scribe](https://github.com/facebookarchive/scribe) 的消息聚合模型和 [Redis](http://redis.io/) 的 pub/sub 模型。
7+
8+
9+
特性
10+
----
11+
12+
* 实时订阅
13+
* 分布式收集,集中存储
14+
* 多线程模型
15+
* 使用 Redis 协议
16+
* 无第三方依赖
17+
18+
19+
安装
20+
----
21+
22+
编译 kids 需要 C++11 支持,如 GCC 4.7 或更高版本或 [Clang](http://clang.llvm.org)
23+
24+
./autogen.sh
25+
./configure # --prefix=/your/path
26+
make
27+
make test #optional
28+
make install
29+
30+
默认情况下,kids 会被安装至 `/usr/local/bin/kids`,使用 `--prefix` 选项设置指定的安装位置,运行 `./configure --help` 获取更多设置选项。
31+
32+
33+
快速开始
34+
--------
35+
36+
在分布式模式下,首先使用 `server.conf` 启动 kids server:
37+
38+
kids -c sample/server.conf
39+
40+
然后,修改 `networkstore` 中的 `host``port`
41+
42+
store network primary {
43+
host kidsserver;
44+
port 3388;
45+
}
46+
47+
然后使用修改后的 `agent.conf` 启动 kids agent:
48+
49+
kids -c sample/agent.conf
50+
51+
最后,将需要收集的日志以 Redis 协议的 `publish` 命令发送到 kids agent,agent 会将它们转发至 kids server,server 端会对其进行持久化存储,同时,可以在 server 端直接使用 `subscribe` 或者 `psubscribe` 命令实时订阅日志。
52+
53+
配置文件的具体选项详见 [配置](doc/config.zh_CN.md)
54+
55+
你也可以不使用 kids agent 而直接运行 `kids -c sample/server.conf` 使用单服务器模式,但是这是不被推荐的行为。
56+
57+
开源协议
58+
--------
59+
Kids 使用 BSD 协议,具体内容详见 LICENSE 文件。
60+
61+
FAQ
62+
---
63+
Q: 为什么叫「kids」?
64+
A: 「kids」是「__K__ids __I__s a __D__ata __S__tream」的递归缩写。
65+
66+
架构图
67+
------
68+
![image](doc/image/arch.jpg)
69+
70+
[English Version](README.md)

TODO

Whitespace-only changes.

autogen.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#! /bin/sh
2+
3+
if [ -x "`which autoreconf 2>/dev/null`" ] ; then
4+
exec autoreconf -ivf
5+
fi
6+
7+
if glibtoolize --version > /dev/null 2>&1; then
8+
LIBTOOLIZE='glibtoolize'
9+
else
10+
LIBTOOLIZE='libtoolize'
11+
fi
12+
13+
$LIBTOOLIZE && \
14+
aclocal && \
15+
automake --add-missing --force-missing --include-deps && \
16+
autoconf

client/c/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
simply use hiredis as kids client

client/c/sample/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
all: loggen subscribe echo2kids
2+
3+
subscribe: subscribe.c
4+
gcc -g -o subscribe subscribe.c -lhiredis
5+
6+
loggen: loggen.c
7+
gcc -g -o loggen loggen.c -lhiredis
8+
9+
echo2kids: echo2kids.c
10+
gcc -g -o echo2kids echo2kids.c -lhiredis
11+
12+
clean:
13+
rm -rf loggen subscribe echo2kids

0 commit comments

Comments
 (0)