hue 4.11容器化摆设,已团结Hive与Hadoop

[复制链接]
发表于 2025-12-18 14:30:04 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
共同《Hue 摆设过程中的报错处理处罚》食用更佳
官方设置分析页面:
https://docs.gethue.com/administrator/configuration/connectors/
官方设置hue.ini页面
https://github.com/cloudera/hue/blob/master/desktop/conf.dist/hue.ini
docker摆设

注意:


  • 初次摆设须要先解释hue.ini设置文件的映射,待到摆设乐成后,将设置文件拷贝到指定目次后,再取消解释举行摆设即可。
    大概到该地点下去复制并新建hue.ini,放到/data/hue/目次下(保举)。https://github.com/cloudera/hue/blob/master/desktop/conf.dist/hue.ini
  • 如果已摆设hive与hadoop,最好摆设hue容器之前将文件映射设置修改完备
  • 如果未摆设hive与Hadoop,忽略即可,后续有须要时再返来修改设置并重新摆设hue容器即可
  1. version: '3.3'  # 指定Docker Compose的版本
  2. services:  # 定义服务列表
  3.   hue:  # 服务的名称
  4.     image: gethue/hue:4.11.0  # 指定使用的镜像及其版本
  5.     container_name: hue  # 设置容器的名称
  6.     restart: always  # 配置容器的重启策略为总是重启
  7.     privileged: true  # 给予容器特权模式,拥有更多权限
  8.     hostname: hue  # 设置容器的主机名
  9.     ports:  # 端口映射
  10.       - "9898:8888"  # 将容器的8888端口映射到宿主机的9898端口
  11.     environment:  # 环境变量设置
  12.       - TZ=Asia/Shanghai  # 设置时区为中国上海
  13.     volumes:  # 数据卷配置
  14.       - /data/hue/hue.ini:/usr/share/hue/desktop/conf/hue.ini  # 将宿主机的hue.ini配置文件映射到容器内的指定位置
  15.       - /etc/localtime:/etc/localtime  # 将宿主机的本地时间设置映射到容器内,确保容器与宿主机时间一致
  16.       - /opt/hive-3.1.3:/opt/hive-3.1.3 # 将宿主机的hive目录映射到容器内
  17.       - /opt/hadoop-3.3.0:/opt/hadoop-3.3.0 # 将宿主机的hadoop目录映射到容器内
  18.     networks:
  19.       hue_default:
  20.         ipv4_address: 172.15.0.2  # 指定静态IP地址
  21. networks:  # 定义网络
  22.   hue_default:
  23.     driver: bridge  # 使用bridge驱动
  24.     ipam:
  25.       config:
  26.         - subnet: 172.15.0.0/16  # 指定子网范围
复制代码
  1. # 1. 创建hue部署文件
  2. vi docker-compose-hue.yml
  3. # 2. 将上方的部署内容复制粘贴到docker-compose-hue.yml中
  4. # 3. 使用docker compose部署hue
  5. docker compose -f docker-compose-hue.yml  up -d
  6. # 4. 检验是否部署成功,同一局域网下的浏览器访问hue
  7. # 由于这是您第一次登录,请选择任意用户名和密码。请务必记住这些,因为它们将成为您的 Hue 超级用户凭据。
  8. 主机ip:9898
复制代码
hue初始化


  • hue.ini 设置文件修改
  1. vi /data/hue/hue.ini
复制代码
  1. # 修改Webserver监听地址
  2. http_host=127.0.0.1
  3. # 修改时区
  4. time_zone=Asia/Shanghai
  5. # 配置hue元数据数据库存储
  6. [[database]]
  7. engine=mysql
  8. host=192.168.10.75
  9. port=3306
  10. user=root
  11. password=HoMf@123
  12. name=hue
  13. # 配置hue数据库连接,用于查询Mysql数据库
  14. [[interpreters]]
  15. # Define the name and how to connect and execute the language.
  16. # https://docs.gethue.com/administrator/configuration/editor/
  17. [[[mysql]]]
  18.    name = MySQL
  19.    interface=sqlalchemy
  20. #   ## https://docs.sqlalchemy.org/en/latest/dialects/mysql.html
  21.    options='{"url": "mysql://root:HoMf@[email protected]:3306/hue_meta"}'
  22. #   ## options='{"url": "mysql://${USER}:${PASSWORD}@localhost:3306/hue"}'
复制代码

  • 创建数据库
  1. # 进入数据库
  2. mysql -uroot -pHoMf@123
  3. # 创建hue数据库
  4. mysql> create database `hue` default character set utf8mb4 default collate utf8mb4_general_ci;
  5. Query OK, 1 row affected (0.00 sec)
  6. # 创建hue_meta数据库
  7. mysql> create database `hue_meta` default character set utf8mb4 default collate utf8mb4_general_ci;
  8. Query OK, 1 row affected (0.00 sec)
复制代码

  • 应用设置文件,重启容器,进入容器,数据库初始化
  1. # 重启hue容器
  2. docker restart hue
  3. # 进入hue容器
  4. docker exec -it hue bash
  5. # 执行数据库初始化
  6. /usr/share/hue/build/env/bin/hue syncdb
  7. /usr/share/hue/build/env/bin/hue migrate
  8. # 退出容器,ctrl + D,或
  9. exit
复制代码


  • 数据库初始化详细利用及返回效果
  1. hue@hue:/usr/share/hue$ /usr/share/hue/build/env/bin/hue syncdb
  2. [22/Nov/2024 15:38:07 +0800] settings     INFO     Welcome to Hue 4.11.0
  3. [22/Nov/2024 15:38:08 +0800] conf         WARNING  enable_extract_uploaded_archive is of type bool. Resetting it as type 'coerce_bool'. Please fix it permanently
  4. [22/Nov/2024 15:38:08 +0800] conf         WARNING  enable_new_create_table is of type bool. Resetting it as type 'coerce_bool'. Please fix it permanently
  5. [22/Nov/2024 15:38:08 +0800] conf         WARNING  force_hs2_metadata is of type bool. Resetting it as type 'coerce_bool'. Please fix it permanently
  6. [22/Nov/2024 15:38:08 +0800] conf         WARNING  show_table_erd is of type bool. Resetting it as type 'coerce_bool'. Please fix it permanently
  7. [21/Nov/2024 23:38:08 -0800] backend      WARNING  mozilla_django_oidc module not found
  8. [21/Nov/2024 23:38:09 -0800] apps         INFO     AXES: BEGIN LOG
  9. [21/Nov/2024 23:38:09 -0800] apps         INFO     AXES: Using django-axes version 5.13.0
  10. [21/Nov/2024 23:38:09 -0800] apps         INFO     AXES: blocking by IP only.
  11. [21/Nov/2024 23:38:09 -0800] api3         WARNING  simple_salesforce module not found
  12. [21/Nov/2024 23:38:09 -0800] jdbc         WARNING  Failed to import py4j
  13. [21/Nov/2024 23:38:10 -0800] schemas      INFO     Resource 'XMLSchema.xsd' is already loaded
  14. No changes detected
  15. hue@hue:/usr/share/hue$ /usr/share/hue/build/env/bin/hue migrate
  16. [22/Nov/2024 15:38:33 +0800] settings     INFO     Welcome to Hue 4.11.0
  17. [22/Nov/2024 15:38:33 +0800] conf         WARNING  enable_extract_uploaded_archive is of type bool. Resetting it as type 'coerce_bool'. Please fix it permanently
  18. [22/Nov/2024 15:38:33 +0800] conf         WARNING  enable_new_create_table is of type bool. Resetting it as type 'coerce_bool'. Please fix it permanently
  19. [22/Nov/2024 15:38:33 +0800] conf         WARNING  force_hs2_metadata is of type bool. Resetting it as type 'coerce_bool'. Please fix it permanently
  20. [22/Nov/2024 15:38:33 +0800] conf         WARNING  show_table_erd is of type bool. Resetting it as type 'coerce_bool'. Please fix it permanently
  21. [21/Nov/2024 23:38:33 -0800] backend      WARNING  mozilla_django_oidc module not found
  22. [21/Nov/2024 23:38:34 -0800] apps         INFO     AXES: BEGIN LOG
  23. [21/Nov/2024 23:38:34 -0800] apps         INFO     AXES: Using django-axes version 5.13.0
  24. [21/Nov/2024 23:38:34 -0800] apps         INFO     AXES: blocking by IP only.
  25. [21/Nov/2024 23:38:34 -0800] api3         WARNING  simple_salesforce module not found
  26. [21/Nov/2024 23:38:34 -0800] jdbc         WARNING  Failed to import py4j
  27. [21/Nov/2024 23:38:35 -0800] schemas      INFO     Resource 'XMLSchema.xsd' is already loaded
  28. Operations to perform:
  29.   Apply all migrations: auth, authtoken, axes, beeswax, contenttypes, desktop, jobsub, oozie, pig, sessions, sites, useradmin
  30. Running migrations:
  31.   Applying contenttypes.0001_initial... OK
  32.   Applying contenttypes.0002_remove_content_type_name... OK
  33.   Applying auth.0001_initial... OK
  34.   Applying auth.0002_alter_permission_name_max_length... OK
  35.   Applying auth.0003_alter_user_email_max_length... OK
  36.   Applying auth.0004_alter_user_username_opts... OK
  37.   Applying auth.0005_alter_user_last_login_null... OK
  38.   Applying auth.0006_require_contenttypes_0002... OK
  39.   Applying auth.0007_alter_validators_add_error_messages... OK
  40.   Applying auth.0008_alter_user_username_max_length... OK
  41.   Applying auth.0009_alter_user_last_name_max_length... OK
  42.   Applying auth.0010_alter_group_name_max_length... OK
  43.   Applying auth.0011_update_proxy_permissions... OK
  44.   Applying auth.0012_alter_user_first_name_max_length... OK
  45.   Applying authtoken.0001_initial... OK
  46.   Applying authtoken.0002_auto_20160226_1747... OK
  47.   Applying authtoken.0003_tokenproxy... OK
  48.   Applying axes.0001_initial... OK
  49.   Applying axes.0002_auto_20151217_2044... OK
  50.   Applying axes.0003_auto_20160322_0929... OK
  51.   Applying axes.0004_auto_20181024_1538... OK
  52.   Applying axes.0005_remove_accessattempt_trusted... OK
  53.   Applying axes.0006_remove_accesslog_trusted... OK
  54.   Applying axes.0007_add_accesslog_trusted... OK
  55.   Applying axes.0008_remove_accesslog_trusted... OK
  56.   Applying beeswax.0001_initial... OK
  57.   Applying beeswax.0002_auto_20200320_0746... OK
  58.   Applying beeswax.0003_compute_namespace... OK
  59.   Applying desktop.0001_initial... OK
  60.   Applying desktop.0002_initial... OK
  61.   Applying desktop.0003_initial... OK
  62.   Applying desktop.0004_initial... OK
  63.   Applying desktop.0005_initial... OK
  64.   Applying desktop.0006_initial... OK
  65.   Applying desktop.0007_initial... OK
  66.   Applying desktop.0008_auto_20191031_0704... OK
  67.   Applying desktop.0009_auto_20191202_1056... OK
  68.   Applying desktop.0010_auto_20200115_0908... OK
  69.   Applying desktop.0011_document2_connector... OK
  70.   Applying desktop.0012_connector_interface... OK
  71.   Applying desktop.0013_alter_document2_is_trashed... OK
  72.   Applying jobsub.0001_initial... OK
  73.   Applying oozie.0001_initial... OK
  74.   Applying oozie.0002_initial... OK
  75.   Applying oozie.0003_initial... OK
  76.   Applying oozie.0004_initial... OK
  77.   Applying oozie.0005_initial... OK
  78.   Applying oozie.0006_auto_20200714_1204... OK
  79.   Applying oozie.0007_auto_20210126_2113... OK
  80.   Applying oozie.0008_auto_20210216_0216... OK
  81.   Applying pig.0001_initial... OK
  82.   Applying pig.0002_auto_20200714_1204... OK
  83.   Applying sessions.0001_initial... OK
  84.   Applying sites.0001_initial... OK
  85.   Applying sites.0002_alter_domain_unique... OK
  86.   Applying useradmin.0001_initial... OK
  87.   Applying useradmin.0002_userprofile_json_data... OK
  88.   Applying useradmin.0003_auto_20200203_0802... OK
  89.   Applying useradmin.0004_userprofile_hostname... OK
  90. [21/Nov/2024 23:38:42 -0800] models       INFO     HuePermissions: 34 added, 0 updated, 0 up to date, 0 stale, 0 deleted
复制代码

  • 检察数据库表是否创建乐成,判断命据库是否初始化完成
  1. # 进入数据库
  2. mysql -uroot -pHoMf@123
  3. # 进入hue数据库
  4. mysql> use hue;
  5. Reading table information for completion of table and column names
  6. You can turn off this feature to get a quicker startup with -A
  7. Database changed
  8. # 查看hue数据库内的数据库表
  9. mysql> show tables;
  10. +--------------------------------+
  11. | Tables_in_hue                  |
  12. +--------------------------------+
  13. | auth_group                     |
  14. | auth_group_permissions         |
  15. | auth_permission                |
  16. | auth_user                      |
  17. | auth_user_groups               |
  18. | auth_user_user_permissions     |
  19. | authtoken_token                |
  20. | axes_accessattempt             |
  21. | axes_accesslog                 |
  22. | beeswax_compute                |
  23. | beeswax_metainstall            |
  24. | beeswax_namespace              |
  25. | beeswax_queryhistory           |
  26. | beeswax_savedquery             |
  27. | beeswax_session                |
  28. | defaultconfiguration_groups    |
  29. | desktop_connector              |
  30. | desktop_defaultconfiguration   |
  31. | desktop_document               |
  32. | desktop_document2              |
  33. | desktop_document2_dependencies |
  34. | desktop_document2permission    |
  35. | desktop_document_tags          |
  36. | desktop_documentpermission     |
  37. | desktop_documenttag            |
  38. | desktop_settings               |
  39. | desktop_userpreferences        |
  40. | django_content_type            |
  41. | django_migrations              |
  42. | django_session                 |
  43. | django_site                    |
  44. | documentpermission2_groups     |
  45. | documentpermission2_users      |
  46. | documentpermission_groups      |
  47. | documentpermission_users       |
  48. | jobsub_checkforsetup           |
  49. | jobsub_jobdesign               |
  50. | jobsub_jobhistory              |
  51. | jobsub_oozieaction             |
  52. | jobsub_ooziedesign             |
  53. | jobsub_ooziejavaaction         |
  54. | jobsub_ooziemapreduceaction    |
  55. | jobsub_ooziestreamingaction    |
  56. | oozie_bundle                   |
  57. | oozie_bundledcoordinator       |
  58. | oozie_coordinator              |
  59. | oozie_datainput                |
  60. | oozie_dataoutput               |
  61. | oozie_dataset                  |
  62. | oozie_decision                 |
  63. | oozie_decisionend              |
  64. | oozie_distcp                   |
  65. | oozie_email                    |
  66. | oozie_end                      |
  67. | oozie_fork                     |
  68. | oozie_fs                       |
  69. | oozie_generic                  |
  70. | oozie_history                  |
  71. | oozie_hive                     |
  72. | oozie_java                     |
  73. | oozie_job                      |
  74. | oozie_join                     |
  75. | oozie_kill                     |
  76. | oozie_link                     |
  77. | oozie_mapreduce                |
  78. | oozie_node                     |
  79. | oozie_pig                      |
  80. | oozie_shell                    |
  81. | oozie_sqoop                    |
  82. | oozie_ssh                      |
  83. | oozie_start                    |
  84. | oozie_streaming                |
  85. | oozie_subworkflow              |
  86. | oozie_workflow                 |
  87. | pig_document                   |
  88. | pig_pigscript                  |
  89. | useradmin_grouppermission      |
  90. | useradmin_huepermission        |
  91. | useradmin_ldapgroup            |
  92. | useradmin_userprofile          |
  93. +--------------------------------+
  94. 80 rows in set (0.01 sec)
复制代码
摆设查验

此时应可以正常进入hue界面,而且Sources列表内可以或许看到MySql



设置hive

请先添加好文件映射,确保在容器内也可以访问到hive的设置文件目次
修改hue.ini设置文件,修改后重启容器即可
设置乐成后即可在hue界面内的Sources列表内可以或许看到Hive

  1. # 修改hue配置文件
  2. vi /data/hue/hue.ini
复制代码
  1. # 取消注释即可
  2. [[[hive]]]
  3.    name=Hive
  4.    interface=hiveserver2
  5. [beeswax]
  6. # Host where HiveServer2 is running.
  7. # If Kerberos security is enabled, use fully-qualified domain name (FQDN).
  8. # hive主机地址
  9. hive_server_host=192.168.10.75
  10. # Binary thrift port for HiveServer2.
  11. # hive-site.xml中的hive.server2.thrift.port配置
  12. hive_server_port=10000
  13. # Hive configuration directory, where hive-site.xml is located
  14. # hive配置文件目录,若为容器部署,则需要配置文件映射
  15. hive_conf_dir=/opt/hive-3.1.3/conf
  16. # Timeout in seconds for thrift calls to Hive service
  17. server_conn_timeout=120
  18. # Override the default desktop username and password of the hue user used for authentications with other services.
  19. # e.g. Used for LDAP/PAM pass-through authentication.
  20. auth_username=hue
  21. auth_password=root
  22. [metastore]
  23. # Flag to turn on the new version of the create table wizard.
  24. enable_new_create_table=true
复制代码


  • 附上我的hive-site.xml设置
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?><!--
  3.    Licensed to the Apache Software Foundation (ASF) under one or more
  4.    contributor license agreements.  See the NOTICE file distributed with
  5.    this work for additional information regarding copyright ownership.
  6.    The ASF licenses this file to You under the Apache License, Version 2.0
  7.    (the "License"); you may not use this file except in compliance with
  8.    the License.  You may obtain a copy of the License at
  9.        http://www.apache.org/licenses/LICENSE-2.0
  10.    Unless required by applicable law or agreed to in writing, software
  11.    distributed under the License is distributed on an "AS IS" BASIS,
  12.    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13.    See the License for the specific language governing permissions and
  14.    limitations under the License.
  15. -->
  16. <configuration>
  17.         <property>
  18.                 <name>hive.metastore.warehouse.dir</name>
  19.                 <value>/user/hive-3.1.3/warehouse</value>
  20.                 <description/>
  21.         </property>
  22.         <property>
  23.                 <name>javax.jdo.option.ConnectionURL</name>
  24.                 <value>jdbc:mysql://Linux-Master:3306/hive?createDatabaseIfNotExist=true&amp;useSSL=false&amp;allowPublicKeyRetrieval=true</value>
  25.                 <description>数据库连接</description>
  26.         </property>
  27.         <property>
  28.                 <name>javax.jdo.option.ConnectionDriverName</name>
  29.                 <value>com.mysql.jdbc.Driver</value>
  30.                 <description/>
  31.         </property>
  32.         <property>
  33.                 <name>javax.jdo.option.ConnectionUserName</name>
  34.                 <value>root</value>
  35.                 <description/>
  36.         </property>
  37.         <property>
  38.                 <name>javax.jdo.option.ConnectionPassword</name>
  39.                 <value>HoMf@123</value>
  40.                 <description/>
  41.         </property>
  42.         <property>
  43.                 <name>hive.querylog.location</name>
  44.                 <value>/home/hadoop/logs/hive-3.1.3/job-logs/${user.name}</value>
  45.                 <description>Location of Hive run time structured log file</description>
  46.         </property>
  47.         <property>
  48.                 <name>hive.exec.scratchdir</name>
  49.                 <value>/user/hive-3.1.3/tmp</value>
  50.         </property>
  51.       
  52.         <property>
  53.                 <name>hive.server2.thrift.port</name>
  54.                 <value>11000</value>
  55.         </property>
  56. </configuration>
复制代码
设置 Hadoop

设置 HDFS

修改hue.ini

  1. # 修改hue配置文件
  2. vi /data/hue/hue.ini
复制代码
  1. # hdfs集群配置
  2. [[hdfs_clusters]]
  3.   # HA support by using HttpFs
  4. [[[default]]]
  5. fs_defaultfs=hdfs://192.168.10.75:9000
  6. webhdfs_url=http://192.168.10.75:9870/webhdfs/v1
  7. hadoop_conf_dir=/opt/hadoop-3.3.0/etc/hadoop
  8. # yarn集群配置
  9. [[yarn_clusters]]
  10. [[[default]]]
  11. # Enter the host on which you are running the ResourceManager
  12. resourcemanager_host=192.168.10.75
  13. # The port where the ResourceManager IPC listens on
  14. resourcemanager_port=8032
  15. # Whether to submit jobs to this cluster
  16. submit_to=True
  17. # Resource Manager logical name (required for HA)
  18. ## logical_name=
  19. # Change this if your YARN cluster is Kerberos-secured
  20. ## security_enabled=false
  21. # URL of the ResourceManager API
  22. resourcemanager_api_url=http://192.168.10.75:8088
  23. # URL of the ProxyServer API
  24. proxy_api_url=http://192.168.10.75:8088
  25. # URL of the HistoryServer API
  26. history_server_api_url=http://localhost:19888
复制代码
修改hadoop的core-site.xml

  1. <!—允许通过 httpfs 方式访问 hdfs 的主机名 -->
  2. <property>
  3. <name>hadoop.proxyuser.root.hosts</name>
  4. <value>*</value>
  5. </property>
  6. <!—允许通过 httpfs 方式访问 hdfs 的用户组 -->
  7. <property>
  8. <name>hadoop.proxyuser.root.groups</name>
  9. <value>*</value>
  10. </property>
复制代码


  • 这里附上我的core-site.xml
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
  3. <!--
  4.   Licensed under the Apache License, Version 2.0 (the "License");
  5.   you may not use this file except in compliance with the License.
  6.   You may obtain a copy of the License at
  7.     http://www.apache.org/licenses/LICENSE-2.0
  8.   Unless required by applicable law or agreed to in writing, software
  9.   distributed under the License is distributed on an "AS IS" BASIS,
  10.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11.   See the License for the specific language governing permissions and
  12.   limitations under the License. See accompanying LICENSE file.
  13. -->
  14. <!-- Put site-specific property overrides in this file. -->
  15. <configuration>
  16.         <property>
  17.                 <name>hadoop.tmp.dir</name>
  18.                         <value>/opt/hadoop-3.3.0/tmp</value>
  19.                         <description>Abase for other temporary directories.</description>
  20.         </property>
  21.         <property>
  22.                 <name>fs.defaultFS</name>
  23.                         <!-- IP地址为主节点服务器地址 -->
  24.                         <value>hdfs://192.168.10.75:9000</value>
  25.         </property>
  26.         <property>
  27.                 <name>hadoop.proxyuser.root.hosts</name>
  28.                 <value>*</value>
  29.         </property>
  30.         <property>
  31.                 <name>hadoop.proxyuser.root.groups</name>
  32.                 <value>*</value>
  33.         </property>
  34.         <property>
  35.                 <name>hadoop.proxyuser.hue.hosts</name>
  36.                 <value>*</value>
  37.         </property>
  38.         <property>
  39.                 <name>hadoop.proxyuser.hue.groups</name>
  40.                 <value>*</value>
  41.         </property>
  42. </configuration>
复制代码
修改hadoop的hdfs-site.xml

  1. <property>
  2. <name>dfs.webhdfs.enabled</name>
  3. <value>true</value>
  4. </property>
复制代码


  • 这里附上我的hdfs-site.xml
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
  3. <!--
  4.   Licensed under the Apache License, Version 2.0 (the "License");
  5.   you may not use this file except in compliance with the License.
  6.   You may obtain a copy of the License at
  7.     http://www.apache.org/licenses/LICENSE-2.0
  8.   Unless required by applicable law or agreed to in writing, software
  9.   distributed under the License is distributed on an "AS IS" BASIS,
  10.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11.   See the License for the specific language governing permissions and
  12.   limitations under the License. See accompanying LICENSE file.
  13. -->
  14. <!-- Put site-specific property overrides in this file. -->
  15. <configuration>
  16.         <!-- nn web 端访问地址-->
  17.         <property>
  18.                 <name>dfs.namenode.http-address</name>
  19.                 <!-- master-ubuntu需要改为主节点机器名-->
  20.                 <value>linux-master:9870</value>
  21.         </property>
  22.         <!-- 2nn web 端访问地址-->
  23.         <property>
  24.                 <name>dfs.namenode.secondary.http-address</name>
  25.                 <!-- slave1-ubuntu需要改为第一从节点台机器名-->
  26.                 <value>linux-slave01:9868</value>
  27.         </property>
  28.         <property>
  29.                 <name>dfs.permissions.enabled</name>
  30.                 <value>false</value>
  31.         </property>
  32.         <property>
  33.                 <name>dfs.webhdfs.enable</name>
  34.                 <value>true</value>
  35.         </property>
  36. </configuration>
复制代码
设置yarn集群



  • 设置hadoop的yarn-site.xml
  1.         <!-- 开启日志日志聚集功能 -->
  2.         <property>
  3.                 <name>yarn.log-aggregation-enable</name>
  4.                 <value>true</value>
  5.         </property>
  6.         <!-- 设置日志日志聚集服务器地址 -->
  7.         <property>
  8.                 <name>yarn.log.server.url</name>
  9.                 <!-- IP地址为主节点机器地址 -->
  10.                 <value>http://192.168.10.75:19888/jobhistory/logs</value>
  11.         </property>
  12.         <!-- 设置日志日志保留时间为 7 天 -->
  13.         <property>
  14.                 <name>yarn.log-aggregation.retain-seconds</name>
  15.                 <value>604800</value>
  16.         </property>
复制代码


  • 这里附上我的yarn-site.xml
  1. <?xml version="1.0"?><!--  Licensed 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. See accompanying LICENSE file.--><configuration><!-- Site specific YARN configuration properties -->        <!-- 指定 MR 走 shuffle -->        <property>                <name>yarn.nodemanager.aux-services</name>                <value>mapreduce_shuffle</value>        </property>        <!-- 指定 ResourceManager 的地点-->        <property>                <name>yarn.resourcemanager.hostname</name>                <!-- master-ubuntu须要改为为主节点呆板名-->                <value>linux-master</value>        </property>        <!-- 情况变量的继续 -->        <property>                <name>yarn.nodemanager.env-whitelist</name>                <value>JAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CO NF_DIR,CLASSPATH_PREPEND_DISTCACHE,HADOOP_YARN_HOME,HADOOP_MAPRED_HOME</value>        </property>        <!-- 开启日志聚集功能 -->
  2.         <property>
  3.                 <name>yarn.log-aggregation-enable</name>
  4.                 <value>true</value>
  5.         </property>
  6.         <!-- 设置日志聚集服务器地址 -->
  7.         <property>
  8.                 <name>yarn.log.server.url</name>
  9.                 <!-- IP地址为主节点机器地址 -->
  10.                 <value>http://192.168.10.75:19888/jobhistory/logs</value>
  11.         </property>
  12.         <!-- 设置日志保留时间为 7 天 -->
  13.         <property>
  14.                 <name>yarn.log-aggregation.retain-seconds</name>
  15.                 <value>604800</value>
  16.         </property>
  17. </configuration>
复制代码
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表