折腾了1周,终于完成部署,这是一篇出坑文章,希望同在折腾童鞋能够有用。
Good luck!
集群配置了4台服务器。
项 | 内容 |
CPU | 2个8核CPU型号:Intel(R) Xeon(R) CPU E5-2609 v4 @ 1.70GHz |
内存 | 128GB |
硬盘 | 5TB |
网络 | 千兆 |
操作系统:Linux 3.10.0-327.el7.x86_64bit
序号 | HOSTNAME | IP |
1 | xa01 | 223.254.70.5 | 23.254.70.6 |
2 | xa02 | 223.254.70.7 | 23.254.70.8 |
3 | xa03 | 223.254.70.9 | 23.254.70.10 |
4 | xa04 | 223.254.70.11 | 23.254.70.12 |
软件名 | 版本 | 下载地址 |
JDK | 1.8.0_45 64-Bit | http://www.oracle.com/technetwork/java |
HADOOP | 2.8.4 | http://mirrors.shu.edu.cn/apache/hadoop/common/hadoop-2.8.4/hadoop-2.8.4.tar.gz |
ZOOKEEPER | 3.4.10 | https://archive.apache.org/dist/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz |
HBASE | 1.2.6 | http://archive.apache.org/dist/hbase/1.2.6/hbase-1.2.6-bin.tar.gz |
HIVE | 1.2.2 | http://mirrors.hust.edu.cn/apache/hive/hive-1.2.2/apache-hive-1.2.2-bin.tar.gz |
KAFKA | 2.11-1.0.0 | http://mirrors.hust.edu.cn/apache/kafka/1.0.0/kafka_2.11-1.0.0.tgz |
KYLIN | 2.3.1 | http://www.apache.org/dyn/closer.cgi/kylin/apache-kylin-2.3.1/apache-kylin-2.3.1-hbase1x-bin.tar.gz |
4台服务器修改 /etc/hosts
223.254.70.5 xa01
223.254.70.6 xa01
223.254.70.7 xa02
223.254.70.8 xa02
223.254.70.9 xa03
223.254.70.10 xa03
223.254.70.11 xa04
223.254.70.12 xa04
xa01修改 /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0-45
export PATH=$JAVA_HOME/bin:$PATH
export HADOOP_HOME=/data/hbase-1.2.6
export PATH=$HADOOP_HOME/bin:$PATH
export HBASE_HOME=/data/hbase-1.2.6
export PATH=$HBASE_HOME/bin:$PATH
export HIVE_HOME=/data/hive-1.2.2
export PATH=$HIVE_HOME/bin:$PATH
export KAFKA_HOME=/data/kafka_2.11-1.0.0
export PATH=$KAFKA_HOME/bin:$PATH
export HCAT_HOME=$HIVE_HOME/hcatalog
export PATH=$HCAT_HOME/bin:$PATH
export KYLIN_HOME=/data/kylin-2.3.1
export PATH=$KYLIN_HOME/bin:$PATH
xa02 - xa04修改 /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0-45
export PATH=$JAVA_HOME/bin:$PATH
export HADOOP_HOME=/data/hbase-1.2.6
export PATH=$HADOOP_HOME/bin:$PATH
export HBASE_HOME=/data/hbase-1.2.6
export PATH=$HBASE_HOME/bin:$PATH
export KAFKA_HOME=/data/kafka_2.11-1.0.0
export PATH=$KAFKA_HOME/bin:$PATH
注:修改完后记得 source /etc/profile
所有相关软件都安装在hadoop用户下,4台服务器创建
#创建hadoop用户组
groupadd hadoop
#在hadoop用户组中创建hadoop用户
useradd -g hadoop hadoop
注:hadoop用户需设置密码
在xa01执行以下操作:
#使用hadoop用户
[root@xa01 /]su - hadoop
#切换到/home/hadoop目录
[hadoop@xa01 /]cd ~
#生成本地密钥
[hadoop@xa01 ~]ssh-keygen -t rsa
#分别复制到xa02 - xa04
[hadoop@xa01 ~]ssh-copy-id -i .ssh/id_rsa.pub hadoop@xa02
[hadoop@xa01 ~]ssh-copy-id -i .ssh/id_rsa.pub hadoop@xa03
[hadoop@xa01 ~]ssh-copy-id -i .ssh/id_rsa.pub hadoop@xa04
#解压安装文件
[root@xa01 tools]tar -zxvf hadoop-2.8.4.tar.gz
#移动到/data目录下
[root@xa01 tools]mv hadoop-2.8.4/ /data/
#将目录授权给hadoop用户
[root@xa01 tools]chown -R hadoop:hadoop /data/hadoop-2.8.4/
fs.defaultFS
hdfs://xa01:9000/hbase
io.file.buffer.size
131072
hadoop.tmp.dir
/data/hadoop-2.8.4/tmp
fs.checkpoint.period
3600
fs.checkpoint.size
67108864
fs.checkpoint.dir
/data/hadoop-2.8.4/namesecondary
修改JAVA_HOME
export JAVA_HOME=/usr/java/jdk1.8.0_45
dfs.http.address
xa01:50070
dfs.namenode.secondary.http-address
xa01:50090
dfs.replication
2
dfs.namenode.name.dir
file:/data/hadoop-2.8.4/hdfs/name
dfs.datanode.data.dir
file:/data/hadoop-2.8.4/hdfs/data
fs.checkpoint.period
3600
dfs.secondary.http.address
xa01:50090
mapreduce.framework.name
yarn
mapreduce.jobhistory.address
xa01:10020
mapreduce.jobhistory.webapp.address
xa01:19888
xa02
xa03
xa04
yarn.nodemanager.aux-services
mapreduce_shuffle
yarn.resourcemanager.hostname
xa01
yarn.resourcemanager.address
xa01:8032
yarn.resourcemanager.scheduler.address
xa01:8030
yarn.resourcemanager.resouce-tracker.address
xa01:8031
yarn.resourcemanager.admin.address
xa01:8033
yarn.resourcemanager.webapp.address
xa01:8088
[hadoop@xa01 ~]scp -r /data/hadoop-2.8.4/ hadoop@xa02:/data/
[hadoop@xa01 ~]scp -r /data/hadoop-2.8.4/ hadoop@xa03:/data/
[hadoop@xa01 ~]scp -r /data/hadoop-2.8.4/ hadoop@xa04:/data/
确认2.2章节操作完成,并source
[hadoop@xa01 ~]hadoop namenode -format
#解压安装文件
[root@xa01 tools]tar -zxvf zookeeper-3.4.10.tar.gz
#移动到/data目录下
[root@xa01 tools]mv zookeeper-3.4.10/ /data/
#将目录授权给hadoop用户
[root@xa01 tools]chown -R hadoop:hadoop /data/zookeeper-3.4.10/
tickTime=2000
initLimit=5
syncLimit=2
dataDir=/data/zookeeper-3.4.10/data
dataLogDir=/data/zookeeper-3.4.10/logs
clientPort=2181
server.1=223.254.70.5:2888:3888
server.2=223.254.70.7:2888:3888
server.3=223.254.70.9:2888:3888
server.4=223.254.70.11:2888:3888
[hadoop@xa01 ~]scp -r /data/zookeeper-3.4.10/ hadoop@xa02:/data/
[hadoop@xa01 ~]scp -r /data/zookeeper-3.4.10/ hadoop@xa03:/data/
[hadoop@xa01 ~]scp -r /data/zookeeper-3.4.10/ hadoop@xa04:/data/
[hadoop@xa01 ~]echo '0' > /data/zookeeper-3.4.10/data/myid
[hadoop@xa02 ~]echo '1' > /data/zookeeper-3.4.10/data/myid
[hadoop@xa03 ~]echo '2' > /data/zookeeper-3.4.10/data/myid
[hadoop@xa04 ~]echo '3' > /data/zookeeper-3.4.10/data/myid
#解压安装文件
[root@xa01 tools]tar -zxvf hbase-1.2.6-bin.tar.gz
#移动到/data目录下
[root@xa01 tools]mv hbase-1.2.6/ /data/
#将目录授权给hadoop用户
[root@xa01 tools]chown -R hadoop:hadoop /data/hbase-1.2.6/
hbase.rootdir
hdfs://xa01:9000/hbase
hbase.cluster.distributed
true
hbase.zookeeper.quorum
xa01,xa02,xa03,xa04
hbase.zookeeper.property.dataDir
/data/zookeeper-3.4.10
xa01
xa02
xa03
xa04
export JAVA_HOME="/usr/java/jdk1.8.0_45"
#注释掉jdk8的废弃参数
#export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
#export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
#使用外部ZK
export HBASE_MANAGES_ZK=false
[hadoop@xa01 ~]scp -r /data/hbase-1.2.6/ hadoop@xa02:/data/
[hadoop@xa01 ~]scp -r /data/hbase-1.2.6/ hadoop@xa03:/data/
[hadoop@xa01 ~]scp -r /data/hbase-1.2.6/ hadoop@xa04:/data/
#解压安装文件
[root@xa01 tools]tar -zxvf apache-hive-1.2.2-bin.tar.gz
#移动到/data目录下
[root@xa01 tools]mv hive-1.2.2/ /data/
#将目录授权给hadoop用户
[root@xa01 tools]chown -R hadoop:hadoop /data/hive-1.2.2/
javax.jdo.option.ConnectionURL
jdbc:mysql://223.254.70.13:3306/hive?createDatabaseIfNotExist=true
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
javax.jdo.option.ConnectionUserName
hadoop
javax.jdo.option.ConnectionPassword
hust4400
hive.metastore.uris
thrift://223.254.70.5:9083
hive.metastore.warehouse.dir
/data/hivehouse
hive.exec.dynamic.partition.mode
nonstrict
hive.server2.logging.operation.log.location
/data/hivehouse/logs
hive.server2.thrift.bind.host
223.254.70.5
hive.server2.thrift.port
10000
[hadoop@xa01 ~]cp /data/tools/mysql.jar /data/hive-1.2.6/lib/
HADOOP_HOME=/data/hadoop-2.8.4
#解压安装文件
[root@xa01 tools]tar -zxvf kafka_2.11-1.0.0.tar.gz
#移动到/data目录下
[root@xa01 tools]mv kafka_2.11-1.0.0/ /data/
#将目录授权给hadoop用户
[root@xa01 tools]chown -R hadoop:hadoop /data/kafka_2.11-1.0.0/
broker.id=0
log.dirs=/data/kafka_2.11-1.0.0/kafka-logs
zookeeper.connect=xa01:2181,xa02:2181,xa03:2181,xa04:2181
zookeeper.connection.timeout.ms=6000
注:每台服务器broker.id唯一,分别是xa01=0, xa02=1, xa03=2, xa04=3;请分别修改
[hadoop@xa01 ~]scp -r /data/kafka_2.11-1.0.0/ hadoop@xa02:/data/
[hadoop@xa01 ~]scp -r /data/kafka_2.11-1.0.0/ hadoop@xa03:/data/
[hadoop@xa01 ~]scp -r /data/kafka_2.11-1.0.0/ hadoop@xa04:/data/
#解压安装文件
[root@xa01 tools]tar -zxvf apache-kylin-2.3.1-hbase1x-bin.tar.gz
#移动到/data目录下
[root@xa01 tools]mv kylin-2.3.1/ /data/
#将目录授权给hadoop用户
[root@xa01 tools]chown -R hadoop:hadoop /data/kylin-2.3.1/
kylin.metadata.url=/data/kylin_meta
kylin.server.mode=all
xa01执行:
#启动dfs服务
[hadoop@xa01 ~]/data/hadoop-2.8.4/sbin/start-dfs.sh
#启动yarn服务
[hadoop@xa01 ~]/data/hadoop-2.8.4/sbin/start-yarn.sh
#启动historyserver服务(kylin流式处理需要)
[hadoop@xa01 ~]/data/hadoop-2.8.4/sbin/mr-jobhistory-daemon.sh start historyserver
所有集群执行:
[hadoop@xa01 ~]/data/zookeeper-3.4.10/bin/zkServer.sh start
[hadoop@xa02 ~]/data/zookeeper-3.4.10/bin/zkServer.sh start
[hadoop@xa03 ~]/data/zookeeper-3.4.10/bin/zkServer.sh start
[hadoop@xa04 ~]/data/zookeeper-3.4.10/bin/zkServer.sh start
xa01执行:
[hadoop@xa01 ~]/data/hbase-1.2.6/bin/start-hbase.sh
xa01执行:
[hadoop@xa01 ~]nohup hive --service metastore &
所有集群执行:
[hadoop@xa01 ~]/data/kafka_2.11-1.0.0/bin/kafka-server-start.sh -daemon /data/kafka_2.11-1.0.0/config/server.properties &
[hadoop@xa02 ~]/data/kafka_2.11-1.0.0/bin/kafka-server-start.sh -daemon /data/kafka_2.11-1.0.0/config/server.properties &
[hadoop@xa03 ~]/data/kafka_2.11-1.0.0/bin/kafka-server-start.sh -daemon /data/kafka_2.11-1.0.0/config/server.properties &
[hadoop@xa04 ~]/data/kafka_2.11-1.0.0/bin/kafka-server-start.sh -daemon /data/kafka_2.11-1.0.0/config/server.properties &
xa01执行:
[hadoop@xa01 ~]/data/kylin-2.3.1/bin/kylin.sh start
整个过程记录了kylin2.3.1安装的全过程,可能存在瑕疵,希望大家不吝指出。
坑集锦会陆续更新,请关注,谢谢!
后续还会更新实战篇,大家互相学习。