HAWQ手动安装

article/2025/9/18 20:29:01

HAWQ手动安装及使用手册

1 HAWQ简介

HAWQ 是 Pivotal 设计的一个大规模并行 SQL 分析处理引擎,支持事务处理。HAWQ 将复杂的查询分割成简单的任何,并分发到并行处理系统中的处理单元执行。包括查询规划器、动态管道、前沿互联和查询执行优化器等等。提供最高级别的性能和可伸缩性。HAWQ 基于 Hadoop 架构是GPon HDFS。

 

2 准备

2.1 环境说明

1 HAWQ安装采用源码编译安装的方式.

2 Hadoop版本为hadoop-2.5.0-cdh5.3.3、hadoop-2.7.1

3 HAWQ安装参考地址:

https://cwiki.apache.org/confluence/display/HAWQ/Build+and+Install

2.1.1虚拟机里Linux系统版本

[root@localhost ranger-0.5.0-usersync]# cat /etc/issue | grep Linux

Red Hat Enterprise Linux Server release 6.5 (Santiago)

2.1.2 JDK版本

[root@localhost native]# java -version

java version "1.7.0_67"

Java(TM) SE RuntimeEnvironment (build 1.7.0_67-b01)

Java HotSpot(TM) 64-BitServer VM (build 24.65-b04, mixed mode)

3 安装

3.1安装依赖软件

 

#安装yum的文档(可选)

sed -i 's/tsflags=nodocs//g' /etc/yum.conf

 

#安装所有需要的软件

yum install -y epel-release && \

 yum makecache&& \

 yum install -y manpasswd sudo tar which git mlocate links make bzip2 \

 autoconf automakelibtool m4 gcc gcc-c++ gdb flex cmake gperf indent \

 libuuid-develkrb5-devel libgsasl-devel expat-devel libxml2-devel \

 perl-ExtUtils-Embed pam-devel python-develsnappy-devel \

 libyaml-devellibevent-devel bzip2-devel openssl-devel \

 openldap-develreadline-devel net-snmp-devel apr-devel \

 libesmtp-develxerces-c-devel python-pip json-c-devel \

 apache-ivyjava-1.7.0-openjdk-devel \

 openssh-clientsopenssh-server && \

 yum clean all

 

# 安装libcurl 7.45.0

mkdir -p /tmp/build/ && \

 cd /tmp/build&& curl -L "http://curl.haxx.se/download/curl-7.45.0.tar.bz2"-o curl-7.45.0.tar.bz2 && \

 tar -xjfcurl-7.45.0.tar.bz2 && cd curl-7.45.0 && \

 ./configure--prefix=/usr && make && make install && \

 rm -rf /tmp/build&& ldconfig

 

# 安装maven

curl -L"http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo"-o /etc/yum.repos.d/epel-apache-maven.repo && \

 yum install -yapache-maven && \

 yum clean all

 

# 为root配置ssh

ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa&& \

 cat~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && \

 chmod 0600~/.ssh/authorized_keys

 

# 为所有用户设置JAVA_HOME

echo "#!/bin/sh" > /etc/profile.d/java.sh&& \

 echo "exportJAVA_HOME=/etc/alternatives/java_sdk" >> /etc/profile.d/java.sh&& \

 chmod a+x/etc/profile.d/java.sh

注:centos,redhat版本需查看如下方式.

echo "export JAVA_HOME=/usr/java/latest">> /etc/profile.d/java.sh && chmod a+x /etc/profile.d/java.sh 

 

# 安装 boost 1.59

mkdir -p /tmp/build && \

 cd /tmp/build&& curl -L"http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.bz2"-o  boost_1_59_0.tar.bz2 && \

 tar -xjfboost_1_59_0.tar.bz2 && cd boost_1_59_0 && \

 ./bootstrap.sh&& ./b2 --prefix=/usr -q && ./b2 --prefix=/usr -q install&& \

 rm -rf /tmp/build

 

# 安装 bison 2.5.1

mkdir -p /tmp/build/ && \

 cd /tmp/build&& curl -L "ftp://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz"-o bison-2.5.1.tar.gz && \

 tar -xzfbison-2.5.1.tar.gz && cd bison-2.5.1 && \

 ./configure--prefix=/usr && make && make install && \

 rm -rf /tmp/build

 

#安装 thrift 0.9.2

mkdir -p /tmp/build && \

 cd /tmp/build&& curl -L"http://www.us.apache.org/dist/thrift/0.9.2/thrift-0.9.2.tar.gz" -othrift-0.9.2.tar.gz && \

 tar -xzfthrift-0.9.2.tar.gz && cd thrift-0.9.2 && \

 ./configure--prefix=/usr \

         --with-cpp=yes--with-boost=yes --with-qt4=no --with-csharp=no --with-java=no --with-erlang=no--enable-tests=no \

         --with-nodejs=no--with-lua=no --with-python=no --with-perl=no --with-php=no && \

 make &&make install && \

 rm -rf /tmp/build

 

#安装 protobuf 2.5.0

mkdir -p /tmp/build/ && \

 cd /tmp/build&& curl -L"https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2"-o protobuf-2.5.0.tar.bz2 && \

 tar -xjfprotobuf-2.5.0.tar.bz2 && cd protobuf-2.5.0 && \

 ./configure--prefix=/usr && make && make install && ldconfig&& \

 rm -rf /tmp/build

注:直接github版本需墙外操作,如不方便。可以搜索到protobuf-2.5.0的源码包再解压、编译

 

#安装 libhdfs3

mkdir -p /tmp/build && \

 cd /tmp/build&& git clone https://github.com/PivotalRD/libhdfs3.git . && mkdirbuild && cd build && \

 ../bootstrap--prefix=/usr && make && make install && ldconfig&& \

 rm -rf /tmp/build

 

#安装 python 模块

yum makecache && yum install -y postgresql-devel&& \

 pip --retries=50--timeout=300 install pg8000 simplejson unittest2 pycrypto pygresql pyyamllockfile paramiko psi && \

 pip --retries=50--timeout=300 install http://darcs.idyll.org/~t/projects/figleaf-0.6.1.tar.gz&& \

 pip --retries=50--timeout=300 installhttp://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz/download&& \

 yum erase -ypostgresql postgresql-libs postgresql-devel && \

 yum clean all

 

# 安装libyarn

RUN mkdir -p /tmp/build && \

 cd /tmp/build&& git clone --depth=1 https://github.com/apache/incubator-hawq.git .&& cd depends/libyarn && mkdir build && cd build&& \

 ../bootstrap--prefix=/usr && make && make install && ldconfig&& \

 rm -rf /tmp/build

 

#新增 gpadmin用户(root下不能运行HAWQ)

groupadd -g 1000 gpadmin && \

useradd -u 1000 -g 1000 gpadmin && \

echo "gpadmin ALL=(ALL)       NOPASSWD:ALL" > /etc/sudoers.d/gpadmin

 

# sudo 里关闭require tty

sed -i -e 's|Defaults   requiretty|#Defaults   requiretty|' /etc/sudoers

 

# 配置用户环境变量

echo "#!/bin/bash" > /etc/profile.d/user.sh&& \

 echo "exportUSER=\`whoami\`" >> /etc/profile.d/user.sh && \

 chmod a+x/etc/profile.d/user.sh

 

# 配置 gpadmin用户的ssh

 

ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa&& \

 cat~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && \

 chmod 0600~/.ssh/authorized_keys

 

3.2 配置操作系统参数

# 打开/etc/sysctl.conf,编辑如下内容

kernel.shmmax= 1000000000

kernel.shmmni= 4096

kernel.shmall= 4000000000

kernel.sem= 250 512000 100 2048

kernel.sysrq= 1

kernel.core_uses_pid= 1

kernel.msgmnb= 65536

kernel.msgmax= 65536

kernel.msgmni= 2048

net.ipv4.tcp_syncookies= 0

net.ipv4.ip_forward= 0

net.ipv4.conf.default.accept_source_route= 0

net.ipv4.tcp_tw_recycle= 1

net.ipv4.tcp_max_syn_backlog= 200000

net.ipv4.conf.all.arp_filter= 1

net.ipv4.ip_local_port_range= 1281 65535

net.core.netdev_max_backlog= 200000

vm.overcommit_memory= 2

fs.nr_open= 3000000

kernel.threads-max= 798720

kernel.pid_max= 798720

#increase network

net.core.rmem_max=2097152

net.core.wmem_max=2097152

#执行如下命令生效:

sysctl -p

 #打开/etc/security/limits.conf编辑如下内容

*soft nofile 2900000

*hard nofile 2900000

*soft nproc 131072

*hard nproc 131072

3.3 安装hadoop

详见hadoop手动安装手册.

3.4 编译安装HAWQ

# The Apache HAWQ source code can be obtained from thethe following link: 

# Apache Repo: https://git-wip-us.apache.org/repos/asf/incubator-hawq.git or 

# GitHub Mirror: https://github.com/apache/incubator-hawq.

git clonehttps://git-wip-us.apache.org/repos/asf/incubator-hawq.git

 

# 切换到hawq源码目录

cd /root/incubator-hawq

 

# 执行生成makefile命令

./configure

 

# Or you could use--prefix=/hawq/install/path to change the Apache HAWQ install path, 

# and you can also add some optionalcomponents using options (--with-python --with-perl)

./configure --prefix=/hawq/install/path --with-python--with-perl

 

# You can also run the command with--help for more configuration.

./configure --help

 

#Note: If ./configure complainsthat libyarn is missing, it is provided under ./depends/libyarn. 

# Please follow the above steps toinstall libyarn. You may need to run "ldconfig -p <PATH>" afterlibyarn is installed.

注:以上可选

 

 

# 执行编译和安装

# To build concurrently , run makewith -j option. For example, make -j8

# On Linux system without largememory, you will probably encounter error like

# "Error occurred duringinitialization of VM" "Could not reserve enough space for objectheap";

# Try to set vm.overcommit_memory =1 temporarily, and/or avoid "-j" build, and/or add more memory andthen rebuild.

# On mac os, you will probably seethis error: "'openssl/ssl.h' file not found".

# "brew link openssl--force" should be able to solve the issue.

make -j8

  

# 安装HAWQ

make install

3.4 安装问题

暂无.

4 配置

4.1 HAWQ的参数配置

配置HAWQ的集群及其它参数

cd /usr/hawq/etc

vi hawq-site.xml

# 修改如下参数

参数名

示例值

hawq_master_address_host

shenl

hawq_dfs_url

shenl:8020/hawq_default

hawq_rm_memory_limit_perseg

64GB

hawq_rm_yarn_address

shenl:8032

hawq_rm_yarn_scheduler_address

shenl:8030

 

su -gpadmin

cd usr/hawq/bin

source ../greenplum_path.sh

./hawqinit cluster  

# 启动hawq

hawqstop/restart/start cluster

 

5 使用

5.1 HAWQ基本功能验证

主要验证:

SQL基本功能

事务支持

存储过程支持

性能测试

1) SQL基本功能验证

./psql -d postgres

create table t ( i int );

insert into t values(1);

insert intot select generate_series(1,10000);

select count(*) from t;

 

 

2)事务支持验证

思路:

在一个客户端里执行DML操作,没commit之前在另外个客户端里查查询表记录

具体验证:

# 会话一中执行DML事务操作,先不提交

 

# 会话二中执行查询操作

 

# 待会话一执行commit;后再在会话二中执行查询操作

 

3)存储过程支持验证

create or replace functionsetPassengerType(num integer) returns varchar as

    $$

    begin

         insert into t values(num);

         return 'Okay';

    end

    $$

language plpgsql;

 

select setPassengerType(100);

 

4)性能测试验证

待完善

6 总结

仔细跟踪log,具体问题具体分析.


http://chatgpt.dhexx.cn/article/EyqdrSJO.shtml

相关文章

HAWQ上安装PXF插件,并访问HDFS文件数据

1、说明 HAWQ在github上的地址为&#xff1a;https://github.com/apache/hawq 在安装pxf插件之前&#xff0c;可以先查看一下基础软件对应的版本信息&#xff1a;在hawq目录下的pxf/gradle.properties文件中 因我在安装pxf之前&#xff0c;已经把hadoop及hawq安装完&#xff…

HAWQ技术解析(五) —— 连接管理

服务器启动后&#xff0c;还要经过一系列配置&#xff0c;才能被客户端程序所连接。本篇说明如何配置客户端身份认证&#xff0c;HAWQ的权限管理机制&#xff0c;HAWQ最常用的命令行客户端工具psql及与mysql命令行常用命令类比&#xff0c;最后还将列举一些客户端连接HAWQ数据库…

HAWQ-V3: Dyadic Neural Network Quantization论文学习

论文链接 https://arxiv.org/abs/2011.10680 摘要 目前的低精度量化算法往往具有从浮点值到量化整数值的来回转换的隐藏代价。这种隐藏的成本限制了通过量化神经网络所实现的延迟改进。为了解决这个问题&#xff0c;我们提出了HAWQ-V3&#xff0c;一个新的混合精度纯整数量化框…

HAWQ取代传统数仓实践(一)——为什么选择HAWQ

一、HAWQ取代传统数仓实践&#xff08;一&#xff09;——为什么选择HAWQ 为了跟上所谓“大数据”技术的脚步&#xff0c;从两年前开始着手实践各种SQL-on-Hadoop技术&#xff0c;从最初的Hive&#xff0c;到SparkSQL&#xff0c;再到Impala&#xff0c;进行了一系列ETL、CDC、…

在centos 7.3上进行Apache HAWQ集群安装部署

一、前期准备工作 1、准备三台物理机&#xff0c;master&#xff08;192.168.251.8&#xff09;,dataserver1&#xff08;192.168.251.9&#xff09;,dataserver2&#xff08;192.168.251.10&#xff09;&#xff1b; 2、目前最新版本是2.4.0&#xff0c; 官网下载地址&…

HAWQ

为了跟上所谓“大数据”技术的脚步&#xff0c;从两年前开始着手实践各种SQL-on-Hadoop技术&#xff0c;从最初的Hive&#xff0c;到SparkSQL&#xff0c;再到Impala&#xff0c;进行了一系列ETL、CDC、多维数据仓库、OLAP的实验。作为一名从业20年以上的DBA&#xff0c;从数据…

HAWQ技术解析(三) —— 基本架构

HAWQ是一个Hadoop原生的SQL查询引擎&#xff0c;它结合了MPP数据库的关键技术和Hadoop的可扩展性。HAWQ在原生的HDFS上读写数据&#xff0c;MPP架构使HAWQ表现出超越其它SQL on Hadoop解决方案的查询性能&#xff0c;Hadoop又为HAWQ提供了传统数据库所不具备的线性扩展能力。 一…

HAWQ技术解析(十三) —— 资源管理

一、HAWQ如何管理资源 HAWQ使用多种机制管理CPU、内存、I/O、文件句柄等系统资源&#xff0c;包括全局资源管理、资源队列、强制资源使用限额等。 1. 全局资源管理 Hadoop通常使用YARN全局管理资源。YARN是一个通用的资源管理框架&#xff0c;为MapReduce作业或其…

HAWQ个人学习笔记(一)——HAWQ介绍

一、什么是HAWQ&#xff1f; HAWQ是Hadoop原生SQL查询引擎&#xff0c;针对分析性的应用。它具有大规模并行处理很多传统数据库以及其他数据库没有的特性及功能&#xff0c;结合了MMP数据库的关键技术优势和Hadoop的可扩展性和便利性。读写依赖于HDFS。 注&#xff1a;Hadoop…

全面讲解光纤、光模块、光纤交换机、光模块组网设计与案例

光纤组网已是当今建筑智能化弱电行业里一种常见的组网方式&#xff0c;组建远距离无线、监控网络时&#xff0c;往往需要使用光纤进行连接通信&#xff0c;使用光纤收发器是经济适用型做法&#xff0c;尤其是在室外的使用。其实光纤收发器不仅可以成对使用&#xff0c;还可以配…

400G光模块的相关知识

现在的高速光模块市场慢慢从100G向400G转移&#xff0c;未来400G必定是主流的高速光模块&#xff0c;目前这个阶段占领主流的还是100G&#xff0c;之前100G的相关知识已经讲述过了&#xff0c;400G与100G的传输速率由各种因素导致&#xff0c;我们讲讲400G与100G的信号传输。 4…

QSFP28-100G-LR4光模块有什么特点及优势?

100G以太网的迅速发展给100G光模块带来了巨大的市场需求&#xff0c;在众多100G光模块中&#xff0c;QSFP28光模块以其较小的尺寸和低功耗的特点成为最受欢迎的光模块。下面易天光通信&#xff08;ETU-LINK&#xff09;将从定义&#xff0c;工作原理&#xff0c;应用场景和常见…

DWDM光模块和CWDM光模块的区别

DWDM光模块和CWDM光模块的区别 近年来波分复用(WDM)技术受到网络用户的热烈欢迎,这是一种在单根光纤上复用不同波长激光的多个光载波信号的技术。下文将由亿创飞宇光通信重点介绍CWDM SFP光模块和DWDM SFP光模块。 DWDM光模块是什么?DWDM光模块有哪些主要优势? DWDM光模…

SC接口光模块相关知识

什么是SC接口光模块&#xff1f; SC接口光模块即接口类型为SC的光模块&#xff0c;必须搭配SC接口的跳线才能正常使用。SC光模块的接口的紧固方式是采用插拔销闩式&#xff0c;不须旋转&#xff0c;使用很方便。 SC光模块的分类 SC光模块相比LC光模块和MPO光模块…

全面解析光模块的应用场景

光模块主要应用于数据通信领域&#xff0c;它的功能是实现光电信号的相互转化。因为大数据、区块链、云计算、物联网、人工智能、5G的兴起&#xff0c;使得数据流量迅猛增长&#xff0c;数据中心以及移动通信的光互连成为了光通信行业的研究热点。接下来&#xff0c;易天光通信…

单波100G光模块与4路100G光模块相比,优势有哪些?

目前市场上大多数的100G光模块都是采用4路25Gb/s并行或者波分复用进行传输的&#xff0c;比如100G SR4、100G PSM4、100G LR4、100G CWDM4光模块等&#xff0c;为了降低成本以及更好的传输效率&#xff0c;业界提出了100G single-lambda规范&#xff0c;这个规范是指使用PAM4光…

光模块-寿命分析

光模块结构分类基本指标光模块的使用寿命光模块的三种失效率预计方法基本概念失效率预计 可靠性分析可靠性试验加速寿命试验方法阿伦尼兹(Arrhenius)模型逆幂律模型单应力的艾林(Eyring)模型 光模块加速寿命试验分析方法研究 光模块 光模块是进行光电和电光转换的光电子器件。…

5G通信光模块是什么?5G通信光模块的发展方向如何?

随着移动通信行业的迅猛发展&#xff0c;目前5G已经成为全球关注的超级热门话题&#xff0c;与2G、3G、4G相比&#xff0c;未来光纤通信行业5G地位不容小觑&#xff0c;在5G网络时代&#xff0c;不管什么样的5G承载方案都离不开5G通信光模块&#xff0c;那么5G通信光模块是什么…

100G多模光模块介绍及应用

随着光通信市场对数据传输速率的要求越来越高&#xff0c;更高速率的光模块也随之诞生。与10G、40G的波分传输系统相比&#xff0c;100G光传输实现了偏振复用相位调制技术、数字相干接收技术第三代超强纠错编码技术等一系列重大改革&#xff0c;满足了用户与时俱进的需求。本期…

linux 光功率 模块_【光电通信】10G 光模块消光比补偿方法

今日光电 有人说,20世纪是电的世纪,21世纪是光的世纪;知光解电,再小的个体都可以被赋能。欢迎来到今日光电! ----与智者为伍 为创新赋能---- 0. 引言 随着光纤到户、4G 业务的高速发展,光通信行业对高速光模块的需求也越来越大,这也对光模块厂商产能提出了新的挑…