一、OLAP环境准备
### --- OLAP环境准备
~~~ # 进入服务部署目录
[root@hadoop02 ~]# cd /opt/yanqi/servers/
~~~ # coordinator
[root@hadoop02 servers]# cp -r kylin-3.1.1/ kylin-3.1.1-master/
~~~ # receiver
[root@hadoop02 servers]# cp -r kylin-3.1.1/ kylin-3.1.1-receiver/
### --- 开启Kylin进程:依赖服务需要提前启动完成:包括kafka
~~~ # 协调者:kylin进程将充当receiver cluster的coordinator。7070是coordinator的默认端口。
[root@hadoop02 ~]# cd /opt/yanqi/servers/kylin-3.1.1-master/bin/
[root@hadoop02 bin]# ./kylin.sh start
### --- 开启Receiver Process
~~~ # receiver process将作为receiver cluster的工作方。9090是receiver的默认端口。
[root@hadoop02 ~]# cd /opt/yanqi/servers/kylin-3.1.1-receiver/bin/
[root@hadoop02 bin]# ./kylin.sh streaming start
~~~输出参数
Retrieving hbase dependency...
~~~ # 查看进程
[root@hadoop02 bin]# jps
RunJar # 协调者
StreamingReceiver # receiver
### --- 模拟流数据
~~~ # 使用工具,每秒会向以上topic每秒发送100条记录
[root@hadoop02 ~]# kylin.sh org.apache.kylin.source.kafka.util.KafkaSampleProducer \
--topic kylin_streaming_topic1 --broker hadoop01:9092,hadoop02:9092
~~~ # 查看通过kylin.sh加载的数据
~~~ # 提取到一条,是json格式的数据,已进行格式化了
{
"country": "AUSTRALIA",
"amount": 54.081247423872725,
"qty": 9,
"currency": "USD",
"order_time": 1637319955203,
"category": "CLOTH",
"device": "iOS",
"user": {
"gender": "Male",
"id": "5d1a9877-37e1-07e0-8103-8a2804f6fa6b",
"first_name": "unknown",
"age": 21
}
}
二、创建replica set
三、定义cube流程
### --- 定义cube流程
~~~ 步骤:定义数据源 => 定义Model => 定义Cube => Enable Cube => Kafka发送消息
~~~ Model、Cube与前面介绍的方式类似。