Joinutility seperatorLogin utility separator Infobright.com
   
 
Installing multiple instances of ICE with RPM
Posted: 30 July 2010 06:07 PM   Ignore ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  738
Joined  2008-08-18

I have developed and tested the following method for installing a second instance of ICE (and/or IEE) on a single physical server after an initial installation with the RPM installer as RPM is not designed to install multiple copies of the same package.  (It can be easily repeated for more than two instances or modified for multiple versions of ICE/IEE.)  Similar efforts would be required for DEB and PKG installations but not necessary with the install-infobright.sh script included in the TAR packages.

There are really no sequential dependencies here so any of the steps can be done in any order but I find the following to be the most logical to me.  If your second installation fails to start, review the server log, bh.err by default, in the data directory for your 2nd installation.  It will point out what can’t be found, read, or rationalized.

Good luck!

1. install 1st instance with the rpm command per instructions found here (click link to be taken to the wiki page)

# rpm -i infobright_<version_name>.rpm 

2. if you started the infobright server after installation, be sure to shut down the server for the 1st installed instance

# /etc/init.d/mysqld-ib stop 

3. create 2nd symbolic link in /usr/local to infobright software directory

# ln -s /usr/local/<infobright softare> <new link> 

4. create new data & cache directories (can be a copy of existing directories), be sure to preserve the mysql ownership and privileges

# cp -rp /<path>/<1dir> /<path>/<2dir> 

By default, the data and cache directories are located in /usr/local/infobright.  Many users run the postconfig.sh script to relocate them to somewhere like /opt/infobright so their paths are /opt/infobright/data and /opt/infobright/cache.  In this case the command would look like this:

# cp -rp /opt/infobright /opt/<2dir> 

5. edit new /<2dir>/data/brighthouse.ini
  - change ‘CacheFolder’ value from CacheFolder = /<1dir>/cache to CacheFolder = /<2dir>/cache

NOTE:  If you plan to run both instances simultaneously, you may also need to adjust the amount of memory specified for ServerManHeapSize such that the combined amounts do not exceed the total memory of the physical server.

6. copy mysql config file to a new file

# cp /etc/my-ib.cnf /etc/my-<name>.cnf 

7. edit the new mysql config file, /etc/my-<name>.cnf
  - change every occurrence of ‘port’ value from 5029 to a different, unused port number, say, 5030 (3 times)
  - change every occurrence of ‘socket’ value from /etc/mysql-ib.sock to /etc/mysql-<name>.sock (2 times)

  - change ‘infobright’ in the following line to <new link>
  -    basedir=/usr/local/<new link>

  - change every occurrence of ‘infobright’ in the following lines to <2dir>
  -    datadir = /<2dir>/data
  -    log-error = /<2dir>/data/bh.err
  -    general_log_file=/<2dir>/data/general_query.log
  -    slow_query_log_file=/<2dir>/data/slow_query.log

8. copy infobright start/stop script to new file

# cp /etc/init.d/mysqld-ib /etc/init.d/mysqld-<name> 

9. edit new start/stop script, /etc/init.d/mysqld-<name>
  - change ‘conf’ value from conf=/etc/my-ib.cnf to conf=/etc/my-<name>.cnf

10. copy client script to new file

# cp /usr/bin/mysql-ib /usr/bin/mysql-<name> 

11. edit new client script, /usr/bin/mysql-<name>
  - change path to use new link name - /usr/local/<new link>/bin/mysql
  - change defaults-file to new mysql config file -—defaults-file=/etc/my-<name>.cnf

12. restart 1st server and start 2nd server

# /etc/init.d/mysqld-ib start
# /etc/init.d/mysqld-<name> start 

UPDATE:  If one uses the same string for <name>, <new link> and <2dir> (as I did), this is greatly simplified.

[ Edited: 01 August 2010 08:17 AM by David Lutz]
Signature 
Profile
 
Posted: 03 October 2010 07:35 PM   Ignore ]   [ # 1 ]  
Newbie
Rank
Total Posts:  10
Joined  2009-03-23

Hi David,
Can you point out what would change in your steps to install different versions and have them run simultaneously?  How can I tell the RPM install to create/use a new directory for software files instead of just making another link to the same directory like you mentioned?  I assume I would be running the rpm command again with maybe an install option which points to somewhere besides /usr/local/infobright, is that correct?  If so can you provide an example please?
Thanks,
Robert

Profile
 
Posted: 04 October 2010 06:09 PM   Ignore ]   [ # 2 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  738
Joined  2008-08-18

Robert,

The key here is that /usr/local/infobright is a symbolic link.  When one installs a new version of Infobright, it is actually installed in a directory that follows the naming convention of the .rpm file being installed.  For example, for version 3.4.2, the directory name to whch /usr/local/infobright is linked is as follows:

lrwxrwxrwx  1 root root   34 Aug 27 08:47 infobright -> /usr/local/infobright-3.4.2-x86_64 

The difference in your case would come in Step 3.  It instructs you to create two symbolic links to the same directory.  In your case, you would create two symbolic links to two separate directories which automatically have different names.  The challenge is that /usr/local/infobright is automatically linked to the last one installed.

Here’s what I suggest - but realize this is a manual process and prone to human error.  If you are not a system administrator, you may wish to ask for supervision or assistance with this (it’s not really that difficult, I’m just being cautious).

First, stop the currently installed Infobright server.  Then delete the symbolic with

rm -/usr/local/infobright 

(Make a backup of the original Infobright installation just in case.)

Install the new version normally.  When finished, adjust the symbolic link and create a new one as suggested in my first post.  See an example below (from a real installation, using ‘infobright’ and ‘sandbox’ as the links to versions 3.3.1 and 3.4.2, respectively):

lrwxrwxrwx  1 root root   34 Aug 27 08:47 infobright -> /usr/local/infobright-3.3.1-x86_64
drwxr
-xr-x 11 root root 4096 Aug 27 09:07 infobright-3.3.1-x86_64
drwxr
-xr-x 11 root root 4096 Aug 27 09:07 infobright-3.4.2-x86_64
lrwxrwxrwx  1 root root   23 Jul 30 10
:44 sandbox -> infobright-3.4.2-x86_64 

Follow all the other steps so that you have two start/stop scripts, two client scripts, two config files, two socket files, etc.

Remember: if you plan to run both instances at the same time, you will need to adjust memory settings such that in total they do not exceed your server’s physical RAM.

Start both servers, test and troubleshoot as necessary.

I hope that helps.

Signature 
Profile
 
Posted: 04 October 2010 06:29 PM   Ignore ]   [ # 3 ]  
Newbie
Rank
Total Posts:  10
Joined  2009-03-23

Hi David,
Thank you for your detailed reply.  That helps clear up my confusion over the installation procedure.  I saw the same link (/usr/local/infobright) being used and forgot that it really referred to another directory.
Regards,
Robert

Profile
 
Posted: 04 February 2011 01:34 PM   Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  6
Joined  2011-02-03

Thanks David for the detailed description.  This works!

[ Edited: 04 February 2011 02:06 PM by ASudarsan]
Profile