相关配置
1,进入etc/ksql/ksql.properties文件
listeners=http://192.168.237.136:8088
ksql.logging.processing.topic.auto.create=true
ksql.logging.processing.stream.auto.create=true
bootstrap.servers=192.168.237.136:9092
ksql.schema.registry.url=http://192.168.237.136:8081
ksql.extension.dir=/opt/software/confluent/confluent-5.2.1/plugin
2,./ksql http://192.168.237.136:8088进入ksql客户端(必须先开启ksqk-server服务)
3,ksql相关命令
- 查看所有主题 show topics
- 查看所有stream show streams
- 查看所有table show tables
- 根据主题建stream create stream s_name (id int,name string) with (kafka_topic='topic_name',value_format='avro');
- 根据主题建table create stream s_name (id int,name string) with (kafka_topic='topic_name',value_format='avro',key='id');(注意:创建表时必须指定key)