Joinutility seperatorLogin utility separator Infobright.com
   
 
How to change the default data directory?
Posted: 23 July 2009 03:56 AM   Ignore ]  
Newbie
Rank
Total Posts:  20
Joined  2009-06-18

I have installed the ICE in the 64 bit machine, in that, i stoped the mysql service, then i have changed the data dir in the config file
/etc/my-ib.cnf, again i tried to start the mysql service, but its not start. If i changed to the default data dir, again its work.  Why?
how to change the data dir in the infobright?

# The MySQL server
[mysqld]
basedir = /usr/local/infobright
#datadir = /usr/local/infobright/data   #—Default Data Dir
datadir = /mysql/infobright/data       #—New Data Dir

This config not working, doesnt start the mysql service.

Thanks.
S.Ashokkumar.

Profile
 
Posted: 23 July 2009 01:35 PM   Ignore ]   [ # 1 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  723
Joined  2008-08-18

[light edits, and Thanks! Mahib]

write2ashokkumar,

Assuming you don’t wish to reinstall with the new data directory path, the easiest method is to do this without editing any files is to:

1. stop the server

/etc/init.d/mysqld-ib stop 

2. create the new directory

mkdir /mysql/infobright/data 

3. Move the contents of the current data directory, /usr/local/infobright/data, to the new directory, /mysql/infobright/data

mv /usr/local/infobright/data /mysql/infobright 

[Verify this syntax with a test fold before proceeding.]

4. Create a symbolic link from the new directory back to the old name

ln -/mysql/infobright/data /usr/local/infobright/data 

5. Restart the server

/etc/init.d/mysqld-ib start 

I will follow this up with the correct edits if you choose to follow the course of changing the configuration files.  Bear in mind that the contents of the data directory, the databases themselves, must be moved to the new location in either case.

[ Edited: 24 July 2009 09:21 AM by David Lutz]
Signature 
Profile
 
Posted: 23 July 2009 01:47 PM   Ignore ]   [ # 2 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  723
Joined  2008-08-18

write2ashokkumar,

I have reviewed all configuration files and have confirmed that the only edit you need to make is the one you have mentioned.  (I would ask you to consider if you want to move the CacheFolder, as defined in the /usr/local/infobright/data/brighthouse.ini file, as well.)

The step that appears to be missing is Step 3 above.  You must copy the existing contents of the installation data directory to the location where you want it to reside.

Perhaps, this is actually easier than the previous method.  red face

Signature 
Profile
 
Posted: 23 July 2009 08:40 PM   Ignore ]   [ # 3 ]  
Member
RankRankRank
Total Posts:  162
Joined  2008-08-18

Hi Ashok

There is a postconfig.sh script in the /usr/local/infobright/ folder. You can run it (using root access) to move data, cache folders.

cd /usr/local/infobright/
postconfig.sh

This is basically implementation of David’s steps.

cheers

Signature 

Mahib
Developer, Infobright

Profile
 
Posted: 24 July 2009 09:36 AM   Ignore ]   [ # 4 ]  
Member
RankRankRank
Total Posts:  162
Joined  2008-08-18

Correction: The postconfig script only goes with rpm/deb/solaris pkg based installer but not with the tar based installed. Probably we should include this.

thanks David for pointing this out.

Signature 

Mahib
Developer, Infobright

Profile