How to Build
Option 1 (with pre-built docker image)
Follow the steps on: https://hub.docker.com/r/mayjojo/hawq-devel/
Option 2 (build the dependencies by yourself)
OS requirement
Linux ( tested on redhat 6.x).
Dependencies
There are several dependencies (see the following table) you must install before building HAWQ. To build Apache HAWQ, gcc and some dependencies are needed. The libraries are tested on the given versions. Most of the dependencies can be installed through yum. Other dependencies should be installed through the source tarball. Typically you can use "./configure && make && make install" to install from source tarball.
Libraries that must be installed using source tarball.
Name | Version | Download URL |
---|---|---|
| 0.9 | |
|
| http://sourceforge.net/projects/boost/files/boost/1.56.0/boost_1_56_0.tar.bz2 |
|
| http://archive.apache.org/dist/thrift/0.9.1/thrift-0.9.1.tar.gz |
|
| https://github.com/google/protobuf/tree/v2.5.0 |
|
| http://www.curl.haxx.se/download/curl-7.44.0.tar.gz |
|
| https://github.com/PivotalRD/libhdfs3.git |
|
|
Libraries that can be installed through yum.
Name | Versoin |
---|---|
epel-release | 6-8 |
make |
|
gcc |
|
gcc-c++ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Get code and build HAWQ
- The Apaceh HAWQ source code can be obtained from the GitHub: https://github.com/apache/incubator-hawq.
- Get source code
- The code directory is CODEHOME/incubator-hawq. Then cd CODEHOME/incubator-hawq and build Apache HAWQ under this directory.
- Run command to generate makefile.
- ./configure
- Or you could use --prefix=/hawq/install/path to change the Apache HAWQ install path.
- ./configure --prefix=/hawq/install/path
- You can also run the command with --help for more configuration.
- ./configure --help
- Run command to build
- make
- To build concurrently , run make with -j option.
- make -j8
- make -j8
Install HAWQ
- To install Apache HAWQ, run command
- make install
Test In HAWQ
- Unit test. To do unit test, go to the src/backend and run unittest.
- cd src/backend
- make unittest-check
- Installcheck-good test. After installing HAWQ, please ensure HDFS work before initializing HAWQ.
- source /install/dir/greenplum_path.sh
- hawq init cluster
- make installcheck-good
- source /install/dir/greenplum_path.sh
Install YARN (Optional)
If you want to integrate with YARN for resource management, you need to install YARN first.
Init and Start/Stop Apache HAWQ
- Before initializing HAWQ, you need to install HDFS and make sure it works
- source /install/dir/greenplum_path.sh
- hawq init cluster (after initialization, HAWQ is started by default)
- Now you can stop/restart/start the cluster by using: hawq stop/restart/start cluster
Connect and Run basic queries
- psql -d postgres
- create table t ( i int );
- insert into t values(1);
- select * from t;