Skip to content

Commit

Permalink
Remove UNDERFS_ADDRESS PropertyKey (Alluxio#8548)
Browse files Browse the repository at this point in the history
* Remove UNDERFS_ADDRESS PropertyKey

Removed all occurrences of UNDERFS_ADDRESS in the
code and documentation. Any places which needed
replacements now use MASTER_MOUNT_TABLE_ROOT_UFS.
In the case of environment variables we make sure that
"ALLUXIO_" is prepended.

* Add missing "ALLUXIO_" prefix to environment vars
  • Loading branch information
ZacBlanco authored and Adit Madan committed Mar 12, 2019
1 parent e8d4313 commit e7740a2
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 48 deletions.
4 changes: 2 additions & 2 deletions bin/alluxio
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ function main {
"format")
if [[ $# -eq 1 ]]; then
if [[ $1 == "-s" ]]; then
if [[ -e ${ALLUXIO_UNDERFS_ADDRESS} ]]; then
if [[ -e ${ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS} ]]; then
# if ufs is local filesystem and already exists
exit 0
else
# if ufs is not set it will default to local filesystem
if [[ ! -z ${ALLUXIO_UNDERFS_ADDRESS} ]] && [[ ${ALLUXIO_UNDERFS_ADDRESS} != /* ]] && [[ ${ALLUXIO_UNDERFS_ADDRESS} != file://* ]]; then
if [[ ! -z ${ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS} ]] && [[ ${ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS} != /* ]] && [[ ${ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS} != file://* ]]; then
# if ufs is not local filesystem, don't format
exit 0
fi
Expand Down
16 changes: 2 additions & 14 deletions core/common/src/main/java/alluxio/conf/PropertyKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,18 +496,7 @@ public String toString() {

/**
* UFS related properties.
*
* @deprecated since 1.5.0 and will be removed in 2.0. Use MASTER_MOUNT_TABLE_ROOT_UFS instead.
*/
@Deprecated
public static final PropertyKey UNDERFS_ADDRESS =
new Builder(Name.UNDERFS_ADDRESS)
.setDefaultValue(String.format("${%s}/underFSStorage", Name.WORK_DIR))
.setDescription("Under file storage address. This property is deprecated; "
+ "use alluxio.master.mount.table.root.ufs instead")
.setConsistencyCheckLevel(ConsistencyCheckLevel.ENFORCE)
.setScope(Scope.SERVER)
.build();
public static final PropertyKey UNDERFS_ALLOW_SET_OWNER_FAILURE =
new Builder(Name.UNDERFS_ALLOW_SET_OWNER_FAILURE)
.setDefaultValue(false)
Expand Down Expand Up @@ -1069,8 +1058,8 @@ public String toString() {
.build();
public static final PropertyKey MASTER_MOUNT_TABLE_ROOT_UFS =
new Builder(Template.MASTER_MOUNT_TABLE_UFS, "root")
.setDefaultValue(String.format("${%s}", Name.UNDERFS_ADDRESS))
.setDescription("The UFS mounted to Alluxio root mount point.")
.setDescription("The storage address of the UFS at the Alluxio root mount point.")
.setDefaultValue(String.format("${%s}/underFSStorage", Name.WORK_DIR))
.setConsistencyCheckLevel(ConsistencyCheckLevel.ENFORCE)
.setScope(Scope.MASTER)
.build();
Expand Down Expand Up @@ -3525,7 +3514,6 @@ public static final class Name {
//
// UFS related properties
//
public static final String UNDERFS_ADDRESS = "alluxio.underfs.address";
public static final String UNDERFS_ALLOW_SET_OWNER_FAILURE =
"alluxio.underfs.allow.set.owner.failure";
public static final String UNDERFS_CLEANUP_ENABLED = "alluxio.underfs.cleanup.enabled";
Expand Down
2 changes: 1 addition & 1 deletion deploy/vagrant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ create new directory `roles/ufs_{filesystem_name}` with structure:

|-- files
|---- compile_alluxio.sh # how to compile Alluxio against this ufs
|---- config_alluxio.sh # there are ufs related configurations in Alluxio like ALLUXIO_UNDERFS_ADDRESS
|---- config_alluxio.sh # there are ufs related configurations in Alluxio like ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS
|---- ...
|-- tasks
|---- download_release.yml # how to download the binary release of this ufs to a specific directory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: start alluxio mesos framework
command: /alluxio/integration/mesos/bin/alluxio-mesos-start.sh AlluxioMaster:50050
environment:
ALLUXIO_UNDERFS_ADDRESS: "hdfs://AlluxioMaster:9000/"
ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS: "hdfs://AlluxioMaster:9000/"
async: 10
poll: 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [[ ${ALLUXIO_VERSION_LESSTHAN_1_1} == true ]]; then
cat >> ~/.bashrc << EOF
export ALLUXIO_UNDERFS_ADDRESS="gs://${GCS_BUCKET}"
export ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="gs://${GCS_BUCKET}"
export ALLUXIO_JAVA_OPTS+="
-Dfs.gcs.accessKeyId=${GCS_ID}
Expand All @@ -11,7 +11,7 @@ export ALLUXIO_JAVA_OPTS+="
EOF
else
cat >> /alluxio/conf/alluxio-env.sh << EOF
ALLUXIO_UNDERFS_ADDRESS="gs://${GCS_BUCKET}"
ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="gs://${GCS_BUCKET}"
ALLUXIO_JAVA_OPTS+="
-Dfs.gcs.accessKeyId=${GCS_ID}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
UFS_MASTER=$(tail -n1 /alluxio/conf/workers)
if [[ ${ALLUXIO_VERSION_LESSTHAN_1_1} == true ]]; then
cat >> ~/.bashrc << EOF
export ALLUXIO_UNDERFS_ADDRESS="hdfs://${UFS_MASTER}:9000"
export ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="hdfs://${UFS_MASTER}:9000"
EOF
else
cat >> /alluxio/conf/alluxio-env.sh << EOF
ALLUXIO_UNDERFS_ADDRESS="hdfs://${UFS_MASTER}:9000"
ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="hdfs://${UFS_MASTER}:9000"
EOF
fi
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ UFS_MASTER=$(tail -n1 /alluxio/conf/workers)

if [[ ${ALLUXIO_VERSION_LESSTHAN_1_1} == true ]]; then
cat >> ~/.bashrc << EOF
export ALLUXIO_UNDERFS_ADDRESS="hdfs://${UFS_MASTER}:9000"
export ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="hdfs://${UFS_MASTER}:9000"
EOF
else
cat >> /alluxio/conf/alluxio-env.sh << EOF
ALLUXIO_UNDERFS_ADDRESS="hdfs://${UFS_MASTER}:9000"
ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="hdfs://${UFS_MASTER}:9000"
EOF
fi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cat >> /alluxio/conf/alluxio-env.sh << EOF
ALLUXIO_UNDERFS_ADDRESS="s3a://${S3_BUCKET}"
ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="s3a://${S3_BUCKET}"
ALLUXIO_JAVA_OPTS+="
-Daws.secretKey=${S3_KEY}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [[ ${ALLUXIO_VERSION_LESSTHAN_1_1} == true ]]; then
cat >> ~/.bashrc << EOF
export ALLUXIO_UNDERFS_ADDRESS="swift://${SWIFT_CONTAINER}"
export ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="swift://${SWIFT_CONTAINER}"
export ALLUXIO_JAVA_OPTS+="
-Dfs.swift.user=${SWIFT_USER}
Expand All @@ -15,7 +15,7 @@ export ALLUXIO_JAVA_OPTS+="
EOF
else
cat >> /alluxio/conf/alluxio-env.sh << EOF
ALLUXIO_UNDERFS_ADDRESS="swift://${SWIFT_CONTAINER}"
ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="swift://${SWIFT_CONTAINER}"
ALLUXIO_JAVA_OPTS+="
-Dfs.swift.user=${SWIFT_USER}
Expand Down
2 changes: 1 addition & 1 deletion docs/_data/table/en/env_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
description: The path to the Alluxio logs directory
- name: ALLUXIO_MASTER_HOSTNAME
description: hostname of the Alluxio master. Defaults to localhost
- name: ALLUXIO_UNDERFS_ADDRESS
- name: ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS
description: >
The under storage system addess. Defaults to `${ALLUXIO_HOME}`/underFSStorage which is a local
file system.
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/Configuration-Settings/more-conf.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```bash
$ export ALLUXIO_MASTER_HOSTNAME="localhost"
$ export ALLUXIO_UNDERFS_ADDRESS="hdfs://localhost:9000"
$ export ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="hdfs://localhost:9000"
$ export ALLUXIO_MASTER_JAVA_OPTS="$ALLUXIO_JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7001“
```
4 changes: 2 additions & 2 deletions docs/cn/basic/Configuration-Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Alluxio通过环境变量来支持一些常用的配置设置,包括:
<td>从1.1版本开始被<code class="highlighter-rouge">ALLUXIO_MASTER_HOSTNAME</code>替代,并将在2.0版本中移除</td>
</tr>
<tr>
<td><code class="highlighter-rouge">ALLUXIO_UNDERFS_ADDRESS</code></td>
<td><code class="highlighter-rouge">ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS</code></td>
<td>底层存储系统地址,默认为
<code class="highlighter-rouge">${ALLUXIO_HOME}/underFSStorage</code>,即本地文件系统</td>
</tr>
Expand Down Expand Up @@ -160,7 +160,7 @@ Alluxio通过环境变量来支持一些常用的配置设置,包括:

```bash
$ export ALLUXIO_MASTER_HOSTNAME="localhost"
$ export ALLUXIO_UNDERFS_ADDRESS="hdfs://localhost:9000"
$ export ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="hdfs://localhost:9000"
$ export ALLUXIO_MASTER_JAVA_OPTS="$ALLUXIO_JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7001"
```

Expand Down
12 changes: 6 additions & 6 deletions docs/cn/deploy/Running-Alluxio-On-Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ $ export INSTANCE_PUBLIC_IP=$(curl http://169.254.169.254/latest/meta-data/publi
$ docker run -d --net=host \
-v $PWD/underStorage:/underStorage \
-e ALLUXIO_MASTER_HOSTNAME=${INSTANCE_PUBLIC_IP} \
-e ALLUXIO_UNDERFS_ADDRESS=/underStorage \
-e ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS=/underStorage \
alluxio master
```
详细说明:
- `-e ALLUXIO_MASTER_HOSTNAME=${INSTANCE_PUBLIC_IP}`: 指定 Alluxio master 的监听 IP 地址.
- `-v $PWD/underStorage:/underStorage`:和Docker容器共享底层存储层文件夹。
- `-e ALLUXIO_UNDERFS_ADDRESS=/underStorage`:通知worker应用 /underStorage为底层文件存储层。
- `-e ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS=/underStorage`:通知worker应用 /underStorage为底层文件存储层。


## 运行Alluxio worker
Expand All @@ -105,7 +105,7 @@ $ ALLUXIO_WORKER_CONTAINER_ID=$(docker run -d --net=host \
-e ALLUXIO_MASTER_HOSTNAME=${INSTANCE_PUBLIC_IP} \
-e ALLUXIO_RAM_FOLDER=/opt/ramdisk \
-e ALLUXIO_WORKER_MEMORY_SIZE=1GB \
-e ALLUXIO_UNDERFS_ADDRESS=/underStorage \
-e ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS=/underStorage \
alluxio worker)
```
Details:
Expand All @@ -114,7 +114,7 @@ Details:
- `-e ALLUXIO_MASTER_HOSTNAME=${INSTANCE_PUBLIC_IP}`: 通知worker如何连接Master。
- `-e ALLUXIO_RAM_FOLDER=/opt/ramdisk`: 通知worker如何定位ramdisk。
- `-e ALLUXIO_WORKER_MEMORY_SIZE=1GB`: 通知worker节点ramdisk可用空间。
- `-e ALLUXIO_UNDERFS_ADDRESS=/underStorage`: 通知worker将/underStorage作为底层文件系统。
- `-e ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS=/underStorage`: 通知worker将/underStorage作为底层文件系统。

### 测试集群

Expand Down Expand Up @@ -159,7 +159,7 @@ $ docker run -d --net=host --shm-size=1G \
-v $PWD/underStorage:/underStorage \
-e ALLUXIO_MASTER_HOSTNAME=${INSTANCE_PUBLIC_IP} \
-e ALLUXIO_WORKER_MEMORY_SIZE=1GB \
-e ALLUXIO_UNDERFS_ADDRESS=/underStorage \
-e ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS=/underStorage \
alluxio worker
```

Expand Down Expand Up @@ -192,7 +192,7 @@ $ ALLUXIO_WORKER_CONTAINER_ID=$(docker run -d --net=host --shm-size=1G \
-e ALLUXIO_MASTER_HOSTNAME=${INSTANCE_PUBLIC_IP} \
-e ALLUXIO_WORKER_MEMORY_SIZE=1GB \
-e ALLUXIO_WORKER_DATA_SERVER_DOMAIN_SOCKET_ADDRESS=/opt/domain/d \
-e ALLUXIO_UNDERFS_ADDRESS=/underStorage \
-e ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS=/underStorage \
alluxio worker)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/cn/operation/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export ALLUXIO_USER_DEBUG_JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y

典型问题:

- `ALLUXIO_UNDERFS_ADDRESS`配置不正确
- `ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS`配置不正确
- 如果 `ssh localhost` 失败, 请确认`~/.ssh/authorized_keys`文件中包含主机的ssh公钥

### 问题: 打算在Spark/HDFS集群中部署Alluxio,有什么建议?
Expand Down
2 changes: 1 addition & 1 deletion docs/en/basic/Configuration-Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ run the following commands before startingthe master process:

```bash
$ export ALLUXIO_MASTER_HOSTNAME="localhost"
$ export ALLUXIO_UNDERFS_ADDRESS="hdfs://localhost:9000"
$ export ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS="hdfs://localhost:9000"
$ export ALLUXIO_MASTER_JAVA_OPTS="$ALLUXIO_JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7001"
```

Expand Down
2 changes: 1 addition & 1 deletion docs/en/operation/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ in these logs. Double check if you missed any configuration
steps in [Running-Alluxio-Locally]({{ '/en/deploy/Running-Alluxio-Locally.html' | relativize_url }}).

Typical issues:
- `ALLUXIO_UNDERFS_ADDRESS` is not configured correctly.
- `ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS` is not configured correctly.
- If running `ssh localhost` fails, make sure the public SSH key for the host is added in `~/.ssh/authorized_keys`.

### Q: I'm trying to deploy Alluxio in a cluster with Spark and HDFS. Are there any suggestions?
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/conf/alluxio.properties.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ALLUXIO_MASTER_HOSTNAME=alluxio-master
# Note: Embedded journal type is not supported on kubernetes
ALLUXIO_MASTER_JOURNAL_TYPE=UFS
ALLUXIO_MASTER_JOURNAL_FOLDER=/journal
ALLUXIO_UNDERFS_ADDRESS=<under_storage_address>
ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS=<under_storage_address>
ALLUXIO_WORKER_DATA_SERVER_DOMAIN_SOCKET_ADDRESS=/opt/domain
ALLUXIO_WORKER_DATA_SERVER_DOMAIN_SOCKET_AS_UUID=true
ALLUXIO_WORKER_MEMORY_SIZE=1GB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ public void resourceOffers(SchedulerDriver driver, List<Protos.Offer> offers) {
.newBuilder()
.addVariables(
Protos.Environment.Variable.newBuilder()
.setName("ALLUXIO_UNDERFS_ADDRESS")
.setValue(ServerConfiguration.get(PropertyKey.UNDERFS_ADDRESS))
.setName("ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS")
.setValue(ServerConfiguration
.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS))
.build())
.addVariables(
Protos.Environment.Variable.newBuilder()
Expand Down Expand Up @@ -212,8 +213,9 @@ public void resourceOffers(SchedulerDriver driver, List<Protos.Offer> offers) {
.build())
.addVariables(
Protos.Environment.Variable.newBuilder()
.setName("ALLUXIO_UNDERFS_ADDRESS")
.setValue(ServerConfiguration.get(PropertyKey.UNDERFS_ADDRESS))
.setName("ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS")
.setValue(ServerConfiguration
.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS))
.build())
.addVariables(
Protos.Environment.Variable.newBuilder()
Expand Down
4 changes: 2 additions & 2 deletions libexec/alluxio-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ if [[ -n "${ALLUXIO_MASTER_HOSTNAME}" ]]; then
ALLUXIO_JAVA_OPTS+=" -Dalluxio.master.hostname=${ALLUXIO_MASTER_HOSTNAME}"
fi

if [[ -n "${ALLUXIO_UNDERFS_ADDRESS}" ]]; then
ALLUXIO_JAVA_OPTS+=" -Dalluxio.underfs.address=${ALLUXIO_UNDERFS_ADDRESS}"
if [[ -n "${ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS}" ]]; then
ALLUXIO_JAVA_OPTS+=" -Dalluxio.underfs.address=${ALLUXIO_MASTER_MOUNT_TABLE_ROOT_UFS}"
fi

if [[ -n "${ALLUXIO_WORKER_MEMORY_SIZE}" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ protected void startMasters() throws IOException {
}

// Create the UFS directory after LocalAlluxioMaster construction, because LocalAlluxioMaster
// sets UNDERFS_ADDRESS.
// sets MASTER_MOUNT_TABLE_ROOT_UFS.
UnderFileSystem ufs = UnderFileSystem.Factory.createForRoot(ServerConfiguration.global());
String path = ServerConfiguration.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS);
if (ufs.isDirectory(path)) {
Expand Down

0 comments on commit e7740a2

Please sign in to comment.