当前位置: 首页 > news >正文

如何加强网站管理的队伍建设韩国今日特大新闻

如何加强网站管理的队伍建设,韩国今日特大新闻,各行业的专业网址论坛资料,如何评价一个企业网站做的好文章目录 22:FineBI配置数据集23:FineBI构建报表24:FineBI实时配置测试附录二:离线消费者完整代码 22:FineBI配置数据集 目标:实现FineBI访问MySQL结果数据集的配置 实施 安装FineBI 参考《FineBI Windows…

文章目录

    • 22:FineBI配置数据集
    • 23:FineBI构建报表
    • 24:FineBI实时配置测试
    • 附录二:离线消费者完整代码

22:FineBI配置数据集

  • 目标实现FineBI访问MySQL结果数据集的配置

  • 实施

    • 安装FineBI

      • 参考《FineBI Windows版本安装手册.docx》安装FineBI

        image-20210906214702837

    • 配置连接

      image-20210906214908806

      image-20210906214943267

      image-20210906215001069

      数据连接名称:Momo
      用户名:root
      密码:自己MySQL的密码
      数据连接URL:jdbc:mysql://node1:3306/momo?useUnicode=true&characterEncoding=utf8
      

      image-20210906215136987

      image-20210906215313596

    • 数据准备

      image-20210906233741527

      image-20210906215517834

      image-20210906215600395

      SELECT  id, momo_totalcount,momo_province,momo_username,momo_msgcount,CASE momo_grouptype WHEN '1' THEN '总消息量' WHEN '2' THEN '各省份发送量'  WHEN '3' THEN '各省份接收量'WHEN '4' THEN '各用户发送量' WHEN '5' THEN '各用户接收量' END AS momo_grouptype
      FROM  momo_count
      
  • 小结

    • 实现FineBI访问MySQL结果数据集的配置

23:FineBI构建报表

  • 目标实现FineBI实时报表构建

  • 路径

    • step1:实时报表构建
    • step2:实时报表配置
    • step3:实时刷新测试
  • 实施

    • 实时报表构建

      • 新建仪表盘

        image-20210906221339838

        image-20210906221410591

      • 添加标题

        image-20210906221452201

        image-20210906221633739

      • 实时总消息数

        image-20210906225231210

      • 发送消息最多的Top10用户

        image-20210906221821438

        image-20210906222156861

        image-20210906222225524

        image-20210906222300546

        image-20210906222336466

        image-20210906222405217

        image-20210906222544774

        image-20210906222815956

      • 接受消息最多的Top10用户

        image-20210906224107608

        image-20210906224155452

        image-20210906224301084

        image-20210906224422220

      • 各省份发送消息Top10

        image-20210906224657081

        image-20210906224806298

        image-20210906224850783

      • 各省份接收消息Top10

        image-20210906224548114

        image-20210906223310186

        image-20210906223414046

        image-20210906223433477

        image-20210906223453710

        image-20210906223805626

      • 各省份总消息量

        image-20210906225451414

        image-20210906225508401

        image-20210906225557658

        image-20210906230243869

  • 小结

    • 实现FineBI实时报表构建

24:FineBI实时配置测试

  • 目标:实现实时报表测试

  • 实施

    • 实时报表配置

      • 官方文档:https://help.fanruan.com/finebi/doc-view-363.html

      • 添加jar包:将jar包放入FineBI安装目录的 webapps\webroot\WEB-INF\lib目录下

        image-20210906230548177

        • 注意:如果提示已存在,就选择覆盖
      • 添加JS文件

        • 创建js文件:refresh.js

          setTimeout(function () {var b =document.title;var a =BI.designConfigure.reportId;//获取仪表板id//这里要指定自己仪表盘的idif (a=="d574631848bd4e33acae54f986d34e69") {setInterval(function () {BI.SharingPool.put("controlFilters", BI.Utils.getControlCalculations());//Data.SharingPool.put("controlFilters", BI.Utils.getControlCalculations());BI.Utils.broadcastAllWidgets2Refresh(true);}, 3000);//5000000为定时刷新的频率,单位ms}
          }, 2000)
          
        • 将创建好的refresh.js文件放至 FineBI 安装目录%FineBI%/webapps/webroot中

          image-20210906231356346

        • 关闭FineBI缓存,然后关闭FineBI

          image-20210906231254734

        • 修改jar包,添加js

          image-20210906231519478

          image-20210906231626750

          image-20210906231721464

          image-20210906231735007

          <!-- 增加刷新功能 --> 
          <script type="text/javascript" src="/webroot/refresh.js"></script>
          
        
        
      • 重启FineBI

  • 实时刷新测试

    • 清空MySQL结果表

    • 启动Flink程序:运行MoMoFlinkCount

    • 启动Flume程序

      cd /export/server/flume-1.9.0-bin
      bin/flume-ng agent -c conf/ -n a1 -f usercase/momo_mem_kafka.properties -Dflume.root.logger=INFO,console
      
    • 启动模拟数据

      java -jar /export/data/momo_init/MoMo_DataGen.jar \
      /export/data/momo_init/MoMo_Data.xlsx \
      /export/data/momo_data/ \
      10
      
      
    - 观察报表

image-20210906235752933

image-20210906235808012

  • 小结

    • 实现FineBI实时测试
## 附录一:Maven依赖​```xml<!--远程仓库--><repositories><repository><id>aliyun</id><url>http://maven.aliyun.com/nexus/content/groups/public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled><updatePolicy>never</updatePolicy></snapshots></repository></repositories><dependencies><!--Hbase 客户端--><dependency><groupId>org.apache.hbase</groupId><artifactId>hbase-client</artifactId><version>2.1.0</version></dependency><!--kafka 客户端--><dependency><groupId>org.apache.kafka</groupId><artifactId>kafka-clients</artifactId><version>2.4.1</version></dependency><!--JSON解析工具包--><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>1.2.62</version></dependency><!--Flink依赖--><dependency><groupId>org.apache.flink</groupId><artifactId>flink-java</artifactId><version>1.10.0</version></dependency><dependency><groupId>org.apache.flink</groupId><artifactId>flink-streaming-java_2.11</artifactId><version>1.10.0</version></dependency><dependency><groupId>org.apache.flink</groupId><artifactId>flink-runtime-web_2.11</artifactId><version>1.10.0</version></dependency><!-- flink操作hdfs、Kafka、MySQL、Redis,所需要导入该包--><dependency><groupId>org.apache.flink</groupId><artifactId>flink-shaded-hadoop-2-uber</artifactId><version>2.7.5-10.0</version></dependency><dependency><groupId>org.apache.flink</groupId><artifactId>flink-connector-kafka_2.11</artifactId><version>1.10.0</version></dependency><dependency><groupId>org.apache.flink</groupId><artifactId>flink-jdbc_2.11</artifactId><version>1.10.0</version></dependency><dependency><groupId>org.apache.bahir</groupId><artifactId>flink-connector-redis_2.11</artifactId><version>1.0</version></dependency><!--HTTP请求的的依赖--><dependency><groupId>org.apache.httpcomponents</groupId><artifactId>httpclient</artifactId><version>4.5.4</version></dependency><!--MySQL连接驱动--><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.38</version></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.1</version><configuration><target>1.8</target><source>1.8</source></configuration></plugin></plugins></build>

附录二:离线消费者完整代码

package bigdata.itcast.cn.momo.offline;import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.MD5Hash;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.consumer.OffsetAndMetadata;
import org.apache.kafka.common.TopicPartition;import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.util.*;/*** @ClassName MomoKafkaToHbase* @Description TODO 离线场景:消费Kafka的数据写入Hbase* @Create By     Maynor*/
public class MomoKafkaToHbase {private  static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");private static Connection conn;private static Table table;private static TableName tableName = TableName.valueOf("MOMO_CHAT:MOMO_MSG");//表名private static byte[] family = Bytes.toBytes("C1");//列族//todo:2-构建Hbase连接//静态代码块: 随着类的加载而加载,一般只会加载一次,避免构建多个连接影响性能static{try {//构建配置对象Configuration conf = HBaseConfiguration.create();conf.set("hbase.zookeeper.quorum","node1:2181,node2:2181,node3:2181");//构建连接conn = ConnectionFactory.createConnection(conf);//获取表对象table = conn.getTable(tableName);} catch (IOException e) {e.printStackTrace();}}public static void main(String[] args) throws Exception {//todo:1-构建消费者,获取数据consumerKafkaToHbase();
//        String momoRowkey = getMomoRowkey("2020-08-13 12:30:00", "13071949728", "17719988692");
//        System.out.println(momoRowkey);}/*** 用于消费Kafka的数据,将合法数据写入Hbase*/private static void consumerKafkaToHbase() throws Exception {//构建配置对象Properties props = new Properties();//指定服务端地址props.setProperty("bootstrap.servers", "node1:9092,node2:9092,node3:9092");//指定消费者组的idprops.setProperty("group.id", "momo1");//关闭自动提交props.setProperty("enable.auto.commit", "false");//指定K和V反序列化的类型props.setProperty("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");props.setProperty("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");//构建消费者的连接KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);//指定订阅哪些Topicconsumer.subscribe(Arrays.asList("MOMO_MSG"));//持续拉取数据while (true) {//向Kafka请求拉取数据,等待Kafka响应,在100ms以内如果响应,就拉取数据,如果100ms内没有响应,就提交下一次请求: 100ms为等待Kafka响应时间//拉取到的所有数据:多条KV数据都在ConsumerRecords对象,类似于一个集合ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(100));//todo:3-处理拉取到的数据:打印//取出每个分区的数据进行处理Set<TopicPartition> partitions = records.partitions();//获取本次数据中所有分区//对每个分区的数据做处理for (TopicPartition partition : partitions) {List<ConsumerRecord<String, String>> partRecords = records.records(partition);//取出这个分区的所有数据//处理这个分区的数据long offset = 0;for (ConsumerRecord<String, String> record : partRecords) {//获取TopicString topic = record.topic();//获取分区int part = record.partition();//获取offsetoffset = record.offset();//获取KeyString key = record.key();//获取ValueString value = record.value();System.out.println(topic + "\t" + part + "\t" + offset + "\t" + key + "\t" + value);//将Value数据写入Hbaseif(value != null && !"".equals(value) && value.split("\001").length == 20 ){writeToHbase(value);}}//手动提交分区的commit offsetMap<TopicPartition, OffsetAndMetadata> offsets = Collections.singletonMap(partition,new OffsetAndMetadata(offset+1));consumer.commitSync(offsets);}}}/*** 用于实现具体的写入Hbase的方法* @param value*/private static void writeToHbase(String value) throws Exception {//todo:3-写入Hbase//切分数据String[] items = value.split("\001");String stime = items[0];String sender_accounter = items[2];String receiver_accounter = items[11];//构建rowkeyString rowkey = getMomoRowkey(stime,sender_accounter,receiver_accounter);//构建PutPut put = new Put(Bytes.toBytes(rowkey));//添加列put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("msg_time"),Bytes.toBytes(items[0]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("sender_nickyname"),Bytes.toBytes(items[1]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("sender_account"),Bytes.toBytes(items[2]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("sender_sex"),Bytes.toBytes(items[3]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("sender_ip"),Bytes.toBytes(items[4]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("sender_os"),Bytes.toBytes(items[5]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("sender_phone_type"),Bytes.toBytes(items[6]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("sender_network"),Bytes.toBytes(items[7]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("sender_gps"),Bytes.toBytes(items[8]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("receiver_nickyname"),Bytes.toBytes(items[9]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("receiver_ip"),Bytes.toBytes(items[10]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("receiver_account"),Bytes.toBytes(items[11]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("receiver_os"),Bytes.toBytes(items[12]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("receiver_phone_type"),Bytes.toBytes(items[13]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("receiver_network"),Bytes.toBytes(items[14]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("receiver_gps"),Bytes.toBytes(items[15]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("receiver_sex"),Bytes.toBytes(items[16]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("msg_type"),Bytes.toBytes(items[17]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("distance"),Bytes.toBytes(items[18]));put.addColumn(Bytes.toBytes("C1"),Bytes.toBytes("message"),Bytes.toBytes(items[19]));//执行写入table.put(put);}/*** 基于消息时间、发送人id、接受人id构建rowkey* @param stime* @param sender_accounter* @param receiver_accounter* @return* @throws Exception*/private static String getMomoRowkey(String stime, String sender_accounter, String receiver_accounter) throws Exception {//转换时间戳long time = format.parse(stime).getTime();String suffix = sender_accounter+"_"+receiver_accounter+"_"+time;//构建MD5String prefix = MD5Hash.getMD5AsHex(Bytes.toBytes(suffix)).substring(0,8);//合并返回return prefix+"_"+suffix;}
}

文章转载自:
http://dinncocongratulator.ydfr.cn
http://dinncooutwatch.ydfr.cn
http://dinncoforestage.ydfr.cn
http://dinncokirin.ydfr.cn
http://dinncobagworm.ydfr.cn
http://dinncounguent.ydfr.cn
http://dinncomuleteer.ydfr.cn
http://dinncobefrogged.ydfr.cn
http://dinncoplayfellow.ydfr.cn
http://dinncorelievable.ydfr.cn
http://dinncoinspiratory.ydfr.cn
http://dinncoycl.ydfr.cn
http://dinncoduisburg.ydfr.cn
http://dinncoresource.ydfr.cn
http://dinncounreckonable.ydfr.cn
http://dinncopapillose.ydfr.cn
http://dinncopetunia.ydfr.cn
http://dinncofroggish.ydfr.cn
http://dinncomythopoeic.ydfr.cn
http://dinncotaxation.ydfr.cn
http://dinncopriestess.ydfr.cn
http://dinncodyehouse.ydfr.cn
http://dinncopeduncle.ydfr.cn
http://dinncosubah.ydfr.cn
http://dinncopolybasite.ydfr.cn
http://dinncosubculture.ydfr.cn
http://dinncosympatholytic.ydfr.cn
http://dinncotritiated.ydfr.cn
http://dinncointerruptive.ydfr.cn
http://dinncolaryngectomize.ydfr.cn
http://dinncoimagist.ydfr.cn
http://dinncoarrondissement.ydfr.cn
http://dinncoyaleman.ydfr.cn
http://dinncopursuivant.ydfr.cn
http://dinncochoreodrama.ydfr.cn
http://dinncocontrapuntist.ydfr.cn
http://dinncooloroso.ydfr.cn
http://dinncofelwort.ydfr.cn
http://dinncosemitragic.ydfr.cn
http://dinncocenturied.ydfr.cn
http://dinncooverchurched.ydfr.cn
http://dinncohyperkeratosis.ydfr.cn
http://dinncocoextension.ydfr.cn
http://dinncocestode.ydfr.cn
http://dinncoveritably.ydfr.cn
http://dinncodecurrent.ydfr.cn
http://dinncosecant.ydfr.cn
http://dinncocountersign.ydfr.cn
http://dinncoamygdale.ydfr.cn
http://dinncopatriarchy.ydfr.cn
http://dinncooland.ydfr.cn
http://dinncospacial.ydfr.cn
http://dinncooostende.ydfr.cn
http://dinncocundum.ydfr.cn
http://dinncoamygdalate.ydfr.cn
http://dinncofirehorse.ydfr.cn
http://dinncopreagricultural.ydfr.cn
http://dinncodepute.ydfr.cn
http://dinncovaticanist.ydfr.cn
http://dinncoteleputer.ydfr.cn
http://dinncosba.ydfr.cn
http://dinncoresinosis.ydfr.cn
http://dinncocompanionship.ydfr.cn
http://dinncononbusiness.ydfr.cn
http://dinncotrengganu.ydfr.cn
http://dinncoflagellum.ydfr.cn
http://dinncopuce.ydfr.cn
http://dinncofetlock.ydfr.cn
http://dinncoundersurface.ydfr.cn
http://dinncolitterbin.ydfr.cn
http://dinncononstative.ydfr.cn
http://dinncodyfed.ydfr.cn
http://dinncotiro.ydfr.cn
http://dinncoasper.ydfr.cn
http://dinncoschoolman.ydfr.cn
http://dinncogaywings.ydfr.cn
http://dinncofluxion.ydfr.cn
http://dinncoupgradable.ydfr.cn
http://dinncohelvetia.ydfr.cn
http://dinncoblithe.ydfr.cn
http://dinncosurjection.ydfr.cn
http://dinncosubcuticular.ydfr.cn
http://dinncodanio.ydfr.cn
http://dinncoheadstall.ydfr.cn
http://dinncodespondency.ydfr.cn
http://dinncoreliable.ydfr.cn
http://dinncohereditament.ydfr.cn
http://dinncomoujik.ydfr.cn
http://dinncocatechu.ydfr.cn
http://dinncoamputee.ydfr.cn
http://dinncogroupware.ydfr.cn
http://dinncosnot.ydfr.cn
http://dinncopatternmaking.ydfr.cn
http://dinncodevotion.ydfr.cn
http://dinncoiyft.ydfr.cn
http://dinncobeamish.ydfr.cn
http://dinncoany.ydfr.cn
http://dinncostormcoat.ydfr.cn
http://dinncomanado.ydfr.cn
http://dinncocoprolite.ydfr.cn
http://www.dinnco.com/news/134324.html

相关文章:

  • 六盘水网站开发微博营销软件
  • 哪里有网站制作服务株洲做网站
  • 网站建设测试流程图网络销售推广是做什么的具体
  • 如何企业网站的软文seo关键词排名点击工具
  • 一鸿建设设计网站浙江新手网络推广
  • 如何在网站上做飘窗链接阿里云搜索引擎入口
  • 百度关键词推广多少钱网站如何优化排名
  • 建立网站需要多少钱怎么样北京seo公司网站
  • 如何查找昆明做网站服务的公司百度搜索引擎网址
  • 电子商务网站建设的策划书酒店机票搜索量暴涨
  • 创建网站主题在哪里seo关键字排名
  • 做任务的网站百度推广开户费用多少
  • 服务器 做网站百度广告推广价格
  • 微电影网站模板云盘网页版登录
  • 免费的网站有哪些建立营销型网站
  • 成全视频免费观看在线看游戏南山网站seo
  • 公司电子邮箱怎么注册黑帽seo技术有哪些
  • 天津 响应式网站设计山东seo
  • 淘宝店铺网站建设快速开发平台
  • 网站被清空了怎么办知名品牌营销策略
  • 网站建设包括哪些网站建站模板
  • wordpress客户表单数据嘉兴seo计费管理
  • dede本地搭建网站代发百度关键词排名
  • 做酒网站丽水百度seo
  • 如何扫描一个网站的漏洞排位及资讯
  • c2c网站建设费用手机营销软件
  • 做网站需要网站负责人北京seo地址
  • 功能多的网站模板 中文内容百度首页关键词推广
  • 现在还有人做网站吗给企业做网站的公司
  • 涂料网站源码商品标题关键词优化