Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-4909

kylin metrics prefix bug in system-cube.sh

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • v3.1.1
    • None
    • Tools, Build and Test
    • Newcomer (Easy) - Everyone can do this

    Description

      I find a bug at system-cube.sh at the location, it is KYLIN by default, rather than  getting kylin.metrics.prefix from kylin.properties :

       

      Part 1
      
      SC_NAME_1="KYLIN_HIVE_METRICS_QUERY_${KYLIN_ENV}"
      SC_NAME_2="KYLIN_HIVE_METRICS_QUERY_CUBE_${KYLIN_ENV}"
      SC_NAME_3="KYLIN_HIVE_METRICS_QUERY_RPC_${KYLIN_ENV}"
      SC_NAME_4="KYLIN_HIVE_METRICS_JOB_${KYLIN_ENV}"
      SC_NAME_5="KYLIN_HIVE_METRICS_JOB_EXCEPTION_${KYLIN_ENV}"
      
      ....
      
      Part 2
      
      # Get Database, default is KYLIN
      system_database="KYLIN"
      # 'create database' failed will not exit when donot have permission to create database;
      sed -i -e 's/CREATE DATABASE /-- CREATE DATABASE /g' ${OUTPUT_FORDER}/create_hive_tables_for_system_cubes.sql
      
      
      

       

      The bug have fixed at github [KYLIN-4855 kylin metrics prefix bug fix|https://github.com/apache/kylin/pull/1533|https://github.com/apache/kylin/pull/1533],]

      But it is not enough, Part 2 does not fix this bug so that the database cannot be found.

       

      I temporarily solved the problem by following

      # get database ####### add 
      system_datebase=`grep "^kylin.metrics.prefix=" $KYLIN_HOME/conf/kylin.properties | cut -d "=" -f 2`
      system_database=`echo ${system_datebase:-"KYLIN"} | tr '[a-z]' '[A-Z]'`
      
      Part 1
      
      SC_NAME_1="${system_database}_HIVE_METRICS_QUERY_${KYLIN_ENV}"
      SC_NAME_2="${system_database}_HIVE_METRICS_QUERY_CUBE_${KYLIN_ENV}"
      SC_NAME_3="${system_database}_HIVE_METRICS_QUERY_RPC_${KYLIN_ENV}"
      SC_NAME_4="${system_database}_HIVE_METRICS_JOB_${KYLIN_ENV}"
      SC_NAME_5="${system_database}_HIVE_METRICS_JOB_EXCEPTION_${KYLIN_ENV}"
      
      .... 
      
      Part 2
      
      # Get Database, default is KYLIN 
      #system_database="KYLIN"   ######### modify 
      # 'create database' failed will not exit when donot have permission to create database; 
      sed -i -e 's/CREATE DATABASE /-- CREATE DATABASE /g' ${OUTPUT_FORDER}/create_hive_tables_for_system_cubes.sql
      
      
      thanks 
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            Anguia Anguia
            Xiaoxiang Yu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: