Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@
all_racks = default("/clusterHostInfo/all_racks", [])
all_ipv4_ips = default("/clusterHostInfo/all_ipv4_ips", [])
slave_hosts = default("/clusterHostInfo/datanode_hosts", [])
nm_hosts = default("/clusterHostInfo/nodemanager_hosts", [])

# topology files
net_topology_script_file_path = "/etc/hadoop/conf/topology_script.py"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#}
[network_topology]
{% for host in all_hosts %}
{% if host in slave_hosts %}
{% if host in slave_hosts or host in nm_hosts %}
{{host}}={{all_racks[loop.index-1]}}
{{all_ipv4_ips[loop.index-1]}}={{all_racks[loop.index-1]}}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,16 @@ def decommission():
)
pass

# regenerate topology_mappings.data
File(
params.net_topology_mapping_data_file_path,
content=Template("topology_mappings.data.j2"),
owner=params.hdfs_user,
group=params.user_group,
mode=0o644,
only_if=format("test -d {hadoop_conf_dir}")
)

if not params.update_files_only:
Execute(nn_kinit_cmd, user=hdfs_user)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,14 @@
kinit_path_local = get_kinit_path(
default("/configurations/kerberos-env/executable_search_paths", None)
)

# topology files
net_topology_mapping_data_file_path = os.path.join(hadoop_conf_dir, "topology_mappings.data")

# hosts
all_hosts = default("/clusterHostInfo/all_hosts", [])
all_racks = default("/clusterHostInfo/all_racks", [])
all_ipv4_ips = default("/clusterHostInfo/all_ipv4_ips", [])
hostname = config["agentLevelParams"]["hostname"]
rm_host = default("/clusterHostInfo/resourcemanager_hosts", [])
public_hostname = config["agentLevelParams"]["public_hostname"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#}
[network_topology]
{% for host in all_hosts %}
{% if host in slave_hosts or host in nm_host %}
{{host}}={{all_racks[loop.index-1]}}
{{all_ipv4_ips[loop.index-1]}}={{all_racks[loop.index-1]}}
{% endif %}
{% endfor %}
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,15 @@ def get_spark_version(service_name, component_name, yarn_version):

user_group = config["configurations"]["cluster-env"]["user_group"]

# topology files
net_topology_mapping_data_file_path = os.path.join(hadoop_conf_dir, "topology_mappings.data")

# hosts
all_hosts = default("/clusterHostInfo/all_hosts", [])
all_racks = default("/clusterHostInfo/all_racks", [])
all_ipv4_ips = default("/clusterHostInfo/all_ipv4_ips", [])
slave_hosts = default("/clusterHostInfo/datanode_hosts", [])

# exclude file
if "all_decommissioned_hosts" in config["commandParams"]:
exclude_hosts = config["commandParams"]["all_decommissioned_hosts"].split(",")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,16 @@ def decommission(self, env):
group=user_group,
)

# regenerate topology_mappings.data
File(
params.net_topology_mapping_data_file_path,
content=Template("topology_mappings.data.j2"),
owner=params.hdfs_user,
group=params.user_group,
mode=0o644,
only_if=format("test -d {hadoop_conf_dir}")
)

if params.update_files_only == False:
Execute(
yarn_refresh_cmd, environment={"PATH": params.execute_path}, user=yarn_user
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#}
[network_topology]
{% for host in all_hosts %}
{% if host in slave_hosts or host in nm_hosts %}
{{host}}={{all_racks[loop.index-1]}}
{{all_ipv4_ips[loop.index-1]}}={{all_racks[loop.index-1]}}
{% endif %}
{% endfor %}