eKuiper 的配置文件位于 $ eKuiper / etc / kuiper.yaml
中。 配置文件为 yaml 格式。应用程序可以通过环境变量进行配置。环境变量优先于 yaml 文件中的对应项。为了对给定的配置使用 env 变量,我们必须使用如下格式: KUIPER__
前缀 + 由__
连接的路径元素。例如,在配置的情况下:
basic:
# true|false, with debug level, it prints more debug info
debug: false
# true|false, if it's set to true, then the log will be print to console
consoleLog: false
# true|false, if it's set to true, then the log will be print to log file
fileLog: true
# How many hours to split the file
rotateTime: 24
# Maximum file storage hours
maxAge: 72
# Whether to ignore case in SQL processing. Note that, the name of customized function by plugins are case-sensitive.
ignoreCase: true
将basic项目下debug的值设置为true是有效的 KUIPER__BASIC__DEBUG=true
。
配置ignoreCase用于在SQL处理中忽略大小写。默认情况下,它设置为 true 以符合标准 SQL。在这种情况下,摄取的数据可能不区分大小写。如果 SQL 中的列名、流定义和摄取的数据可以统一为区分大小写的名称,建议设置为 false 以获得更好的性能。
basic:
# true|false, with debug level, it prints more debug info
debug: false
# true|false, if it's set to true, then the log will be print to console
consoleLog: false
# true|false, if it's set to true, then the log will be print to log file
fileLog: true
# How many hours to split the file
rotateTime: 24
# Maximum file storage hours
maxAge: 168
# Whether to ignore case in SQL processing. Note that, the name of customized function by plugins are case-sensitive.
ignoreCase: true
配置项 ignoreCase 用于指定 SQL 处理中是否大小写无关。默认情况下,为了与标准 SQL 兼容,其值为 true 。从而使得输入数据的列名大小写可以与 SQL 中的定义不同。如果 SQL 语句中,流定义以及输入数据中可以保证列名大小写完全一致,则建议设置该值为 false 以获得更优的性能。
用户将名为 KuiperSyslogKey 的环境变量的值设置为 true 时,日志将打印到系统日志中。
basic:
# CLI 绑定 IP
ip: 0.0.0.0
# CLI port
port: 20498
basic:
# REST service 绑定 IP
restIp: 0.0.0.0
# REST service port
restPort: 9081
restTls:
certfile: /var/https-server.crt
keyfile: /var/https-server.key
REST http 服务器监听端口
TLS 证书 cert 文件和 key 文件位置。如果 restTls 选项未配置,则 REST 服务器将启动为 http 服务器,否则启动为 https 服务器。
当 authentication
选项为 true 时,eKuiper 将为 rest api 请求检查 Token
。请检查此文件以获取 更多信息。
basic:
authentication: false
如果 prometheus
参数设置为 true,eKuiper 将把运行指标暴露到 prometheus。Prometheus 将运行在 prometheusPort
参数指定的端口上。
basic:
prometheus: true
prometheusPort: 20499
在如上默认配置中,eKuiper 暴露于 Prometheus 运行指标可通过 http://localhost:20499/metrics
访问。
Prometheus 端口可设置为与 eKuiper 的 REST 服务端口相同。这样设置的话,两个服务将运行在同一个 HTTP 服务中。
默认在 packages.emqx.net
托管所有预构建 native 插件。
所有插件列表如下:
插件类型 | 预构建插件列表 |
---|---|
source | random zmq |
sink | file image influx redis tdengine zmq |
function | accumulateWordCount countPlusOne echo geohash image labelImage |
用户可以通过以下 Rest-API 获取所有预构建插件的名称和地址:
GET http://localhost:9081/plugins/sources/prebuild
GET http://localhost:9081/plugins/sinks/prebuild
GET http://localhost:9081/plugins/functions/prebuild
获取插件信息后,用户可以尝试这些插件,更多信息
注意:只有官方发布的基于 debian 的 docker 镜像支持以上操作
配置规则选项的默认属性。所有的配置都可以在规则层面上被覆盖。查看规则选项了解详情。
配置 sink 的默认属性,目前主要用于配置缓存策略。在规则层有同样的配置选项,可以覆盖这些默认配置。
# 是否开启缓存
enableCache: false
# 内存缓存的最大存储条数
memoryCacheThreshold: 1024
# 磁盘缓存的最大存储条数
maxDiskCache: 1024000
# 读写磁盘的缓存页条数,作为磁盘读写的基本单位
bufferPageSize: 256
# 重发的间隔时间,单位为毫秒
resendInterval: 0
# 规则停止后是否清除缓存
cleanCacheAtStop: false
可通过配置修改创建的流和规则等状态的存储方式。默认情况下,程序状态存储在 sqlite 数据库中。把存储类型改成 redis,可使用 redis 作为存储方式。
可配置如下属性:
sqliteKV.db
。可配置如下属性:
store:
#Type of store that will be used for keeping state of the application
type: sqlite
redis:
host: localhost
port: 6379
password: kuiper
#Timeout in ms
timeout: 1000
sqlite:
#Sqlite file name, if left empty name of db will be sqliteKV.db
name:
配置 portable 插件的运行时属性。
portable:
# 配置 python 可执行文件的位置或命令。
# 若系统中有多个 python 版本,可通过此配置指定具体的 python 地址。
pythonBin: python
# 控制插件初始化超时时间,单位为毫秒。eKuiper portable 插件运行时会等待插件初始化以完成握手,若超时则终止插件进程
initTimeout: 5000
支持基于文件的流和规则的启动时配置。用户可以将名为 init.json
的规则集文件放入 data
目录,以初始化规则集。该规则集只在eKuiper 第一次启动时被导入。