Skip to content

软件包选择

基础配置

本地域名解析

cat >> /etc/hosts << EOF
192.168.159.11 mlishu1
192.168.159.12 mlishu2
192.168.159.13 mlishu3
EOF

设置主机名

hostnamectl hostname mlishu1

修改网卡IP

vi /etc/NetworkManager/system-connections/ens160.nmconnection

配置样例如下:

[connection]
id=ens160
uuid=c9459a93-5865-33ee-8b3f-798463f3ddb5
type=ethernet
autoconnect-priority=-999
interface-name=ens160

[ethernet]

[ipv4]
address1=192.168.159.11/24
dns=114.114.114.114;
gateway=192.168.159.254
method=manual

[ipv6]
addr-gen-mode=eui64
method=auto

[proxy]

关闭安全策略

需要在root模式执行

关闭防火墙

systemctl disable firewalld.service

关闭SeLinux

vi /etc/selinux/config

具体配置如下: 1763970722855.png

更换镜像源并更新系统

在这里我选择清华大学镜像源(教育网节点),按照节点速度选择对应的镜像站节点即可

vi /etc/yum.repos.d/centos.repo
[baseos]
name=CentOS Stream $releasever - BaseOS
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/BaseOS/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http


<NolebasePageProperties />




gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1

[baseos-debuginfo]
name=CentOS Stream $releasever - BaseOS - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/BaseOS/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[baseos-source]
name=CentOS Stream $releasever - BaseOS - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/BaseOS/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[appstream]
name=CentOS Stream $releasever - AppStream
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/AppStream/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1

[appstream-debuginfo]
name=CentOS Stream $releasever - AppStream - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/AppStream/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[appstream-source]
name=CentOS Stream $releasever - AppStream - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/AppStream/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[crb]
name=CentOS Stream $releasever - CRB
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/CRB/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-crb-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1

[crb-debuginfo]
name=CentOS Stream $releasever - CRB - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/CRB/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-crb-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[crb-source]
name=CentOS Stream $releasever - CRB - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/CRB/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-crb-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
vi /etc/yum.repos.d/centos-addons.repo
[highavailability]
name=CentOS Stream $releasever - HighAvailability
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/HighAvailability/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0

[highavailability-debuginfo]
name=CentOS Stream $releasever - HighAvailability - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/HighAvailability/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[highavailability-source]
name=CentOS Stream $releasever - HighAvailability - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/HighAvailability/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[nfv]
name=CentOS Stream $releasever - NFV
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/NFV/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0

[nfv-debuginfo]
name=CentOS Stream $releasever - NFV - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/NFV/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[nfv-source]
name=CentOS Stream $releasever - NFV - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/NFV/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[rt]
name=CentOS Stream $releasever - RT
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/RT/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-rt-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0

[rt-debuginfo]
name=CentOS Stream $releasever - RT - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/RT/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-rt-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[rt-source]
name=CentOS Stream $releasever - RT - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/RT/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-rt-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[resilientstorage]
name=CentOS Stream $releasever - ResilientStorage
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/ResilientStorage/$basearch/os
# metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0

[resilientstorage-debuginfo]
name=CentOS Stream $releasever - ResilientStorage - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/ResilientStorage/$basearch/debug/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-debug-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[resilientstorage-source]
name=CentOS Stream $releasever - ResilientStorage - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/$releasever-stream/ResilientStorage/source/tree/
# metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

[extras-common]
name=CentOS Stream $releasever - Extras packages
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/SIGs/$releasever-stream/extras/$basearch/extras-common
# metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-$stream&arch=$basearch&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1

[extras-common-source]
name=CentOS Stream $releasever - Extras packages - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/SIGs/$releasever-stream/extras/source/extras-common
# metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-source-$stream&arch=source&protocol=https,http
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
dnf clean all
dnf makecache
dnf update -y

配置SSH免密登录

su - hadoop
ssh-keygen -t rsa
for h in mlishu1 mlishu2 mlishu3; do ssh-copy-id $h; done

安装JDK

sudo dnf install -y java-11-openjdk java-11-openjdk-devel

安装Hadoop

配置目录环境

sudo chown -R hadoop:hadoop /opt/

下载Hadoop

mkdir -p /opt/packages
cd /opt/packages
wget https://downloads.apache.org/hadoop/common/hadoop/hadoop.tar.gz

解压Hadoop

cd /opt/packages
tar -zxvf hadoop.tar.gz
mkdir -p /opt/modules
mv hadoop/ hadoop

配置环境变量

echo 'export JAVA_HOME=/usr/lib/jvm/java-11-openjdk' >> ~/.bashrc
echo 'export HADOOP_HOME=/opt/modules/hadoop' >> ~/.bashrc
echo 'export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin' >> ~/.bashrc

将环境变量同步到另外两台机器

scp /home/hadoop/.bashrc hadoop@mlishu2:/home/hadoop/
scp /home/hadoop/.bashrc hadoop@mlishu3:/home/hadoop/

刷新环境变量

source ~/.bashrc

Hadoop配置

core-site.xml

vi /opt/modules/hadoop/etc/hadoop/core-site.xml

配置文件

<configuration>
  <property>
    <name>fs.defaultFS</name>
    <value>hdfs://mlishu1:9000</value>
  </property>
</configuration>

hdfs-site.xml

vi /opt/modules/hadoop/etc/hadoop/hdfs-site.xml

配置文件

<configuration>
  <property>
    <name>dfs.replication</name>
    <value>3</value>
  </property>

  <property>
    <name>dfs.namenode.name.dir</name>
    <value>file:/opt/hdfs/name</value>
  </property>

  <property>
    <name>dfs.datanode.data.dir</name>
    <value>file:/opt/hdfs/data</value>
  </property>
</configuration>

yarn-site.xml

vi /opt/modules/hadoop/etc/hadoop/yarn-site.xml

配置文件如下

<configuration>
    <property>
        <name>yarn.resourcemanager.hostname</name>
        <value>mlishu1</value>
    </property>
</configuration>

workers

vi /opt/modules/hadoop/etc/hadoop/workers

配置文件如下:(类似Hadoop2中的slaves文件)

mlishu1
mlishu2
mlishu3

同步文件夹

同步文件

scp -r /opt/modules/hadoop hadoop@mlishu2:/opt/modules/hadoop
scp -r /opt/modules/hadoop hadoop@mlishu3:/opt/modules/hadoop

启动Hadoop集群

hdfs namenode -format
start-all.sh

此时主机1有5个服务,主机2和主机3有两个服务 1763976509491.png

1763976569468.png

Zookeeper搭建

下载并解压软件包

cd /opt/packages/
wget https://downloads.apache.org/zookeeper/zookeeper-3.8.5/apache-zookeeper-3.8.5-bin.tar.gz

解压软件包

tar -zxvf zookeeper.tar.gz -C /opt/modules/
cd /opt/modules/
mv zookeeper/ zookeeper/

配置文件

mkdir -p /opt/modules/zookeeper/data
vi /opt/modules/zookeeper/conf/zoo.cfg
tickTime=2000
dataDir=/opt/modules/zookeeper/data
clientPort=2181
initLimit=5
syncLimit=2

server.1=mlishu1:2888:3888
server.2=mlishu2:2888:3888
server.3=mlishu3:2888:3888

同步文件夹

scp -r /opt/modules/zookeeper/ hadoop@mlishu2:/opt/modules/
scp -r /opt/modules/zookeeper/ hadoop@mlishu3:/opt/modules/

设置myid

echo 1 > /opt/modules/zookeeper/data/myid
echo 2 > /opt/modules/zookeeper/data/myid
echo 3 > /opt/modules/zookeeper/data/myid

配置环境变量

vi ~/.bashrc
export ZOOKEEPER_HOME=/opt/modules/zookeeper
export PATH=$ZOOKEEPER_HOME/bin:$ZOOKEEPER_HOME/conf

同步环境变量

scp /home/hadoop/.bashrc hadoop@mlishu2:/home/hadoop/
scp /home/hadoop/.bashrc hadoop@mlishu3:/home/hadoop/
source ~/.bashrc

启用zookeeper

zkServer.sh start

查看zookeeper启动状态 1763983831627.png 只有jps中有服务且状态模式为follower或leader时才算启动成功

安装HBase

下载软件包并解压

cd /opt/packages/
wget https://downloads.apache.org/hbase/2.5.13/hbase-2.5.13-bin.tar.gz

解压软件包

tar -zxvf hbase-2.5.13-bin.tar.gz -C /opt/modules/
cd /opt/modules
mv hbase-2.5.13/ hbase/

配置文件

vi /opt/modules/hbase/conf/hbase-site.xml
<configuration>
  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://mlishu1:9000/hbase</value>
  </property>

  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>

  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>mlishu1,mlishu2,mlishu3</value>
  </property>
</configuration>
vi /opt/modules/hbase/conf/regionservers
mlishu1
mlishu2
mlishu3

同步文件

scp -r /opt/modules/hbase/ hadoop@mlishu2:/opt/modules/
scp -r /opt/modules/hbase/ hadoop@mlishu3:/opt/modules/

配置环境变量

vi ~/.bashrc
export HBASE_HOME=/opt/modules/hbase
export PATH=$HBASE_HOME/bin

同步环境变量

scp /home/hadoop/.bashrc hadoop@mlishu2:/home/hadoop/
scp /home/hadoop/.bashrc hadoop@mlishu3:/home/hadoop/
source ~/.bashrc

启动Hbase

start-hbase.sh

可以在网页查看 1763984809084.png

安装Hive

安装MariaDB

sudo dnf install -y mariadb-server mariadb
sudo systemctl enable --now mariadb

创建 Hive 数据库

sudo mariadb
CREATE DATABASE metastore;
CREATE USER 'hive'@'%' IDENTIFIED BY 'hive123';
GRANT ALL PRIVILEGES ON metastore.* TO 'hive'@'%';
FLUSH PRIVILEGES;
exit

下载并解压软件包

cd /opt/packages/
wget https://mirrors.huaweicloud.com/apache/hive/hive-3.1.3/apache-hive-3.1.3-bin.tar.gz

解压软件包

tar -zxvf apache-hive-3.1.3-bin.tar.gz -C /opt/modules/
mv apache-hive-3.1.3-bin/ hive/

下载MariaDB驱动

cd /opt/modules/hive/lib
wget https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/3.3.4/mariadb-java-client-3.3.4.jar

修改配置文件

vi /opt/modules/hive/conf/hive-site.xml

配置样例如下:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>

  <!-- =======================
       Metastore(MariaDB)
       ======================= -->

  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:mariadb://mlishu1:3306/metastore?createDatabaseIfNotExist=true</value>
  </property>

  <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>org.mariadb.jdbc.Driver</value>
  </property>

  <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>hive</value>
  </property>

  <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>hive123</value>
  </property>

  <property>
    <name>datanucleus.autoCreateSchema</name>
    <value>false</value>
  </property>

  <property>
    <name>datanucleus.fixedDatastore</name>
    <value>true</value>
  </property>

  <property>
    <name>datanucleus.schema.autoCreateAll</name>
    <value>false</value>
  </property>

  <property>
    <name>hive.metastore.schema.verification</name>
    <value>true</value>
  </property>

  <property>
    <name>hive.metastore.uris</name>
    <value>thrift://mlishu1:9083</value>
  </property>


  <!-- =======================
       Hive 仓库目录
       ======================= -->

  <property>
    <name>hive.metastore.warehouse.dir</name>
    <value>/user/hive/warehouse</value>
  </property>

  <property>
    <name>hive.warehouse.subdir.inherit.perms</name>
    <value>true</value>
  </property>


  <!-- =======================
       执行引擎(推荐使用 Tez)
       ======================= -->

  <property>
    <name>hive.execution.engine</name>
    <value>tez</value>
  </property>

  <property>
    <name>tez.lib.uris</name>
    <value>hdfs:///tez/tez-0.10.3</value>
  </property>


  <!-- =======================
       HiveServer2
       ======================= -->

  <property>
    <name>hive.server2.thrift.bind.host</name>
    <value>mlishu1</value>
  </property>

  <property>
    <name>hive.server2.thrift.port</name>
    <value>10000</value>
  </property>

  <property>
    <name>hive.server2.transport.mode</name>
    <value>binary</value>
  </property>

  <property>
    <name>hive.server2.enable.doAs</name>
    <value>true</value>
  </property>


  <!-- =======================
       并发与事务
       ======================= -->

  <property>
    <name>hive.support.concurrency</name>
    <value>true</value>
  </property>

  <property>
    <name>hive.txn.manager</name>
    <value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value>
  </property>

  <property>
    <name>hive.compactor.initiator.on</name>
    <value>true</value>
  </property>

  <property>
    <name>hive.compactor.worker.threads</name>
    <value>4</value>
  </property>


  <!-- =======================
       本地临时目录
       ======================= -->

  <property>
    <name>hive.exec.local.scratchdir</name>
    <value>/tmp/hive</value>
  </property>

  <property>
    <name>hive.downloaded.resources.dir</name>
    <value>/tmp/hive/resources</value>
  </property>

  <property>
    <name>hive.querylog.location</name>
    <value>/tmp/hive/log</value>
  </property>

  <property>
    <name>hive.server2.logging.operation.log.location</name>
    <value>/tmp/hive/operation_logs</value>
  </property>


  <!-- =======================
       Hive 用户权限
       ======================= -->

  <property>
    <name>hive.server2.enable.impersonation</name>
    <value>true</value>
  </property>

</configuration>

添加环境变量

vi ~/.bashrc
export HIVE_HOME=/opt/modules/hive
export PATH=$PATH:$HIVE_HOME/bin

更新环境变量

source ~/.bashrc

初始化Metastore

schematool -dbType mysql -initSchema

启动Hive服务

hive --service metastore &
hive --service hiveserver2 &

Hue安装

Docker安装

在安装Hue前,先安装Docker

sudo su -
bash <(wget -qO- https://xuanyuan.cloud/docker.sh)

根据脚本安装即可

配置镜像源

vi /etc/docker/daemon.json
{
  "registry-mirrors": [
  "https://docker.xuanyuan.me"
],
  "insecure-registries": [
    "https://docker.1ms.run",
    "https://docker-0.unsee.tech",
    "https://docker.m.daocloud.io",
	"docker.xuanyuan.me"
],
  "dns": ["119.29.29.29", "114.114.114.114"]
}
systemctl daemon-reload
systemctl restart docker

拉取镜像

sudo docker pull gethue/hue:latest

创建配置文件

mkdir -p /opt/hue/conf
vi /opt/hue/conf/hue.ini
###############################################
# Hue 主配置
###############################################

[desktop]
# Hue Web 界面端口
http_port=8888

# 禁用 https(可选)
use_cherrypy_server=true

# 允许任何主机访问
django_debug_mode=false
enable_server_debug_level_logging=true


###############################################
# Hadoop 配置
###############################################

[hadoop]
# 默认文件系统(必须与 core-site.xml 一致)
fs_defaultfs=hdfs://mlishu1:9000

# Hadoop conf 路径(必须指向你的 Hadoop 配置目录)
hadoop_conf_dir=/usr/local/hadoop/etc/hadoop


[hadoop_clusters]
[[default]]
# NameNode Web UI地址
webhdfs_url=http://mlishu1:9870/webhdfs/v1

# ResourceManager
resourcemanager_host=mlishu1
resourcemanager_port=8032
resourcemanager_api_url=http://mlishu1:8088/ws/v1/cluster

# JobHistory
history_server_api_url=http://mlishu1:19888/ws/v1/history/mapreduce/jobs


###############################################
# Hive 配置(HiveServer2)
###############################################

[hive]
# HiveServer2 监听主机
hive_server_host=mlishu1
hive_server_port=10000

# Thrift 连接
server_conn_timeout=120

# Hive 配置文件目录
hive_conf_dir=/usr/local/hive/conf

# Metastore Thrift 地址
hive_metastore_hosts=mlishu1
hive_metastore_port=9083


###############################################
# HBase 配置
###############################################

[hbase]
hbase_clusters=(HBase|mlishu1:9090)
hbase_conf_dir=/usr/local/hbase/conf


###############################################
# Zookeeper 配置
###############################################

[zookeeper]
# 用于 HBase 浏览功能
host_ports=mlishu1:2181,mlishu2:2181,mlishu3:2181
retry_interval=1.0
retry_max_time=30.0


###############################################
# Spark(可选,可留空)
###############################################

[spark]
spark_history_server_url=http://mlishu1:18080


###############################################
# Hue 数据库(默认 sqlite)
###############################################

[database]
engine=sqlite3
name=/home/hadoop/hue/desktop/desktop.db


###############################################
# Authentication(可用本地用户)
###############################################

[auth]
backend=desktop.auth.backend.AllowAllBackend

启动容器

sudo docker run -d \
  --name hue \
  -p 8888:8888 \
  -v /opt/hue/conf/hue.ini:/usr/share/hue/desktop/conf/hue.ini \
  gethue/hue:latest

第一次登录需要输入账号密码 1763993662813.png

贡献者

The avatar of contributor named as lishu620 lishu620

文件历史

撰写