-
Notifications
You must be signed in to change notification settings - Fork 24
/
zone-cdh.conf
53 lines (45 loc) · 2.05 KB
/
zone-cdh.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
: ${default_port_offset:=0}
: ${NAME_NODE_PROXY_HOSTNAME:=$DOCKER_HOSTNAME}
: ${FUSION_NAME_NODE_PROXY_PORT:=$(expr 8890 + $default_port_offset)}
: ${FUSION_LIVEHIVE_PROXY_PORT:=$(expr 9083 + $default_port_offset)}
: ${SSHD_OS:=centos}
: ${SSHD_PORT:=$(expr 2022 + $default_port_offset)}
: ${SSHD_CLOUDERA_PORT:=$(expr 8670 + $default_port_offset)}
validate_cdh_version() {
version="$1"
case "$version" in
5.11.0) return 0;;
5.12.0) return 0;;
5.13.0) return 0;;
5.14.0) return 0;;
5.15.0) return 0;;
5.16.0) return 0;;
6.0.0) return 0;;
6.1.0) return 0;;
6.2.0) return 0;;
esac
echo "Supported versions are: 5.11.0, 5.12.0, 5.13.0, 5.14.0, 5.15.0, 5.16.0, 6.0.0, 6.1.0, 6.2.0"
return 1
}
validate_sshd_os() {
os="$1"
case "$os" in
centos) return 0;;
ubuntu) return 0;;
esac
echo "Support sshd OS types are: centos, ubuntu"
return 1
}
validate_cdh_version "$CDH_VERSION"
update_var CDH_VERSION "Enter the CDH version for $ZONE_NAME" "" validate_cdh_version
update_var NAME_NODE_PROXY_HOSTNAME "Enter the NameNode Proxy hostname for $ZONE_NAME" "fusion-nn-proxy.example.com" validate_hostname
update_var FUSION_NAME_NODE_PROXY_PORT "Enter the NameNode Proxy port for $ZONE_NAME" "$(expr 8890 + $default_port_offset)" validate_number
update_var HADOOP_NAME_NODE_HOSTNAME "Enter the Hadoop NameNode IP or hostname for $ZONE_NAME" "namenode.example.com" validate_hostname
update_var HADOOP_NAME_NODE_PORT "Enter the NameNode port for $ZONE_NAME" "8020" validate_number
update_var FUSION_NAME_NODE_SERVICE_NAME "Enter the NameNode Service Name for $ZONE_NAME" "$NAME_NODE_PROXY_HOSTNAME:$FUSION_NAME_NODE_PROXY_PORT"
validate_sshd_os "$SSHD_OS"
update_var SSHD_OS "Enter the sshd OS type for $ZONE_NAME" "centos" validate_sshd_os
update_var SSHD_PORT "Enter the sshd port for $ZONE_NAME" "$(expr 2022 + $default_port_offset)" validate_number
update_var SSHD_CLOUDERA_PORT "Enter the Cloudera port for $ZONE_NAME" "$(expr 8670 + $default_port_offset)" validate_number
save_var PLATFORM "cdh-${CDH_VERSION}" "$SAVE_ENV"