Wednesday, September 30, 2015

Running Greenplum database on OS X





I wanted to kick the tires of the Greenplum database today, as this is some exciting technology built my Pivotal. Recently, Greenplum has gone open source and I guess that the amount of work and changes that came with that meant the developers were more than a little busy. Either way, the way they suggest to install on a Mac (download dmg, open big tar file) did not work for me, and there is a much easier way

1 Using homebrew

Pivotal has its own tap, which you should install first:
brew tap pivotal/tap
brew install greenplum-db
Now go to System Preferences -> Sharing , and check "Remote Login".
You have to make sure you can login with ssh to your own machine, without typing any credentials.
cd ~
ssh-keygen -t rsa
cat .ssh/id_rsa.pub >> .ssh/authorized_keys
Now try it, you often have to type YES the first time
ssh $(hostname)   
You should be launched into a new prompt. Type 'exit' to return to your normal prompt.
Now we continue to initialize greenplum:
gpdbctl kernel
gpdbctl start
gpdbctl start

2 Issues with postgres

On another computer, we found that Greenplum insists on starting Postgres itself, while this machine autostarted postgres at boot. May be there are some settings to have it use a running postgres, but an easier way forward is to make sure that postgres is not running. Look at your `~/Libraries/LaunchAgents` and if `homebrew.*.postgres.plist` is in there, issue a command to not make it autostart:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
This change should be permanent.

3 Running multiple postgres instances

It is easy to start postgres a second time, as long as you use a different port. We used a second tool that also requires postgres and starting a second postgres, with a different datadir, was the easiest way forward we found.

No comments:

Post a Comment