Can't get FOG to replicate to storage node
-
[quote=“Tom Elliott, post: 22674, member: 7271”]Check the file /opt/fog/service/etc/config.php
Make sure the MYSQL information is set correctly for your database.
Restart the FOG Services:
[code]sudo service FOGMulticastManager restart
sudo service FOGImageReplicator restart
sudo service FOG Scheduler restart[/code]That error should go away.
If you can’t login because the mysql server is separate from the FOG Server you can allow root to the host from any place with
GRANT PRIVILEGES to ‘root’@‘%’ IDENTIFIED BY ‘PASSWORD’;This should allow any host to connect as the root user.
You are correct that fogstorage user is created, but I don’t know exactly where it needs to connect.[/quote]
Here is config.php from my storage node:
<?php
define( “UPDSENDERPATH”, “/usr/local/sbin/udp-sender” );
define( “MULTICASTLOGPATH”, “/opt/fog/log/multicast.log” );
define( “MULTICASTDEVICEOUTPUT”, “/dev/tty2” );
define( “MULTICASTSLEEPTIME”, 10 );
define( “MULTICASTINTERFACE”, “eth0” );
define( “UDPSENDER_MAXWAIT”, null );define( “MYSQL_HOST”, “10.10.1.101” );
define( “MYSQL_DATABASE”, “fog” );
define( “MYSQL_USERNAME”, “fogstorage” );
define( “MYSQL_PASSWORD”, “fs9536” );define( “LOGMAXSIZE”, “1000000” );
define( “REPLICATORLOGPATH”, “/opt/fog/log/fogreplicator.log” );
define( “REPLICATORDEVICEOUTPUT”, “/dev/tty3” );
define( “REPLICATORSLEEPTIME”, 600 );
define( “REPLICATORIFCONFIG”, “/sbin/ifconfig” );define( “SCHEDULERLOGPATH”, “/opt/fog/log/fogscheduler.log” );
define( “SCHEDULERDEVICEOUTPUT”, “/dev/tty4” );
define( “SCHEDULERWEBROOT”, “/var/www/fog” );
define( “SCHEDULERSLEEPTIME”, 60 );
?>On my main FOG server the only difference with the file is this:
define( “MYSQL_HOST”, “” );
define( “MYSQL_DATABASE”, “fog” );
define( “MYSQL_USERNAME”, “” );
define( “MYSQL_PASSWORD”, “” );Do I need to be filling out these fields?
-
Per my previous many postings, yes both files need to have the MYSQL stuff filled out.
The FOG Services use /opt/fog/service/etc/config.php
The Main fog system uses /var/www/{fog,html/fog}/commons/config.php.
This is only relevant for 0.32 as I’ve moved 0.33b to use only the www config.php for all things.
-
I filled out the fields on my main server, restarted FOGReplicator and still getting the same results.
-
So i’d recommend changing the FOG user to root and use the mysql root password if you have one set.
-
Changed to use root and still have same results.
-
I don’t know if it makes a difference but my storage node is located at a different site connected back to my main site where my main FOG server is located.
-
[FONT=arial][SIZE=3]a way to try and troubleshoot (Everything in red in the commands you need to change before running command.)[/SIZE][/FONT]
[FONT=arial][SIZE=3]first off - run the below command on your [U][B]main server[/B][/U]:[/SIZE][/FONT]
[FONT=arial][SIZE=3]mysql -u fog fog -p[COLOR=#ff0000]PASSWORD_GIVEN_AFTER_INSTALLING_FOG_ON_THE_NODE[/COLOR] -h[COLOR=#ff0000]IP_OF_NODE[/COLOR][/SIZE][/FONT][FONT=arial][SIZE=3]this command above will just confirm your main server can connect to mysql database on your node.[/SIZE][/FONT]
[FONT=arial][SIZE=3]then run on your [U][B]node[/B][/U]:[/SIZE][/FONT]
[FONT=arial][SIZE=3]mysql -u fogstorage fog -p[COLOR=#ff0000]whatever is set in fog settings under FOG_STORAGENODE_MYSQLPASS[/COLOR] -h[COLOR=#ff0000]IP_OF_MAIN_SERVER[/COLOR][/SIZE][/FONT][FONT=arial][SIZE=3]from what you are saying the above command, you should get “Access Denied”[/SIZE][/FONT]
[FONT=arial][SIZE=3]then run on your [U][B]main server[/B][/U]:[/SIZE][/FONT]
[FONT=arial][SIZE=3]mysql -u fogstoage fog -p[/SIZE][/FONT][SIZE=3][FONT=arial][COLOR=#ff0000]whatever is set in fog settings under FOG_STORAGENODE_MYSQLPASS[/COLOR][/FONT][/SIZE][FONT=arial][SIZE=3][COLOR=#000000]the above command is connecting locally using fogstorage mysql user account (the one your nodes trying to use)[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=3][COLOR=#000000]if it does connect - you have an issue with connecting remotely to your mysql database on your main server, if it doesn’t connect then it’s more likely an mysql user issue.[/COLOR][/SIZE][/FONT][FONT=arial][SIZE=3][COLOR=#000000]and if so you could reset the password for the fogstorage account on mainserver.[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=3][COLOR=#000000]on [U][B]main server[/B][/U] do this:[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=3]mysql -u root fog (if you set a pw when installing mysql specifiy it with -p[COLOR=#ff0000]THE_PASSWORD[/COLOR])[/SIZE][/FONT]
[FONT=arial][SIZE=3]then run:[/SIZE][/FONT]
[FONT=arial][SIZE=3]SET PASSWORD FOR ‘fogstorage’ = PASSWORD(‘[COLOR=#ff0000]whatever is set in fog settings under FOG_STORAGENODE_MYSQLPASS[/COLOR]’);[/SIZE][/FONT][FONT=arial][SIZE=3]then try the command above that you run before on your node.[/SIZE][/FONT]
[FONT=arial][SIZE=3]hope this helps/makes sense[/SIZE][/FONT]
-
I can’t get past step one
I entered:
mysql -u fog fog -p <password from storage node> -h <IP of storage node>
and it didn’t go through
I then entered:
mysql -u fog fog -p --host=<IP of storage node>
Enter password: (entered <password from storage node> )
ERROR 2003 (HY000): Can’t connect to MySQL server on ‘<IP of storage node>’ (111) -
Ok well lets get the node connecting to the main server so do the local command to on main server to reset/set password:
Btw ur commands looking similar to this?
I.e. mysql -u fogstorage fog -pfs9345 -h192.168.169.212You may need to reset the node user account aswell so connecting local to node mysql database.
-
So, I need to change the fog and mysql user’s password to match what? If I am changing the mysql fog user on the master node that would not allow me to connect to my web ui.
-
mysql -u fogstorage fog -pfs123456 -h10.24.1.2
ERROR 2003 (HY000): Can’t connect to MySQL server on ‘10.24.1.2’ (111) -
no sorry, you need to reset the fogstorage user on the main server (once you’re connected locally to mysql)
[SIZE=3][FONT=arial]SET PASSWORD FOR ‘fogstorage’ = PASSWORD(‘fs123456’)[/FONT][/SIZE][SIZE=3][FONT=arial]; and do the same on your node (only diff will be the password will be the one under storage management for your node)[/FONT][/SIZE]
just so you can rule out an account issue
-
the error you’ve posted is connection issue, try this (on 10.24.1.2):
[LIST=1]
[]nano /etc/mysql/my.cnf
[]comment the quoted content “bind-address = 127.0.0.1” use # symbol
[*]restart server or mysql service
[/LIST] -
Sorry for the delay in posting. Since my last post, I did something to my database and locked myself completely out. I purged everything and reloaded. My main fog server is running great (actually better, I had another unrelated issue that is now gone) and I just installed the storage node and followed step by step instructions on the web and got nothing. I retried the instructions to try to connect to the storage node through the main server
[CODE]first off - run the below command on your main server:
mysql -u fog fog -pPASSWORD_GIVEN_AFTER_INSTALLING_FOG_ON_THE_NODE -hIP_OF_NODE[/CODE]and once again got
[CODE]ERROR 2003 (HY000): Can’t connect to MySQL server on ‘10.24.1.2’ (111)
[/CODE]I commented out the bind-address line on my node and restarted with no change.
-
I have found that the 13.10 Ubuntu revision has issues when installing fog.
I had to manually restart the Mysql and apache2 services after a complete install (the install reported no errors, however when trying to access the Web GUI or the database I received error messages).
After manually enabling the service I was able to use the server.
I Would still spend some time trying to troubleshoot the issue incase you can get it working, or incase the issue actually lies else where, Lee’s troubleshooting steps are recommended.
In the even that you are unsuccessful, if you’re not opposed, a complete wipe and re-install would not be a bad idea. After completing the ./installfog.sh type
[code]
sudo service mysql restart
sudo service apache2 restart
[/code] -
Jaymes, I have completely reinstalled both my main FOG and the storage node and started from scratch. This did resolve a different issue with searching for hosts but did not resolve the issue of communication between my main and node.
-
The communication issue, I think, is because of two possible (maybe even both) scenarios.
First things first, I’m assuming you’ve removed the bind-address = 127.0.0.1 from the my.cnf files on both storage-node and server as Lee stated above?
Second, did you create the fogstorage user on both the server and the node with the same username and password?
Are both system without firewall?
Next,
When you created the FOGUser, did you just create them as ‘fogstorage’@‘localhost’?
For now I would attempt using the root user and password for both as you can troubleshoot the fogstorage user later on. We want to see both the node connect to the server AND the server connect to the node. This way you know communication happens between both.
-
I removed the bind address on both server and node, and both systems do not have a firewall. I checked mysql on the server and made sure the password was set. On node, mysql-server is not installed so there is no user to create or check.
I have set the node to try using root user, which I can log into the server from node with, and restarted FOGImageReplicator and Im still getting.
[CODE][02-27-14 7:32:54 pm] * Starting FOG Image Replicator Service
[02-27-14 7:32:59 pm] * [02-27-14 7:32:59 pm] Checking for new tasks every 600 seconds.
[02-27-14 7:32:59 pm] * [02-27-14 7:32:59 pm] Starting service loop.
[02-27-14 7:32:59 pm] [02-27-14 7:32:59 pm] Failed to connect to database server, will try again in next iteration.[/CODE] -
Looking back over the posts still trying to understand what is needed. I looked at Lee’s post, troubleshooting connections between the two machines and realized something, there is no Mysql database on the node mysql-server does not install when installing a node.
-
After an experience I had yesterday, I don’t think a storage node is what I am wanting to use. I was pushing out an image to a machine and noticed that it was connecting to my storage node to try to pull the image (it errored out because the image still has not replicated.)
The problem I have with this is that my intent was to have a master node at my main school and a storage node at various campuses but what I found yesterday was that if I am imaging a machine at campus A it may pull an image from Campus B which would take up precious bandwidth.
Someone correct me if I am wrong but what I believe the storage nodes are most useful for is multi-casting and in my particular set-up it would be better to have individual master nodes at each campus and copy any new images manually to each campus.