Greenplum Community Edition (SNE) V4 for OSX

VLDB’s own demo Greenplum MPP system is currently running v3.x of the Greenplum DBMS software, which we had planned to upgrade at some point soon. Pesky client projects always seem to get in the way 😉

Hang on a minute, we thought…we’ve got shiny new Apple MacBook Airs and Greenplum Community Edition (CE) v4 has just been released, so why not try Greenplum v4 out on Mac OSX. Why not indeed?

Greenplum Community Edition (formerly Greenplum Single Node Edition, or SNE) info is here:

http://www.greenplum.com/products/community-edition/

Greenplum Community Edition v4 can be downloaded here:

http://community.greenplum.com/

The Greenplum CE v4 installation on OSX was carried out using the install guide, plus the following excellent topic on the Greenplum community forum:

http://community.greenplum.com/forums/showthread.php?29-Installing-Greenplum-SNE-on-Mac-OS-X-10.5

You will need both!

Once installed, the Greenplum DBMS is started as usual in a terminal window on the Mac (snipped):

gpdemo:~ gpadmin$ gpstart

[INFO]:-Master Started…
[INFO]:-Successfully started 2 of 2 segment instances
[INFO]:-Starting Master instance gpdemo directory /gp/master/gp-1
[INFO]:-Command pg_ctl reports Master gpdemo instance active
[INFO]:-Database successfully started with no errors reported

The Postgres ‘psql’ SQL client connects to the ‘gpperfmon’ database interactively:

gpdemo:~ gpadmin$ psql gpperfmon

psql (8.2.14)

Type “help” for help.

To list the default databases installed:

gpperfmon=# \l

List of databases

Name | Owner | Encoding
———-+———+———-
gpperfmon | gpadmin | UTF8
postgres | gpadmin | UTF8
template0 | gpadmin | UTF8
template1 | gpadmin | UTF8

(4 rows)

To list the tables installed in the ‘gpperfmon’ database (snipped):

gpperfmon=# \d

List of relations

Schema | Name | Type | Owner | Storage
——-+————————–+——-+———+———-
public | _database_tail | table | gpadmin | external
public | _iterators_tail | table | gpadmin | external
public | _queries_tail | table | gpadmin | external
public | _segment_tail | table | gpadmin | external
public | _system_tail | table | gpadmin | external
public | database_history | table | gpadmin | heap
public | database_history_1_prt_1 | table | gpadmin | heap
public | master_data_dir | table | gpadmin | external
public | memory_info | view | gpadmin | none
public | queries_history | table | gpadmin | heap
public | queries_history_1_prt_1 | table | gpadmin | heap
public | system_now | table | gpadmin | external
public | system_tail | table | gpadmin | external

(42 rows)

To count the rows in a table:

gpperfmon=# select count(*) from system_now;

count
——-
1

(1 row)

To count the rows in a table non-interactively, exit interactive psql using ‘\q’ and run psql from the command prompt:

gpdemo:~ gpadmin$ psql gpperfmon -c ‘select count(*) from system_now;’

count
——-
1

(1 row)

To run the same SQL from a shell script and send the output to a log file:

gpdemo:sql gpadmin$ more system_now.sh

psql gpperfmon -f system_now.sql > system_now.log 2>&1

gpdemo:sql gpadmin$ more system_now.sql

select count(*) from system_now;

gpdemo:sql gpadmin$ ./system_now.sh

gpdemo:sql gpadmin$ more system_now.log

count
——-
1

(1 row)

The Postgres admin tool ‘PGAdmin’ was also downloaded, installed, configured and pointed at the newly-minted Greenplum Community Edition for OSX install.

Download PGAmin from here: http://www.pgadmin.org/download/

This took under 5 minutes from start to finish.

pgadmin v3 connecting first time to Greenplum Community Edition on Mac OSX

Conclusion: Greenplum Community Edition V4 – so far so good 🙂