Skip to content

Commit

Permalink
Docs: add install pre-compiled Hadoop SDK doc (#1685)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaogaozi authored Mar 30, 2022
1 parent 5906c76 commit 5284e15
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 29 deletions.
18 changes: 12 additions & 6 deletions docs/en/deployment/hadoop_java_sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ If you want to use JuiceFS in a distributed environment, when creating a file sy

JuiceFS Hadoop Java SDK need extra 4 * [`juicefs.memory-size`](#io-configurations) off-heap memory at most. By default, up to 1.2 GB of additional memory is required (depends on write load).

## Client compilation
## Install and compile the client

### Install the pre-compiled client

Please refer to the ["Installation & Upgrade"](../getting-started/installation.md#install-the-pre-compiled-client) document to learn how to download the precompiled JuiceFS Hadoop Java SDK.

### Compile the client manually

:::note
No matter which system environment the client is compiled for, the compiled JAR file has the same name and can only be deployed in the matching system environment. For example, when compiled in Linux, it can only be used in the Linux environment. In addition, since the compiled package depends on glibc, it is recommended to compile with a lower version system to ensure better compatibility.
Expand All @@ -46,7 +52,7 @@ Compilation depends on the following tools:
- make
- GCC 5.4+

### Linux and macOS
#### Linux and macOS

Clone the repository:

Expand All @@ -57,7 +63,7 @@ $ git clone https://github.com/juicedata/juicefs.git
Enter the directory and compile:

:::note
If Ceph RADOS is used to store data, you need to install `librados-dev` first and [build `libjfs.so`](https://github.com/juicedata/juicefs/blob/main/sdk/java/libjfs/Makefile#L22) with `-tags ceph`.
If Ceph RADOS is used to store data, you need to install `librados-dev` first and [build `libjfs.so`](https://github.com/juicedata/juicefs/blob/main/sdk/java/libjfs/Makefile#L38-L39) with `-tags ceph`.
:::

```shell
Expand All @@ -72,7 +78,7 @@ After the compilation, you can find the compiled `JAR` file in the `sdk/java/tar

It is recommended to use a version that includes third-party dependencies.

### Windows
#### Windows

The client used in the Windows environment needs to be obtained through cross-compilation on Linux or macOS. The compilation depends on [mingw-w64](https://www.mingw-w64.org/), which needs to be installed first.

Expand Down Expand Up @@ -247,10 +253,10 @@ Add configuration parameters to `conf/flink-conf.yaml`. If you only use JuiceFS
### Hudi

:::note
The latest version of Hudi (v0.10.0) does not yet support JuiceFS, you need to compile the latest master branch yourself.
Hudi supports JuiceFS since v0.10.0, please make sure you are using the correct version.
:::

Please refer to ["Hudi Official Documentation"](https://hudi.apache.org/docs/next/jfs_hoodie) to learn how to configure JuiceFS.
Please refer to ["Hudi Official Documentation"](https://hudi.apache.org/docs/jfs_hoodie) to learn how to configure JuiceFS.

### Restart Services

Expand Down
16 changes: 8 additions & 8 deletions docs/en/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ The JuiceFS client has only one binary file, you can download the pre-compiled v

You can download the latest version of the client at [GitHub](https://github.com/juicedata/juicefs/releases). Pre-compiled versions for different CPU architectures and operating systems are available in the download list of each client version. Please find the version suit your application the best, e.g.,

| File Name | Description |
| ------------------------------------ | ---------------------------- |
| `juicefs-x.x.x-darwin-amd64.tar.gz` | For macOS systems with Intel chips |
| `juicefs-x.x.x-linux-amd64.tar.gz` | For Linux distributions on x86 architecture |
| `juicefs-x.x.x-linux-arm64.tar.gz` | For Linux distributions on ARM architecture |
| `juicefs-x.x.x-windows-amd64.tar.gz` | For Windows on x86 architecture |
| `juicefs-hadoop-x.x.x-linux-amd64.jar` | Hadoop Java SDK for Linux distributions on x86 architecture |
| File Name | Description |
|--------------------------------------|--------------------------------------------------------------------------------------|
| `juicefs-x.x.x-darwin-amd64.tar.gz` | For macOS systems with Intel chips |
| `juicefs-x.x.x-linux-amd64.tar.gz` | For Linux distributions on x86 architecture |
| `juicefs-x.x.x-linux-arm64.tar.gz` | For Linux distributions on ARM architecture |
| `juicefs-x.x.x-windows-amd64.tar.gz` | For Windows on x86 architecture |
| `juicefs-hadoop-x.x.x-amd64.jar` | Hadoop Java SDK on x86 architecture (supports both Linux, macOS and Windows systems) |

:::tip
For macOS on M1 series chips, you can use the `darwin-amd64` version of the client dependent on [Rosetta 2](https://support.apple.com/zh-cn/HT211861), or you can refer to [Manually Compiling](#manually-compiling) to compile the native version.
For macOS on M1 series chips, you can use the `darwin-amd64` version of the client dependent on [Rosetta 2](https://support.apple.com/en-us/HT211861), or you can refer to [Manually Compiling](#manually-compiling) to compile the native version.
:::

### Linux
Expand Down
20 changes: 13 additions & 7 deletions docs/zh_cn/deployment/hadoop_java_sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ JuiceFS 默认使用本地的 `用户` 和 `UID` 映射,在分布式环境下

JuiceFS Hadoop Java SDK 最多需要额外使用 4 * [`juicefs.memory-size`](#io-配置) 的 off-heap 内存用来加速读写性能,默认情况下,最多需要额外 1.2GB 内存(取决于写入负载)。

## 客户端编译
## 安装与编译客户端

### 安装预编译客户端

请参考[「安装与升级」](../getting-started/installation.md#安装预编译客户端)文档了解如何下载预编译的 JuiceFS Hadoop Java SDK。

### 手动编译客户端

:::note 注意
不论为哪个系统环境编译客户端,编译后的 JAR 文件都为相同的名称,且只能部署在匹配的系统环境中,例如在 Linux 中编译则只能用于 Linux 环境。另外,由于编译的包依赖 glibc,建议尽量使用低版本的系统进行编译,这样可以获得更好的兼容性。
Expand All @@ -46,7 +52,7 @@ JuiceFS Hadoop Java SDK 最多需要额外使用 4 * [`juicefs.memory-size`](#io
- make
- GCC 5.4+

### Linux 和 macOS
#### Linux 和 macOS

克隆仓库:

Expand All @@ -57,22 +63,22 @@ $ git clone https://github.com/juicedata/juicefs.git
进入目录,执行编译:

:::note 注意
如果使用 Ceph 的 RADOS 作为 JuiceFS 的存储引擎,需要先安装 `librados-dev` 包并且在[编译 `libjfs.so`](https://github.com/juicedata/juicefs/blob/main/sdk/java/libjfs/Makefile#L22) 时加上 `-tags ceph`
如果使用 Ceph 的 RADOS 作为 JuiceFS 的存储引擎,需要先安装 `librados-dev` 包并且在[编译 `libjfs.so`](https://github.com/juicedata/juicefs/blob/main/sdk/java/libjfs/Makefile#L38-L39) 时加上 `-tags ceph`
:::

```shell
$ cd juicefs/sdk/java
$ make
```

编译完成后,可以在 `sdk/java/target` 目录中找到编译好的 `JAR` 文件,包括两个版本:
编译完成后,可以在 `sdk/java/target` 目录中找到编译好的 `JAR` 文件,包括两个版本:

- 包含第三方依赖的包:`juicefs-hadoop-X.Y.Z.jar`
- 不包含第三方依赖的包:`original-juicefs-hadoop-X.Y.Z.jar`

建议使用包含第三方依赖的版本。

### Windows
#### Windows

用于 Windows 环境的客户端需要在 Linux 或 macOS 系统上通过交叉编译的方式获得,编译依赖 [mingw-w64](https://www.mingw-w64.org/),需要提前安装。

Expand Down Expand Up @@ -249,10 +255,10 @@ $HADOOP_COMMON_HOME/lib/juicefs-hadoop.jar
### Hudi

:::note 注意
目前最新版 Hudiv0.10.0)还不支持 JuiceFS,你需要自行编译最新 master 分支
Hudiv0.10.0 版本开始支持 JuiceFS,请确保使用正确的版本
:::

请参考[「Hudi 官方文档」](https://hudi.apache.org/docs/next/jfs_hoodie)了解如何配置 JuiceFS。
请参考[「Hudi 官方文档」](https://hudi.apache.org/docs/jfs_hoodie)了解如何配置 JuiceFS。

### 重启服务

Expand Down
16 changes: 8 additions & 8 deletions docs/zh_cn/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ JuiceFS 客户端只有一个二进制文件,你可以下载预编译的版本

你可以在 [GitHub](https://github.com/juicedata/juicefs/releases) 找到最新版客户端下载地址,每个版本的下载列表中都提供了面向不同 CPU 架构和操作系统的预编译版本,请注意识别选择,例如:

| 文件名 | 说明 |
| ------------------------------------ | ---------------------------- |
| `juicefs-x.x.x-darwin-amd64.tar.gz` | 面向 Intel 芯片的 macOS 系统 |
| `juicefs-x.x.x-linux-amd64.tar.gz` | 面向 x86 架构 Linux 发行版 |
| `juicefs-x.x.x-linux-arm64.tar.gz` | 面向 ARM 架构的 Linux 发行版 |
| `juicefs-x.x.x-windows-amd64.tar.gz` | 面向 x86 架构的 Windows 系统 |
| `juicefs-hadoop-x.x.x-linux-amd64.jar` | 面向 x86 架构 Linux 发行版的 Hadoop Java SDK |
| 文件名 | 说明 |
|--------------------------------------|---------------------------------|
| `juicefs-x.x.x-darwin-amd64.tar.gz` | 面向 Intel 芯片的 macOS 系统 |
| `juicefs-x.x.x-linux-amd64.tar.gz` | 面向 x86 架构 Linux 发行版 |
| `juicefs-x.x.x-linux-arm64.tar.gz` | 面向 ARM 架构的 Linux 发行版 |
| `juicefs-x.x.x-windows-amd64.tar.gz` | 面向 x86 架构的 Windows 系统 |
| `juicefs-hadoop-x.x.x-amd64.jar` | 面向 x86 架构的 Hadoop Java SDK(同时支持 Linux、macOS 及 Windows 系统) |

:::tip 提示
对于 M1 系列芯片的 macOS 系统,可以使用 `darwin-amd64` 版本客户端依赖 [Rosetta 2](https://support.apple.com/zh-cn/HT211861) 使用,也可以参考 [手动编译客户端](#手动编译客户端) 编译原生版本。
Expand Down Expand Up @@ -153,7 +153,7 @@ CMD [ "juicefs" ]
另外,手动编译客户端可以让你优先体验到 JuiceFS 开发中的各种新功能,但这需要你具备一定的软件编译相关的基础知识。
:::tip 提示
对于中国地区用户,为了加快获取 Go 模块的速度,建议通过执行 `go env -w GOPROXY=https://goproxy.cn,direct`来将`GOPROXY`环境变量设置国内的镜像服务器。详情请参考:[Goproxy China](https://github.com/goproxy/goproxy.cn)。
对于中国地区用户,为了加快获取 Go 模块的速度,建议通过执行 `go env -w GOPROXY=https://goproxy.cn,direct` 来将 `GOPROXY` 环境变量设置国内的镜像服务器。详情请参考:[Goproxy China](https://github.com/goproxy/goproxy.cn)。
:::
### 类 Unix 客户端
Expand Down
3 changes: 3 additions & 0 deletions sdk/java/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.dll
*.dylib
*.so
.classpath
.project
.settings/
Expand Down

0 comments on commit 5284e15

Please sign in to comment.