Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download the MADlib binary
  2. Install the package at the OS level.
    • Postgres:
      • on OSX double click the installer package
      • on Redhat / CentOS run the following as root

        Code Block
        yum install <madlib_package> --nogpgcheck
    • Pivotal Greenplum Database:
      • on Redhat / CentOS run the following as gpadmin

        Code Block
        languagebash
        gppkg install <madlib_package>
  3. Ensure that the environment is setup for your database deployment and that the database is up and running.

    • Ensure that psql, postgres, and pg_config are in your path

      Code Block
      languagebash
      which psql
      which postgres 
      which pgconfig
    • Ensure that the database is started and running

      Code Block
      language

...

    • bash
      psql -c 'select version()'

      The above may need user/port/password setting depending on how the database has been configured.
       

  1. Run the MADlib deployment utility to install MADlib into each database that you want to use it in:

    • Postgres:

      Code Block
      languagebash
      /usr/local/madlib/bin/madpack -s madlib –p postgres install

      if if environment variables are defined. Otherwise use a fully defined connection string:

      Code Block
      languagebash
      /usr/local/madlib/bin/madpack -s madlib -p postgres -c [user[/password]@][host][:port][/database] install
    • Pivotal Greenplum Database:

      Code Block
      languagebash
      /usr/local/madlib/bin/madpack –p greenplum install

    The above may need user/port/password setting depending on how the database has been configured.

     For more information on madpack:

     

    Code Block
    languagebash
    /usr/local/madlib/bin/madpack --help

     

     

  2. Test your

    installation to validate proper

    installation

    • Postgres:

      Code Block
      languagebash
      /usr/local/madlib/bin/madpack -s madlib –p postgres install-check
    • Pivotal Greenplum Database:
       

      Code Block
      languagebash
      /usr/local/madlib/bin/madpack –p greenplum install-check

      The above may need user/port/password setting depending on how the database has been configured.

...

Compile From Source

Prerequisites

Requirements for installing MADlib:

  • gcc (For OSX, Clang will work for compiling the source, but not for documentation.)
  • An installed version of Pivotal HAWQ, Pivotal Greenplum Database 4.2+ or PostgreSQL Postgre (64-bit) 9.2+ with plpython support enabled. Note: plpython may not be enabled in PostgreSQL Postgres by default.

Installing MADlib

In the $MADLIB_ROOT (location of MADlib source) run the following commands

Code Block
languagebash
mkdir

...

 build 
cd build 
cmake .. 
make


Above, we built the executables in the the build folder. This can, however, be any user-named folder (henceforth called $BUILD_ROOT).

Deploying MADlib

Deploy MADlib into the database with MADlib package manager madpack located under $BUILD_ROOT/src/bin.

...

  • To install

    Code Block
    languagebash
    $BUILD_ROOT/src/bin/madpack -p postgres -c [user[/password]@][host][:port][/database] 

...

  • install
  •  To make sure that the installation is successful

    Code Block
    languagebash
    $BUILD_ROOT/src/bin/madpack -p postgres -c [user[/password]@][host][:port][/database] install-

...

  • check
  • For more information on the usage of madpack

    Code Block
    languagebash
    $BUILD_ROOT/src/bin/madpack --

...

  • help

Defining environment variables

The below variables will be automatically used by the madpack installer if no connection string is provided.1.

  1. User: PGUSER or USER (defaults to OS username)

...

  1. Password: PGPASSWORD (defaults to empty)

...

  1. Host: PGHOST (defaults to 'localhost')

...

  1. Database: PGDATABASE (defaults to OS username)

...

  1. Port: PGPORT (defaults to 5432)

An example of deploying MADlib using the environment variables:

Code Block
languagebash
export PGPORT=5430

...

export PGHOST=127.0.0.1

...

export PGDATABASE=madlibtest

...

$BUILD_ROOT/src/bin/madpack -p postgres install