Quick Start Guide for Apache Hawq[作者:盛想]


Apache HAWQ became an Apache open source project several weeks ago. Today I will introduce how we install and start Apache HAWQ.


Basic Requirements

Basic requirements has two parts, basic environments and some dependencies.


The first thing is to get a redhat 6.5 server and install the development tools during the setup of the system.


There are some dependencies you must install before the compiling. You should compile the libraries’ and install the libraries. Most libraries should compile and install to your system using the basic several steps :

       cd $LIBRARY_CODE_HOME

      ./configure

       make

Become root user and run :

      make install


This way would install the libraries` headers to /usr/local/include and libraries file to /usr/local/lib or /usr/local/lib64. If you want to install the libraries in another place, you can use the --prefix=/the/path option when you run configure. For example:

      ./configure --prefix=/the/path/you/want

But don`t forget to add the /the/path/you/want to your LD_LIBRARY_PATH in case of HAWQ cannot find the libraries while compiling.


We have a libraries list that you should install before compile HAWQ. The list contains the library name , version and download url.


NameVersionDownload Url
gperf3.0.4http://ftp.gnu.org/gnu/gperf/gperf-3.0.4.tar.gz
snappy1.1.3https://github.com/google/snappy/releases/download/1.1.3/snappy-1.1.3.tar.gz
bzip21.0.6http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
python2.6.2https://www.python.org/ftp/python/2.6.2/Python-2.6.2.tgz
libevent1.4.6https://github.com/downloads/libevent/libevent/libevent-1.4.6-stable.tar.gz
json-c0.9http://oss.metaparadigm.com/json-c/json-c-0.9.tar.gz
krb51.11.3http://web.mit.edu/kerberos/dist/krb5/1.11/krb5-1.11.3-signed.tar
libuuid2.26.2http://mirrors.163.com/centos/6.7/os/x86_64/Packages/libuuid-devel-2.17.2-12.18.el6.x86_64.rpm
libgsasl1.8.0ftp://ftp.gnu.org/gnu/gsasl/libgsasl-1.8.0.tar.gz
libxml22.7.8http://xmlsoft.org/sources/libxml2-2.7.8.tar.gz
zlib1.2.3http://zlib.net/fossils/zlib-1.2.3.tar.gz
readline6ftp://ftp.gnu.org/gnu/readline/readline-6.0.tar.gz
openssl0.9.8ftp://ftp.openssl.org/source/openssl-0.9.8ze.tar.gz
protobuf2.5.0https://github.com/google/protobuf/tree/v2.5.0
boost1.56http://sourceforge.net/projects/boost/files/boost/1.56.0/boost_1_56_0.tar.bz2
bison2.5http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz
thrift0.9.1-1http://archive.apache.org/dist/thrift/0.9.1/thrift-0.9.1.tar.gz
apr1.2.12http://archive.apache.org/dist/apr/apr-1.2.12.tar.gz
libyaml0.1.1http://pyyaml.org/download/libyaml/yaml-0.1.1.tar.gz
curl7.44.0http://www.curl.haxx.se/download/curl-7.44.0.tar.gz
flex2.5.35http://sourceforge.net/projects/flex/files/flex-2.5.35.tar.gz/download
libhdfs3   git clone https://github.com/PivotalRD/libhdfs3.git 
Install libhdfs3 follow the steps specified in README.md


Get Source Code

The Apache HAWQ source code can be obtained from Github. Click "Read More" in the bottom of this article to view the source code of HAWQ on Github. You could get the source code using git clone :

      git clone https://github.com/apache/incubator-hawq.git


Install Procedure

The source code includes libyarn under $HAWQ_CODE_HOME/depends directory. And you need to compile and install it by hand. Change directory to libyarn folder and read README

      cd $HAWQ_CODE_HOME/depends/libyarn/

To build libyarn, some libraries listed in the README are needed. You should install the libraries first and compile libyarn follow the steps specified in the README.


The first step of the building is to check whether you have installed all the dependencies. This is done by running the configure script.This script will run a number of tests to determine values for various system dependent variables and finally create the makefile. For a default installation simply run:

      ./configure

You could use --prefix=/hawq/install/path to change the HAWQ install path. Otherwise HAWQ would be install to /usr/local/ .


After finished configure, you can start to build HAWQ.To start the build, run:

      make

To build concurrently, run make with -j option.For example :

      make -j8

The build will take a few minutes depending on your hardware. The last line displayed should be:

      All of HAWQ successfully made. Ready to install.

Become root user and run :

      make install

You have installed HAWQ to your system !


Start Apache HAWQ

Since HAWQ bases on HDFS, you should ensure HDFS work before we init HAWQ. You could refer details from : http://hawq.docs.pivotal.io/docs-hawq/topics/InstallingHAWQ.html#preparingtoinstallhawq.


Now you can init and start HAWQ.

      cd $APACHE_HAWQ_HOME

      source greenplum_path.sh

      hawq init cluster

Once you have inited successful, you can start HAWQ using:

      hawq start cluster

To enter the database:

      psql -d postgres


You can run the create database query to test that HAWQ is running:

[gpadmin@localhost ~]$ psql -d postgres

psql (8.2.15)

Type "help" for help.

postgres=# create database tpch;

CREATE DATABASE

postgres=# \c tpch

You are now connected to database "tpch" as user "gpadmin".

tpch=# create table t(i int);

CREATE TABLE

tpch=# \timing

Timing is on.

tpch=# insert into t select generate_series(1,100);

INSERT 0 100

Time: 166.311 ms

tpch=# select count(*) from t;

count

-------

100

(1 row)

Time: 127.698 ms


Basic Operations

When you want to stop hawq cluster, run:

      hawq stop cluster

Or to restart the cluster:

      hawq restart cluster

The usage of command hawq is

      hawq <command> [<object>] [options]

The most commonly used hawq "commands" are:

      start              Start hawq service

      stop              Stop hawq service

      init                 Init hawq service

      restart           Restart hawq service

The object are:

      cluster            Operate hawq cluster.

      master            Operate hawq master.

      segment         Operate local segment node.

      standby          Operate hawq standby.

      allsegments    Operate all segments.

If you want to know all the hawq command , just run hawq or hawq --help. You can find all the usage of hawq command.


资源下载链接为: https://pan.quark.cn/s/3d8e22c21839 随着 Web UI 框架(如 EasyUI、JqueryUI、Ext、DWZ 等)的不断发展与成熟,系统界面的统一化设计逐渐成为可能,同时代码生成器也能够生成符合统一规范的界面。在这种背景下,“代码生成 + 手工合并”的半智能开发模式正逐渐成为新的开发趋势。通过代码生成器,单表数据模型以及一对多数据模型的增删改查功能可以被直接生成并投入使用,这能够有效节省大约 80% 的开发工作量,从而显著提升开发效率。 JEECG(J2EE Code Generation)是一款基于代码生成器的智能开发平台。它引领了一种全新的开发模式,即从在线编码(Online Coding)到代码生成器生成代码,再到手工合并(Merge)的智能开发流程。该平台能够帮助开发者解决 Java 项目中大约 90% 的重复性工作,让开发者可以将更多的精力集中在业务逻辑的实现上。它不仅能够快速提高开发效率,帮助公司节省大量的人力成本,同时也保持了开发的灵活性。 JEECG 的核心宗旨是:对于简单的功能,可以通过在线编码配置来实现;对于复杂的功能,则利用代码生成器生成代码后,再进行手工合并;对于复杂的流程业务,采用表单自定义的方式进行处理,而业务流程则通过工作流来实现,并且可以扩展出任务接口,供开发者编写具体的业务逻辑。通过这种方式,JEECG 实现了流程任务节点和任务接口的灵活配置,既保证了开发的高效性,又兼顾了项目的灵活性和可扩展性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值