Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init #1

Merged
merged 7 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
### IntelliJ IDEA ###
.idea/*
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

# Build targets
/target
*/target
target/*

logs

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,63 @@ CKibana是一个为了能够在原生kibana上直接使用ElasticSearch语法查
| filter item | |
| cardinality | |

## Get started

### 本地运行 ckibana
ckibana可以在所有主要操作系统上运行,需要安装Java JDK版本17或更高版本。要检查,请运行
`java -version`:
```shell
$ java -version
java version "17.0.5"
```
代理服务依赖**ES、CK、Kibana**服务,需要提前准备好。以下只包含从ck查询数据步骤,不包含写数据到ck的步骤。

**1)建库、建表**

在ck中初始化库、表结构,可以参考[api-docs](https://github.com/TongchengOpenSource/ckibana-docs/blob/main/api-docs.md) 建表详解部分

**2)启动ckibana**

修改ckibana中的ES配置,需要改为自身的ES信息,配置文件路径为`src/main/resources/application.yml`
```yaml
metadata-config:
hosts: your es metadata cluster hosts
headers:
headerKey: yourHeaderValue
```
打包运行 或者 本地运行直接com.ly.ckibana.Bootstrap类即可
```shell
### start ckibana
$ nohup java -jar ckibana.jar > run.out 2>&1 &

### check whether ckibana is successfully started
$ tail -f ~/logs/app.log
Tomcat started on port(s): 8080 (http) with context path ''
Started Bootstrap in 1.474 seconds
```

**3)启动kibana**

kibana的elasticsearchHosts参数配置为ckibana代理地址,这样就能走到代理服务中来
```shell
eg:elasticsearchHosts=http://ip:port
```

**4)配置index pattern白名单**

配置了对应的白名单,才可以在下一步创建index pattern

**5)在kibana中创建index pattern**

在kibana页面创建index pattern,名字跟1)的表名一致,且4)中配置白名单,然后就可以在kibana中进行查询了
```shell
eg:如果ck表名是table_test,则创建index pattern的名字就是table_test
```

以上5步都操作完以后,就可以创建大盘,开始进行使用了



## TODO

- 分段查询: 支持自动拆分查询时间,可以充分利用缓存,提升查询性能
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ public class QueryProperty {
/**
* 最大结果条数。若大于或等于此阈值,抛出异常,否则可能引发oom.
*/
private int maxResultRow;
private int maxResultRow = 30000;
}
6 changes: 3 additions & 3 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ server:
logging:
config: classpath:logback-spring.xml
file:
path: ${LOGS_PATH}
path: ${LOGS_PATH:./logs/}

metadata-config:
hosts: 10.100.216.132:30623
hosts: your es metadata cluster hosts
headers:
stoken: 245c5a1365cc93c039be0d49
yourHeaderKey: yourHeaderValue