hue4.0的安装和配置

依赖安装:
 
sudo yum install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain gcc gcc-c++ krb5-devel libffi-devel libxml2-devel libxslt-devel make mysql mysql-devel openldap-devel python-devel sqlite-devel  gmp-devel openssl-devel  

二、MySQL配置

1、    为root用户设置密码;
2、    配置远程登录
3、    创建hue数据库
4、    flush hosts
5、    flush privileges

三、解压、编译并安装

tar -zxvf hue-3.12.0.tgz -C /opt
cd /opt/ hue-3.12.0
make apps

四、集成环境配置

1、配置HDFS

vim /opt/hadoop-2.7.3/etc/hadoop/hdfs-site.xml

复制代码

     dfs.webhdfs.enabled
     true



     dfs.permissions.enabled
     false
复制代码

2、配置core-site.xml

vim /opt/hadoop-2.7.3/etc/hadoop/core-site.xml

复制代码

     hadoop.proxyuser.hue.hosts
      *



      hadoop.proxyuser.hue.groups
      *



       hadoop.proxyuser.root.hosts
       *
 

  
       hadoop.proxyuser.root.groups
        *
 
复制代码

3、配置yarn-site.xml

vim /opt/hadoop-2.7.3/etc/hadoop/yarn-site.xml

复制代码

    yarn.log-aggregation-enable
    true




     yarn.log-aggregation.retain-seconds
     259200
复制代码

4、配置httpfs-site.xml

vim /opt/hadoop-2.7.3/etc/hadoop/httpfs-site.xml

复制代码

    httpfs.proxyuser.hue.hosts
    *



    httpfs.proxyuser.hue.groups
    *
复制代码

5、配置文件同步

将以上配置文件同步到其他Hadoop主机

添加hue用户及用户组

sudo useradd hue
sudo chmod -R 755 /opt/hue-3.12.0/
sudo chown -R hue:hue /opt/hue-3.12.0/

五、Hue的配置

vim  /opt/hue-4.0/desktop/conf/hue.ini

1、配置HDFS超级用户

 # This should be the hadoop cluster admin
  default_hdfs_superuser=xfvm

超级用户参见HDFS WEBUI

hue4.0的安装和配置_第1张图片

 

2、配置desktop

复制代码
[desktop]

  # Set this to a random string, the longer the better.
  # This is used for secure hashing in the session store.
  secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn
  http_port=8888

  # Time zone name
  time_zone=Asia/Shanghai
复制代码

3、配置HDFS

复制代码
 [[hdfs_clusters]]
    # HA support by using HttpFs
    #namenode也可写namenode的IP 
    [[[default]]]
      # Enter the filesystem uri
      fs_defaultfs=hdfs://namenode:8020

      # NameNode logical name.
      ## logical_name=

      # Use WebHdfs/HttpFs as the communication mechanism.
      # Domain should be the NameNode or HttpFs host.
      # Default port is 14000 for HttpFs.
      webhdfs_url=http://namenode:50070/webhdfs/v1
复制代码

4、配置YARN

复制代码
   [[[default]]]
      # Enter the host on which you are running the ResourceManager
      resourcemanager_host=namenode

      # The port where the ResourceManager IPC listens on
      resourcemanager_port=8132
      #参考yarn-site.xml中的yarn.resourcemanager.address.rm1
      # Whether to submit jobs to this cluster
      submit_to=True

      # Resource Manager logical name (required for HA)
      ## logical_name=

      # Change this if your YARN cluster is Kerberos-secured
      ## security_enabled=false

      # URL of the ResourceManager API
      resourcemanager_api_url=http://namenode:8088
#参考yarn-site.xml中的yarn.resourcemanager.webapp.address.rm1
      # URL of the ProxyServer API
      proxy_api_url=http://namenode:8088
      #参考yarn-site.xml中的yarn.resourcemanager.scheduler.address.rm1
      #端口固定:8088
      # URL of the HistoryServer API
      #参考mapred-site.xml中的mapreduce.jobhistory.webapp.address
      history_server_api_url=http://namenode:19888
复制代码

5、配置HIVE

复制代码
[beeswax]

  # Host where HiveServer2 is running.
  # If Kerberos security is enabled, use fully-qualified domain name (FQDN).
  hive_server_host=hive服务端的IP

  # Port where HiveServer2 Thrift server runs on.
#默认hiveserver2端口
 hive_server_port=10000 
复制代码

6、配置zookeeper

复制代码
[zookeeper]

  [[clusters]]

    [[[default]]]
      # Zookeeper ensemble. Comma separated list of Host/Port.
      # e.g. localhost:2181,localhost:2182,localhost:2183
      host_ports=节点:2181,节点:2181,节点:2181
复制代码

7、配置MySQL

复制代码
 # mysql, oracle, or postgresql configuration.
    ## [[[mysql]]]
      # Name to show in the UI.
      nice_name="My SQL DB"

      # For MySQL and PostgreSQL, name is the name of the database.
      # For Oracle, Name is instance of the Oracle server. For express edition
      # this is 'xe' by default.
      name=mysqldb

      # Database backend to use. This can be:
      # 1. mysql
      # 2. postgresql
      # 3. oracle
      engine=mysql

      # IP or hostname of the database to connect to.
      host=安装mysql的IP

      # Port the database server is listening to. Defaults are:
      # 1. MySQL: 3306
      # 2. PostgreSQL: 5432
      # 3. Oracle Express Edition: 1521
      port=3306

      # Username to authenticate with when connecting to the database.
      user=root

      # Password matching the username to authenticate with when
      # connecting to the database.
      password=123456 
复制代码

   hue默认使用sqlite作为元数据库,不推荐在生产环境中使用这个数据库
使用mysql做元数据

1, 修改hue.ini文件
[[database]]
engine=mysql
host=
port=
user=<用户名>
password=<密码>

name=<数据库名称,新数据库,专门用于hue,里面现在没有任何表>在mysql中创建hue数据库

完成以上的这个配置,启动Hue,通过浏览器访问,会发生错误,原因是mysql数据没有被初始化
defaulterrorhandler
raise errorclass, errorvalue
DatabaseError: (1146, "Table 'hue.desktop_settings' doesn't exist")

2, 初始化数据库
2.1) bin/hue syncdb
2.2) bin/hue migrate

执行完以后,可以在mysql中看到,hue相应的表已经生成。

启动hue, 能够正常访问了


8、配置禁用组件(还未安装的组件)

# Comma separated list of apps to not load at server startup.
  # e.g.: pig,zookeeper
  app_blacklist=pig,hbase,spark,impala,oozie

 

六、Hive环境变量的配置(hiveserver2,使用Mysql作为独立的元数据库)

1、编辑hive-site.xml

复制代码

    hive.metastore.uris
    thrift://192.168.10.24:9083
    Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.
  

  
    hive.server2.thrift.bind.host
    192.168.10.24
    Bind host on which to run the HiveServer2 Thrift service.
  
复制代码

七、MySQL初始化

进入hue安装目录的/bin目录

./hue syncdb
./hue migrate

八、启动顺序

1、启动Hive metastore

$ bin/hive --service metastore &

2、启动hiveserver2

$ bin/hive --service hiveserver2 &

3、启动Hue

$bin/supervisor

4、浏览器:http://安装hue的IP:8888,输入用户名和密码即可登录

hue4.0的安装和配置_第2张图片


你可能感兴趣的:(大数据工作总结)