Installation of FOG with external MySQL base
-
Hi,
We are trying to install FOG with an external MySQL base.
We tried this command :
snmysqlhost=‘192168.1.1’ snmysqluser=‘mypriviledgeusername’
./installfog.shBut we also need to specify our database name, how could we do that during this installation ?
-
Do we need to add our external database parameters befoer lanuching the installation in /etc/my.cnf ?
-
@Jacques-Olivier Try using
mysqldbname=yourfogdbname
.Do we need to add our external database parameters befoer lanuching the installation in /etc/my.cnf ?
No I don’t think you need to modify the local /etc/my.cnf - though the installer will ask you for the DB root password to be able to create the FOG database and unpriviledged user for you. So you need to make sure you are able to connect to the external database over network and login as DB root user.
I have to say that I have tested a lot when improving that part of the installer and make it more secure just before the 1.5.9 release but I never tested with a database on another host. Looking forward to hear from you if it works “out of the box”.
-
@sebastian-roth said in Installation of FOG with external MySQL base:
DB root user.
Do you mean we can’t have a priviledge root user with another name to access our external database ? For example we would like to use theboss instead of root as this priviledge user already exists.
-
@jacques-olivier said in Installation of FOG with external MySQL base:
Do you mean we can’t have a priviledge root user with another name to access our external database ? For example we would like to use theboss instead of root as this priviledge user already exists.
The FOG installer is programmed to do all the DB user and database setup for you. It will ask your root DB password (but not store it anywhere!) just to set the user and database up for you.
With the installer we try to help people and sometimes we have gone “too far”. I can see this is not perfect for people like you who have a custom setup and know what they are doing.
Looking through the installer scripts I think I found a way for you to get around this:
- Create the database on your other server - e.g. named
ourfogdb
- Create a DB user with all rights on that DB:
GRANT ALL PRIVILEGES ON ourfogdb.* TO 'theboss'@'x.x.x.x';
- Create a less privileged DB user called
fogstorage
(sorry this is still hard coded) that would be used by external storage nodes - you might not need that but the installer will check for it, sorry. - Grant access rights for the
fogstorage
DB user:
GRANT SELECT ON ourfogdb.* TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.hosts TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.inventory TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.multicastSessions TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.multicastSessionsAssoc TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.nfsGroupMembers TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.tasks TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.taskStates TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.taskLog TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.snapinTasks TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.snapinJobs TO 'fogstorage'@'%' ; GRANT INSERT,UPDATE ON ourfogdb.imagingLog TO 'fogstorage'@'%' ;
Now with that being prepared you should be able to call the FOG installer like this (untested, keeping my fingers crossed I did not overlook the obvious):
mysqldbname='ourfogdb' snmysqlhost=‘192.168.1.1’ snmysqluser=‘theboss’ snmysqlpass='password_of_theboss_db_user' snmysqlstoragepass='password_of_the_fogstorage_db_user' ./installfog.sh
- Create the database on your other server - e.g. named