Difference between revisions of "User:Mgpalmer"

From MythTV Official Wiki
Jump to: navigation, search
(add To Do list)
m (add To Do list)
Line 58: Line 58:
 
* RAID-5 NAS for more robust storage
 
* RAID-5 NAS for more robust storage
 
* Dedicated FE for office, to include display panel & remote
 
* Dedicated FE for office, to include display panel & remote
 +
* Gigabit LAN equipment
 
=Moving my mythconverg to a remote MySQL server=
 
=Moving my mythconverg to a remote MySQL server=
 
Just for grins and skills I decided to set up a remote Linux server on which to run MySQL. Here are the things I did to get this working. This is Fedora centric, as MythDora is built on Fedora.
 
Just for grins and skills I decided to set up a remote Linux server on which to run MySQL. Here are the things I did to get this working. This is Fedora centric, as MythDora is built on Fedora.

Revision as of 15:18, 18 February 2008

My mythtv software system is MythDora 4.0.

Hardware Systems

I have three systems now involved in my mythtv setup. The primary system is a combined backend/frontend running MythDora 4.0. In addition to this one I have a remote frontend only built from Jarod Wilson's guide, and a general support system serving (for mythtv) NFS and MySQL (on which mythconverg is running).

Main Frontend/Backend

As of May 2007 my primary system is a combined backend/frontend running on:

  • Biostar NVIDIA GeForce 6100-M9
  • AMD64 x2 4200
  • 1 GB PC3200 DDR (2x 512MB modules in dual channel mode)

I've reduced the storage to a single drive:

  • 500 GB Seagate SATA/300 HD - I'm running LVM and xfs on my /storage partition preallocating 512 MB for files with good success so far.

For capturing content I have two tuners:

  • Hauppauge PVR500 dual analog tuner card
  • AverMedia A180 dvb - viewing ATSC on DirecPath

The A180 captures the few digital channels present on my cable (see below). The PVR500 works out great since I have quite limited space for PCI cards. The user interface includes:

  • MCE USB remote (bundled with PVR500)
  • Logitech Cordless Desktop EX110 (mouse & keyboard)
  • ViewSonic N3751w 37" LCD display
  • Yamaha HTR-5835 DTS 5.1

Remote Front End

My wife's computer in our home office is dual boot Windows XP Pro and Fedora 7 Linux. The Fedora 7 system is set up primarily for mythtv use, and was set up using Jarod Wilson's excellent instructions. Only minor deviations from his instructions were necessary.

The hardware includes

  • Biostar NVIDIA GeForce 6100-M9
  • AMD64 3800
  • 1 GB PC3200 DDR (2x 512MB modules in dual channel mode)

(Yes, the same as my primary backend, so it also serves as backup hardware.)

General Server

NFS

My MythDora system mounts the following from NFS:

/storage/dorabackup/
/storage/music/
/storage/pictures/
/storage/posters/
/storage/videos/

Local storage on my MythDora system is limited to only the /storage/recordings directory. In future I plan to move the recordings also to remote storage. Required to do this is to upgrade to a 1 GigE switch and a dedicated NAS box (probably based on FreeNAS).

MySQL

My MySQL database is running on a remote server now. Details below.

My Digital Content

Channels

The digital channels I'm able to receive currently include:

  • 2-1 WSB-DT
  • 5-1 WAGA-HD Fox
  • 11-1 WXIA-DT
  • 46-1 WGCL-HD

Quality

These channels come on my DirecPath wire as ATSC encodings.

5-1 which is the HD content from Fox 5 Atlanta stutters badly. There are significant audio and video drop outs every few seconds that make the programming nearly unwatchable. This is true also for 5-2 which is the ATSC SD channel for Fox 5. These drop outs are visible also when watching these channels with the TV's built in tuner. These drop outs do not appear on any other channel. Nothing I've done so far improves the situation.

Otherwise the video recordings from digital content are a dramatic improvement over the analog content.

To Do

Things I'd like to do next:

  • Separate the main system using a mini hardware setup for FE
  • RAID-5 NAS for more robust storage
  • Dedicated FE for office, to include display panel & remote
  • Gigabit LAN equipment

Moving my mythconverg to a remote MySQL server

Just for grins and skills I decided to set up a remote Linux server on which to run MySQL. Here are the things I did to get this working. This is Fedora centric, as MythDora is built on Fedora.

One advantage to having the database on a remote system is that it does not page out to disk when mythtv hogs all the RAM.

Setup MySQL

First, set up the database server machine. Install MySQL. It looks like mythtv-0.21 will be dropping MySQL v3 and v4 support. Ensure you use v5 of MySQL.

After installing, set mysqld to run at boot time, and turn it on now:

# chkconfig mysqld on
# service mysqld start

Then change the root password for MySQL:

# mysql -u root mysql
mysql> update user set Password=PASSWORD('ROOT_PWD') where user='root';
mysql> flush privileges;
mysql> quit

Get a copy of mc.sql from your mythtv machine. I found mine at

/usr/share/doc/mythtv-docs-0.20.2/database/mc.sql

Then put it in the database with

$ mysql -u root -p < /your/path/to/mc.sql

(This will prompt you for the mysql-root password.)

Add a mythtv user to your mysql install. http://dev.mysql.com/doc/refman/5.0/en/adding-users.html

Move any other config stuff you might have. I'm using Jarod's recommended my.cnf additions. From his site:

Under the [mysqld] section add: key_buffer = 16M table_cache = 128 sort_buffer_size = 2M myisam_sort_buffer_size = 8M query_cache_size = 16M

Additionally, I added a mythtv user to my Linux server system and edited the uid/gid values to be the same as on the MythDora system (1000/1000). This makes for more readable file owner/groups on both systems, especially as the same server holds my NFS partitions.

Prepare a database dump

The following occurs on the mythtv backend system that is currently running the database. At this point I shut down my mythtv system so that the database would not be changed during the following steps. I also ran the database optimizer.

# killall mythfrontend
# service mythbackend stop
# /usr/local/bin/optimize_mythdb.pl

I then dumped the database and turned of the mysqld server on this system.

$ mysqldump -u myth_user -p --extended-insert --databases mythconverg > mythdb.sql
# service mysqld stop
# chkconfig mysqld off

Load mythconverg on new server

After transfering this backup file to the new MySQL server machine, I was ready to import it to the new MySQL server.

$ mysql -u root -p mythconverg < mythdb.sql
(this will prompt for the mysql root user's password)

And allow mythtv to have remote access to this database with

$ mysql -u root -p mythconverg
(prompts for password)
mysql> grant all on mythconverg.* to mythtv@"%" identified by "mythtv";
mysql> flush privileges;
mysql> quit;

Configure mythbackend to use remote database

We're finally ready to bring it all together. Back on the mythtv backend system you need to configure access for the remote MySQL database server and restart mythbackend.

Access to the MySQL server on my MythDora system was configured in the mysql.txt file, found on my system in several places: /.mythtv/mysql.txt, /root/.mythtv/mysql.txt, and ~mythtv/.mythtv/mysql.txt. The change to make is

DBHostName=<mysql_server_name_or_IP>

I made this change to all 3 copies of mysql.txt found on my system.

Now I restarted the backend and frontend and verified all was well.

# service mythbackend start
$ mythfrontend
(watch some recordings, etc.)