Skip to content

Commit

Permalink
Fix: misconfig of PATH env
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeBottle committed Feb 17, 2024
1 parent 0535ca9 commit 332aa7b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ ENV ZOOKEEPER_VER="3.9.1" \
# Hadoop日志目录
HADOOP_LOG_DIR="/opt/hadoop/logs"
# 把Hadoop目录加入环境变量
ENV PATH="$HADOOP_HOME/bin:/opt/somebottle/haspark/tools:$ZOOKEEPER_HOME/bin:$PATH" \
ENV HASPARK_PATH="$HADOOP_HOME/bin:/opt/somebottle/haspark/tools:$ZOOKEEPER_HOME/bin" \
HASPARK_LD_LIBRARY_PATH="$HADOOP_HOME/lib/native" \
PATH="$HASPARK_PATH:$PATH" \
# 把Hadoop本地库加入动态链接库路径
# 以免Spark或Hadoop找不到Hadoop Native Library
LD_LIBRARY_PATH="$HADOOP_HOME/lib/native:$LD_LIBRARY_PATH" \
LD_LIBRARY_PATH="$HASPARK_LD_LIBRARY_PATH:$LD_LIBRARY_PATH" \
# 临时密码文件路径加入环境变量
TEMP_PASS_FILE="/root/temp.pass"
# 用户.ssh配置目录
Expand Down Expand Up @@ -56,7 +58,7 @@ USER root
COPY resources/sources.list /tmp/sources.list

# 将路径环境变量写入/etc/profile.d/path_env.sh
RUN echo -e "#!/bin/bash\nexport PATH=$PATH\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH" > /etc/profile.d/path_env.sh && \
RUN echo -e "#!/bin/bash\nexport PATH=$HASPARK_PATH:\$PATH\nexport LD_LIBRARY_PATH=$HASPARK_LD_LIBRARY_PATH:\$LD_LIBRARY_PATH" > /etc/profile.d/path_env.sh && \
# 将Hadoop部分环境变量写入/etc/profile.d/hadoop.sh
echo -e "#!/bin/bash\nexport HADOOP_HOME=$HADOOP_HOME\nexport HADOOP_CONF_DIR=$HADOOP_CONF_DIR\nexport HADOOP_LOG_DIR=$HADOOP_LOG_DIR\nexport HADOOP_VER=$HADOOP_VER" >> /etc/profile.d/hadoop.sh && \
# 将Zookeeper部分环境变量写入/etc/profile.d/zookeeper.sh
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ docker pull somebottle/haspark
|`HADOOP_LOG_DIR` | Hadoop日志目录 |
|`HDFS_SERVICE_ADDR`| HDFS 服务地址。示例: 普通分布式-> `host:port`; HA 分布式-> `mycluster` |
|`ZOOKEEPER_QUORUM`| Zookeeper集群各节点地址,逗号分隔。示例: `host1:2181,host2:2181,host3:2181` |
|`TEMP_PASS_FILE`| SSH 临时密码文件的路径,在 SSH 公钥自动交换完毕后此文件将被自动删除(可用于判断 SSH 服务是否就绪) |
|`INIT_FLAG_FILE`| 容器初始化标记文件,在**Hadoop**初始化完毕后,此文件会被自动删除 |


## 4. 提供的脚本

Expand Down Expand Up @@ -163,7 +166,7 @@ version: '3'

services:
haspark-main:
image: somebottle/haspark:3.1.4
image: somebottle/haspark:3.1.5
hostname: shmain
env_file: ./conf.env
environment:
Expand All @@ -181,7 +184,7 @@ services:
- '9870:9870'
- '19888:19888'
haspark-worker-1:
image: somebottle/haspark:3.1.4
image: somebottle/haspark:3.1.5
hostname: shworker1
env_file: ./conf.env
environment:
Expand All @@ -197,7 +200,7 @@ services:
ports:
- '8081:8081'
haspark-worker-2:
image: somebottle/haspark:3.1.4
image: somebottle/haspark:3.1.5
hostname: shworker2
env_file: ./conf.env
environment:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
haspark-main:
image: somebottle/haspark:3.1.4
image: somebottle/haspark:3.1.5
hostname: shmain
env_file: ./conf.env
environment:
Expand All @@ -20,7 +20,7 @@ services:
- '9870:9870'
- '19888:19888'
haspark-worker-1:
image: somebottle/haspark:3.1.4
image: somebottle/haspark:3.1.5
hostname: shworker1
env_file: ./conf.env
environment:
Expand All @@ -36,7 +36,7 @@ services:
ports:
- '8081:8081'
haspark-worker-2:
image: somebottle/haspark:3.1.4
image: somebottle/haspark:3.1.5
hostname: shworker2
env_file: ./conf.env
environment:
Expand Down

0 comments on commit 332aa7b

Please sign in to comment.