PT3 on a Mac / Postgres on a server

General discussion of PokerTracker 3.

Moderator: Moderators

PT3 on a Mac / Postgres on a server

Postby grt2001 » Tue Sep 15, 2009 5:14 pm

Hello,

I decided I wanted to change my setup of PT3 and PostgreSQL, to make it more suitable to my preferences and optimize the use of my hardware, and after a number of tries I finally did manage to get it working. I thought I'd share my experience with the forum. Most of the information here is already available on this forum - I just thought it would be useful to have everything in one place (and I will certainly benefit from it if something breaks and I would have to go through the process all over again).


So – this was on my wish list:

1. Get Postgres running on a server
2. Move my existing database to this server
3. Install PT3 on a macbook
4. Have PT3 connected to the postgres server
5. Play some hands of poker :-)

Let me tell you what I did and my reasoning behind it, as well as which issues I encountered and how I resolved them.

First a little prehistory: I had already managed to install PT3 and Postgres on a single machine running XP. I did the basic installation of PT3 3.00 build 5.2 with Postgres 8.3. I installed Postgres on localhost and was happy. As this pc had two hard drives I thought I would give it a try to move the PT database to the secondary hard drive, keeping everything else the same. I was looking to get a performance boost, and I got it, even if only a slight one.

The instructions on how to move the database are in this post: PT3 performance tuning 2 HDDs viewtopic.php?f=15&t=12136&hilit=performance+2+hdd.
The main info is in the second post by Kraada. The current command to use was "psql to 'postgres' and I wasn't using Vista so I ignored the comments related to that, and basically followed all other steps to the letter. And hey presto – it failed. It turned out I had failed to set the correct permissions on the created file and directories. After I had corrected my mistake it worked as advertised. Very nice.

Then, since I recently managed to 'revive' my macbook I decided to take the plunge and move to a more networked setup. (As you might already guessed, I can't really claim to believe in “if it ain't broke, don't fix it”) Hence my wish list from above and here the story continues:


Step 1: Get Postgres running on a server

For the server setup I decided (for now) I would keep things simple. I already had Postgres running on the XP box and it worked fine, so I decided all I needed to do was change the postgres setup in such a way that the database would be available on my local network.

This post basically describes the steps: How To: Network PostgreSQL Database. See: http://www.pokertracker.com/forums/viewtopic.php?f=45&t=4638

So how hard could it be? Well, not too bad actually.

My network is set up as follows:

Linuxbox for contact to the outside world, running DHCP from adress 192.168.1.1
DNS etc are pretty standard settings which I setup from the info my provider supplied.

All clients are setup to get their IP's from the DHCP.

My XP box has 192.168.1.11 and my Macbook hails from 192.168.1.13 (never mind why).

So I used the postgres tools to make some changes to the server setup.

I edited pg_hba.conf to allow access from my network by adding the line:
host all all 192.168.1.0/24 md5


I then added the following line to postgresql.conf:

listen_addresses = '*'


Nothing more to do, so we're ready for the next step.


Step 2: Move my existing database to this server

This is where I cheated. As I was running my database server from my original standalone pc, so I didn't need to move anything :-)

Now I imagine, you do a fresh installation of a server, you might need to move your database over. Or create a new one and import hands. The FAQs on these topics are available elsewhere. Next step.


Step 3: Installing PT3 on a Macbook

So I guess this is the tricky one, at least until the Mac version is released. Right now, if we want to run a windows app on a mac we need either Boot Camp or some other solution. I used Parallels Desktop. This allows you to create a virtual environment within which you can run non-native OS's. I preferred that over Boot Camp, since the macbook is now going to be my main machine, I didn't want to reboot into XP every time I wanted to play a game.

I used XP, just for the reason I already had the disks for that and more importantly, the licence. (I avoided Vista – mainly for performance reasons, but also because I'm more familiar with XP, but it should work just as well).

So, installed Parallels and created a virtual machine and installed XP. So far so good. Then installed PT3 and postgres. Set Firewall permissions to allow both full access. And tried to connect to my server. Which failed. Which brings us to:

Step 4: Have PT3 connected to the postgres server

When prompted with the database setup screen after starting PT3, I had changed the “localhost” to 192.168.1.11 (the xp server box's address in my network) and I was pretty sure I had used the correct password.

So why did it fail? I got the pretty generic error:

"Connection to database failed: could not connect to server:
Connection refused (0x0000274D/10061)
Is the server running on host "???" and accepting TCP/IP connections on port 5432?"


Mmm. Maybe it isn't running or something is blocking traffic? I went back to the server and checked the firewall settings there. Everything was as it should be. Outside access was allowed. I checked the services and Postgres was running.

So I went back to my macbook and checked the configuration there. Ah – Parallels Desktop was showing me I had set it to “Shared Networking” and it should be “Bridged Networking” as I want the XP virtual machine to act as a separate pc client for the postgres server. So I set it to bridged. My DHCP server gave it IP 192.168.1.12 which was fine. It should now connect as it is in the trusted network – but again it didn't. Same error.

So maybe a port issue? I scanned the ports on the xp box and found I could NOT access/see 5432.

I went back into the config files I had changed in step 1 and found this:

# listen_addresses = '*'

where it should say

listen_addresses = '*' (without the # which makes everything after it a comment).


Fixed that: easily overlooked – I had changed the existing relevant line in the file myself – if I had just copied and pasted the line mentioned in the FAQ I wouldn't have run into this issue. So I checked the connection again: Success!!! So on to:

Step 5: Play some hands of poker


:D :D :D

(that is, after I get my Hud back the way I like it and maybe next I'll decide to change my server setup and run Ubuntu...)


I hope some of you have found this info useful. Thanks for reading and see you at the tables!

Cheers,
Geert
grt2001
 
Posts: 34
Joined: Mon Mar 03, 2008 1:52 pm

Re: PT3 on a Mac / Postgres on a server

Postby WhiteRider » Wed Sep 16, 2009 3:44 am

Thanks - that's really useful!

I'll add a link to this from the Database / Postgres FAQ (which, for reference, is where the links referred to above are listed).
WhiteRider
Moderator
 
Posts: 53961
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to General [Read Only]

Who is online

Users browsing this forum: MagPie Crawler and 17 guests

cron
highfalutin