Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何在ambari集群中使用不同的操作系统版本时禁用脚本os_check_type.py_Linux_Hadoop_Rhel_Ambari_Hdp - Fatal编程技术网

Linux 如何在ambari集群中使用不同的操作系统版本时禁用脚本os_check_type.py

Linux 如何在ambari集群中使用不同的操作系统版本时禁用脚本os_check_type.py,linux,hadoop,rhel,ambari,hdp,Linux,Hadoop,Rhel,Ambari,Hdp,主要问题-在ambari/HDP集群中使用不同的操作系统版本(如RHEL 7.0和RHEL 7.2/7.5) 在阅读了一些文章之后 讨论了在集群中使用不同的OS RHEL版本 我看到了禁用脚本的解决方案: /usr/lib/python2.6/site-packages/ambari_server/os_check_type.py 但不清楚如何禁用它 例如,据我所知,一个选项是从脚本中删除执行,如下所示 chmod -x /usr/lib/python2.6/site-packages/

主要问题-在ambari/HDP集群中使用不同的操作系统版本(如RHEL 7.0和RHEL 7.2/7.5)

在阅读了一些文章之后

讨论了在集群中使用不同的OS RHEL版本

我看到了禁用脚本的解决方案:

/usr/lib/python2.6/site-packages/ambari_server/os_check_type.py
但不清楚如何禁用它

例如,据我所知,一个选项是从脚本中删除执行,如下所示

chmod -x  /usr/lib/python2.6/site-packages/ambari_server/os_check_type.py
但不确定这是不是意思

more os_check_type.py
#!/usr/bin/ambari-python-wrap

'''
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.
'''

import sys
from ambari_commons import OSCheck

def main(argv=None):
  # Same logic that was in "os_type_check.sh"
  if len(sys.argv) != 2:
    print "Usage: <cluster_os>"
    raise Exception("Error in number of arguments. Usage: <cluster_os>")
    pass

  cluster_os = sys.argv[1]
  current_os = OSCheck.get_os_family() + OSCheck.get_os_major_version()

  # If agent/server have the same {"family","main_version"} - then ok.
  print "Cluster primary/cluster OS family is %s and local/current OS family is %s" % (
    cluster_os, current_os)
  if current_os == cluster_os:
    sys.exit(0)
  else:
    raise Exception("Local OS is not compatible with cluster primary OS family. Please perform manual bootstrap on this host.")


if __name__ == "__main__":
  main()
更多操作系统检查类型.py
#!/usr/bin/ambari python wrap
'''
授权给Apache软件基金会(ASF)
一个或多个参与者许可协议。见通知文件
与此工作一起分发以获取更多信息
关于版权所有权。ASF许可此文件
根据Apache许可证,版本2.0(
“许可证”);除非符合规定,否则您不得使用此文件
带着执照。您可以通过以下方式获得许可证副本:
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,软件
根据许可证进行的分发是按“原样”进行分发的,
无任何明示或暗示的保证或条件。
请参阅许可证以了解管理权限和权限的特定语言
许可证下的限制。
'''
导入系统
从ambari_commons导入OSCheck
def干管(argv=无):
#与“os_type_check.sh”中的逻辑相同
如果len(sys.argv)!=2:
打印“用法:”
引发异常(“参数数量错误。用法:”)
通过
cluster_os=sys.argv[1]
当前操作系统=OSCheck.get操作系统系列()+OSCheck.get操作系统主要版本()
#如果代理/服务器具有相同的{“系列”,“主版本”},则确定。
打印“群集主/群集操作系统系列为%s,本地/当前操作系统系列为%s”%(
集群(操作系统、当前操作系统)
如果当前_os==群集_os:
系统出口(0)
其他:
引发异常(“本地操作系统与群集主操作系统系列不兼容。请在此主机上执行手动引导。”)
如果名称=“\uuuuu main\uuuuuuuu”:
main()

不过,这都是RHEL 7,那么问题出在哪里呢?我们的群集数据节点机器中有RHEL 7.2和RHEL 7.6I,我也分享了一篇文章,建议禁用os_check_type.py,以防使用不同的os版本您没有使用不同的版本。不是RHEL 6和7,只是7。次要版本在这里并不重要,所以我们可以将rhel版本混合为7.0/7.2/7/5/7.8?