Flink实战实例(十): redis 读写

1 工程目录

Flink实战实例(十): redis 读写_第1张图片

 pom.xml

 
                redis.clients
                jedis
                2.8.1
            

config.properties

# Kafka配置
kafka.broker.list=192.168.1.122:9092,192.168.1.133:9092,192.168.1.144:9092
# Redis配置
redis.host=192.168.1.122
redis.port=6379

2 flink 读取redis

RedisUtil(单点/scala读写redis)

package com.atguigu.flink.utils

import redis.clients.jedis.{Jedis, JedisPool, JedisPoolConfig}

object RedisUtil {
  var jedisPool:JedisPool=null

  def main(args: Array[String]): Unit = {
    val jedis_conn = getJedisClient
    jedis

你可能感兴趣的:(Flink系统性学习专栏,flink,redis,大数据)