Spark构建引擎 Parquet存储
vim/etc/profile
#在profile文件末尾添加以下内容
exportJAVA_HOME=/usr/local/java/jdk1.8.0_291
exportJRE_HOME=${JAVA_HOME}/jre
exportHADOOP_HOME=/etc/hadoop/hadoop-3.2.0
exportHIVE_HOME=/etc/hadoop/hive
exportCLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
exportPATH=$HIVE_HOME/bin:$HIVE_HOME/conf:${HADOOP_HOME}/bin:${JAVA_HOME}/bin:$PATH
#保存以上文件内容后执行以下命令
source/etc/profile
mkdir/usr/local/java
tar-xvfjava-1.8.0-openjdk.tar-C/usr/local/java
wgethttps://archive.apache.org/dist/hadoop/common/hadoop-3.2.0/hadoop-3.2.0.tar.gz
mkdir/etc/hadoop
tar-xvfhadoop-3.2.0.tar.gz-C/etc/hadoop
cd/etc/hadoop
cphadoop-3.2.0/share/hadoop/tools/lib/aws-java-sdk-bundle-1.11.375.jarhadoop-3.2.0/share/hadoop/common/lib/
cphadoop-3.2.0/share/hadoop/tools/lib/hadoop-aws-3.2.0.jarhadoop-3.2.0/share/hadoop/common/lib/
<?xmlversion="1.0"encoding="UTF-8"?>
<?xml-stylesheettype="text/xsl"href="configuration.xsl"?>
<!--
LicensedundertheApacheLicense,Version2.0(the"License");
youmaynotusethisfileexceptincompliancewiththeLicense.
YoumayobtainacopyoftheLicenseat
http://www.apache.org/licenses/LICENSE-2.0
Unlessrequiredbyapplicablelaworagreedtoinwriting,software
distributedundertheLicenseisdistributedonan"ASIS"BASIS,
WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
SeetheLicenseforthespecificlanguagegoverningpermissionsand
limitationsundertheLicense.SeeaccompanyingLICENSEfile.
-->
<!--Putsite-specificpropertyoverridesinthisfile.-->
<configuration>
<property>
<name>fs.s3a.access.key</name>
<value>SESSION-ACCESS-KEY</value>
</property>
<property>
<name>fs.s3a.secret.key</name>
<value>SESSION-SECRET-KEY</value>
</property>
<property>
<name>fs.s3a.endpoint</name>
<value>s3.$REGION.amazonaws.com</value>
</property>
</configuration>
wgethttps://downloads.apache.org/hive/hive-2.3.9/apache-hive-2.3.9-bin.tar.gz
tar-xvfapache-hive-2.3.9-bin.tar.gz-C/etc/hadoop
mv/etc/hadoop/apache-hive-2.3.9-bin/etc/hadoop/hive
<?xmlversion="1.0"encoding="UTF-8"standalone="no"?>
<?xml-stylesheettype="text/xsl"href="configuration.xsl"?><!--
LicensedtotheApacheSoftwareFoundation(ASF)underoneormore
contributorlicenseagreements.SeetheNOTICEfiledistributedwith
thisworkforadditionalinformationregardingcopyrightownership.
TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0
(the"License");youmaynotusethisfileexceptincompliancewith
theLicense.YoumayobtainacopyoftheLicenseat
http://www.apache.org/licenses/LICENSE-2.0
Unlessrequiredbyapplicablelaworagreedtoinwriting,software
distributedundertheLicenseisdistributedonan"ASIS"BASIS,
WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
SeetheLicenseforthespecificlanguagegoverningpermissionsand
limitationsundertheLicense.
--><configuration>
<!--WARNING!!!ThisfileisautogeneratedfordocumentationpurposesONLY!-->
<!--WARNING!!!AnychangesyoumaketothisfilewillbeignoredbyHive.-->
<!--WARNING!!!Youmustmakeyourchangesinhive-site.xmlinstead.-->
<!--HiveExecutionParameters-->
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>password</value>
<description>passwordtouseagainstmetastoredatabase</description>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://host-name:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBCconnectstringforaJDBCmetastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>DriverclassnameforaJDBCmetastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>admin</value>
<description>Usernametouseagainstmetastoredatabase</description>
</property>
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
<description>
Enforcemetastoreschemaversionconsistency.
True:VerifythatversioninformationstoredinmetastorematcheswithonefromHivejars.Alsodisableautomatic
schemamigrationattempt.UsersarerequiredtomanuallymigrateschemaafterHiveupgradewhichensures
propermetastoreschemamigration.(Default)
False:Warniftheversioninformationstoredinmetastoredoesn'tmatchwithonefrominHivejars.
</description>
</property>
</configuration>
#下载mysql-jdbc的jar包放置在$HIVE_HOME/lib目录下
cpmysql-connector-java-5.1.47.jar$HIVE_HOME/lib
bin/schematool-dbTypemysql-initSchema
mkdir$HIVE_HOME/logs
nohup$HIVE_HOME/bin/hive--servicemetastore>>$HIVE_HOME/logs/hivemetastorelog.log2>&1&
java.lang.NoSuchMethodError:com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
rm$HIVE_HOME/lib/spark-*$HIVE_HOME/spark_jar
rm$HIVE_HOME/lib/jackson-module-scala_2.11-2.6.5.jar
wgethttp://archive.apache.org/dist/spark/spark-3.1.1/spark-3.1.1-bin-hadoop3.2.tgz
tar-xvfspark-3.1.1-bin-hadoop3.2.tgz-C/etc/hadoop
mv/etc/hadoop/spark-3.1.1-bin-hadoop3.2/etc/hadoop/spark
exportSPARK_HOME=/etc/hadoop/spark
cp$HIVE_HOME/conf/hive-site.xml$SPARK_HOME/conf
cp$HIVE_HOME/conf/hive-site.xml$SPARK_HOME/conf
$SPARK_HOME/bin/start-master.sh
$SPARK_HOME/bin/start-worker.shspark://hostname:7077
wgethttp://archive.apache.org/dist/zookeeper/zookeeper-3.4.13/zookeeper-3.4.13.tar.gz
tar-xvfzookeeper-3.4.13.tar.gz-C/etc/hadoop
mv/etc/hadoop/zookeeper-3.4.13/etc/hadoop/zookeeper
cp/etc/hadoop/zookeeper/conf/zoo_sample.cfg/etc/hadoop/zookeeper/conf/zoo1.cfg
cp/etc/hadoop/zookeeper/conf/zoo_sample.cfg/etc/hadoop/zookeeper/conf/zoo2.cfg
cp/etc/hadoop/zookeeper/conf/zoo_sample.cfg/etc/hadoop/zookeeper/conf/zoo3.cfg
server.1=localhost:2287:3387
server.2=localhost:2288:3388
server.3=localhost:2289:3389
dataDir=/tmp/zookeeper/zk1/data
dataLogDir=/tmp/zookeeper/zk1/log
clientPort=2181
mkdir/tmp/zookeeper/zk1/data
mkdir/tmp/zookeeper/zk1/log
mkdir/tmp/zookeeper/zk2/data
mkdir/tmp/zookeeper/zk2/log
mkdir/tmp/zookeeper/zk3/data
mkdir/tmp/zookeeper/zk3/log
vim/tmp/zookeeper/zk1/data/myid
vim/tmp/zookeeper/zk2/data/myid
vim/tmp/zookeeper/zk3/data/myid
/etc/hadoop/zookeeper/bin/zkServer.shstart/etc/hadoop/zookeeper/conf/zoo1.cfg
/etc/hadoop/zookeeper/bin/zkServer.shstart/etc/hadoop/zookeeper/conf/zoo2.cfg
/etc/hadoop/zookeeper/bin/zkServer.shstart/etc/hadoop/zookeeper/conf/zoo3.cfg
wgethttps://mirror-hk.koddos.net/apache/kylin/apache-kylin-4.0.0/apache-kylin-4.0.0-bin.tar.gz
tar-xvfapache-kylin-4.0.0-bin.tar.gz/etc/hadoop
exportKYLIN_HOME=/etc/hadoop/apache-kylin-4.0.0-bin
mkdir$KYLIN_HOME/ext
cpmysql-connector-java-5.1.47.jar$KYLIN_HOME/ext
kylin.metadata.url=kylin_metadata@jdbc,url=jdbc:mysql://hostname:3306/kylin,username=root,password=password,maxActive=10,maxIdle=10
kylin.env.zookeeper-connect-string=hostname
kylin.engine.spark-conf.spark.master=spark://hostname:7077
kylin.engine.spark-conf.spark.submit.deployMode=client
kylin.env.hdfs-working-dir=s3://bucket/kylin
kylin.engine.spark-conf.spark.eventLog.dir=s3://bucket/kylin/spark-history
kylin.engine.spark-conf.spark.history.fs.logDirectory=s3://bucket/kylin/spark-history
kylin.query.spark-conf.spark.master=spark://hostname:7077
#下载commons-collections-3.2.2.jar
cpcommons-collections-3.2.2.jar$KYLIN_HOME/tomcat/webapps/kylin/WEB-INF/lib/
#下载commons-configuration-1.3.jar
cpcommons-configuration-1.3.jar$KYLIN_HOME/tomcat/webapps/kylin/WEB-INF/lib/
cp$HADOOP_HOME/share/hadoop/common/lib/aws-java-sdk-bundle-1.11.563.jar$KYLIN_HOME/tomcat/webapps/kylin/WEB-INF/lib/
cp$HADOOP_HOME/share/hadoop/common/lib/hadoop-aws-3.2.2.jar$HADOOP_HOME/tomcat/webapps/kylin/WEB-INF/lib/