• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Use an external database

Scheduled Pinned Locked Moved
General
5
14
1.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    george1421 Moderator @Fernando Gietz
    last edited by george1421 Feb 25, 2019, 7:10 AM Feb 25, 2019, 1:10 PM

    @Fernando-Gietz said in Use an external database:

    Hi @george1421 ,

    The configutarion file is .fogsettings in /opt/fog?

    You will need to update that one too for upgrades, but there is a configuration file in the /var/www/html/fog path that holds the startup settings. I’ve been grep’ing to try to find the config file. I thought it was in /var/www/html/fog/commons but it looks not.

    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

    G 1 Reply Last reply Feb 25, 2019, 1:14 PM Reply Quote 0
    • G
      george1421 Moderator @george1421
      last edited by george1421 Feb 25, 2019, 7:16 AM Feb 25, 2019, 1:14 PM

      @george1421 Ah found it: /var/www/html/fog/lib/fog/config.class.php

          private static function _dbSettings()
          {
              define('DATABASE_TYPE', 'mysql'); // mysql or oracle
              define('DATABASE_HOST', '127.0.0.1');
              define('DATABASE_NAME', 'fog');
              define('DATABASE_USERNAME', 'root');
              define('DATABASE_PASSWORD', '<no_password_for_you>');
          }
      
      

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      1 Reply Last reply Reply Quote 1
      • F
        Fernando Gietz Developer
        last edited by Fernando Gietz Feb 25, 2019, 10:18 AM Feb 25, 2019, 4:03 PM

        Hi @george1421,

        I tried to do it and worked fine!! You can use an external database changing the both files: /var/www/html/fog/lib/fog/config.class.php adn /opt/fog/.fogsettings.

        snmysqluser='<MySQL_user>'
        snmysqlpass='<password_of_your_MySQL_user>'
        snmysqlhost='<ip_of_your_MySQL_Server>'
        
        

        I don’t do any fresh install lastly, then I don’t know if the installer asks you about the location of your MySQL server or by default is always localhost. If the installer is not prepare to use an external database, I will suggest to implement this feature in future versions.

        I want to take advantage of the occasion to say that the mariadb version, 5.5 is obsolete, I updated it to the last stable version the last month, MariaDB 10.3. Maybe will be interesant to update the installer to install this last version of MariaDB.

        Under RedHat 7 the packages are MariaDB-client and MariaDB-server.

        G T 2 Replies Last reply Feb 25, 2019, 4:37 PM Reply Quote 1
        • G
          george1421 Moderator @Fernando Gietz
          last edited by Feb 25, 2019, 4:37 PM

          @Fernando-Gietz It will be interesting to see if you have any performance differences since you are now running an external database and its on version 10 over the integrated database on version 5. If you had nagios setup to measure cpu usage, you could have had a great baseline to know if the change helped or hurt your setup.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          1 Reply Last reply Reply Quote 0
          • F
            Fernando Gietz Developer
            last edited by Feb 25, 2019, 4:51 PM

            Ummm … I can not say about the performance, I follow with my mysql performance problems XD both in one version and in another. I can say that the configuration in 5.5 version is different than 10.3, I have to retuning the my.cfg file.

            G 1 Reply Last reply Feb 25, 2019, 8:06 PM Reply Quote 0
            • T
              Tom Elliott @Fernando Gietz
              last edited by Feb 25, 2019, 4:52 PM

              @Fernando-Gietz you can define this inline when running the installer.

              snmysqlhost=“193.168.1.110” snmysqluser=“someuser” snmysqlpass=“somepassword” ./installfog.sh -y

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              1 Reply Last reply Reply Quote 1
              • G
                george1421 Moderator @Fernando Gietz
                last edited by Feb 25, 2019, 8:06 PM

                @Fernando-Gietz said in Use an external database:

                I can not say about the performance

                I’m considering performance on a FOG system level.

                <thinking out loud> There must have been a reason why Fernando made this change. He wouldn’t just make this change for fun?? There must have been some kind of issue with the integrated database to move it external. I wonder if he can tell performance wise the difference.

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                1 Reply Last reply Reply Quote 0
                • S
                  Sebastian Roth Moderator
                  last edited by Feb 25, 2019, 8:21 PM

                  @george1421 said in Use an external database:

                  There must have been some kind of issue with the integrated database to move it external. I wonder if he can tell performance wise the difference.

                  With 8000 hosts checking into your FOG server I can definitely see database queries being a bottleneck. FOG is not optimized to run in such huge environments (yet). Not saying that it cannot be done but some of the things have not been coded with such amount of clients in mind.

                  @Fernando-Gietz Which version of FOG do you currently run? I have pushed a couple of changes to the dev-branch (late last year I think) that should help performance wise. Not sure if you are aware of that.

                  Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                  Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                  1 Reply Last reply Reply Quote 1
                  • W
                    Wayne Workman
                    last edited by Wayne Workman Feb 25, 2019, 6:27 PM Feb 26, 2019, 12:23 AM

                    You should consider more than just a remote database, you need to scale. You should probably put a few FOG servers behind HAProxy as a load balancer (And have HAProxy do SSL offloading if you use https), and turn sticky on for HAProxy. Then, each of those FOG Servers should point to another HAProxy load balancer that distributes database queries across a Galara MariaDB cluster.

                    ^ I know how to do all that, and can guide you.

                    A quick google search gives some tutorials:

                    HAProxy http load balancing:
                    https://thegeeksalive.com/how-to-setup-haproxy-http-load-balancer-on-centos/
                    https://www.digitalocean.com/community/tutorials/how-to-use-haproxy-to-set-up-http-load-balancing-on-an-ubuntu-vps

                    HAProxy Galara load balancing:
                    http://galeracluster.com/documentation-webpages/haproxy.html#using-haproxy
                    https://www.cloudandheat.com/blog/tutorial-simple-mariadb-galera-cluster-with-haproxy-load-balancing/

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                    Daily Clean Installation Results:
                    https://fogtesting.fogproject.us/
                    FOG Reporting:
                    https://fog-external-reporting-results.fogproject.us/

                    1 Reply Last reply Reply Quote 1
                    • F
                      Fernando Gietz Developer
                      last edited by Feb 26, 2019, 4:03 PM

                      @george1421 said in Use an external database:

                      @Fernando-Gietz said in Use an external database:

                      I can not say about the performance

                      I’m considering performance on a FOG system level.

                      <thinking out loud> There must have been a reason why Fernando made this change. He wouldn’t just make this change for fun?? There must have been some kind of issue with the integrated database to move it external. I wonder if he can tell performance wise the difference.

                      I only done a proof of concept, use an external database is a solution that is on the table. We wanted to answer the questioni if use an external database is possible. And the answer is YES, and without too much effort.

                      @Sebastian-Roth said in Use an external database:

                      @george1421 said in Use an external database:

                      There must have been some kind of issue with the integrated database to move it external. I wonder if he can tell performance wise the difference.

                      With 8000 hosts checking into your FOG server I can definitely see database queries being a bottleneck. FOG is not optimized to run in such huge environments (yet). Not saying that it cannot be done but some of the things have not been coded with such amount of clients in mind.

                      @Fernando-Gietz Which version of FOG do you currently run? I have pushed a couple of changes to the dev-branch (late last year I think) that should help performance wise. Not sure if you are aware of that.

                      The database is the bottleneck XD. In our case the server can not proccess all the SQL queries, the locks appear in the tables, these locks “lock” the apache server and noting works 😞 Yesterday the System guys moved the FOG server to a new VMWARE host and the MySQL performance has increased a lot of. But this is a temporal solution, as @Sebastian-Roth says FOG is not optimized for large environments. We have 8000 client in my server but I know an environment with 14000 client XD.

                      My FOG version is 1.5.5 for working branch, the last version.

                      @Wayne-Workman the university has a Galera Cluster, in case that we need use an external database, we wiil use an instance in this Galera environment.

                      1 Reply Last reply Reply Quote 0
                      • S
                        Sebastian Roth Moderator
                        last edited by Feb 26, 2019, 8:24 PM

                        @Fernando-Gietz said in Use an external database:

                        My FOG version is 1.5.5 for working branch, the last version.

                        So you don’t have the fixes I pushed to dev-branch. We might consider merging your code changes form working to dev-branch soon. This way you can make use of all those changes.

                        @Tom-Elliott What do you think?

                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        1 / 1
                        • First post
                          13/14
                          Last post

                        194

                        Online

                        12.0k

                        Users

                        17.3k

                        Topics

                        155.2k

                        Posts
                        Copyright © 2012-2024 FOG Project