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

Add node storage on the fog master server.

Scheduled Pinned Locked Moved
General Problems
2
8
474
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.
  • K
    kamburta
    last edited by Mar 12, 2024, 1:57 PM

    Good morning guys
    I know that a new fog node is automatically added to the fog master. However, I created a node container to facilitate its implementation. I have two docker images. One runs the fog installation script in storage mode when it is being started and is later automatically added to the fog master. The other fog node image is already preconfigured and does not automatically enter the fog master. I would like to know what command the script executes to add the fog node to the fog master so that I can place it in the execution of the docker container.
    Thank you very much

    T 1 Reply Last reply Mar 12, 2024, 5:12 PM Reply Quote 0
    • T
      Tom Elliott @kamburta
      last edited by Mar 12, 2024, 5:12 PM

      @kamburta it’s removed after installation to prevent issues and exposures but you can copy the installer locations: packages/web/maintenance folder to your specifically the ‘create_update_node.php’ file.

      It’s used as such in the script:
      https://github.com/FOGProject/fogproject/blob/master/lib/common/functions.sh#L38C1-L51C2

      Specifically this is the function call that does it:

      registerStorageNode() {
          [[ -z $webroot ]] && webroot="/"
          dots "Checking if this node is registered"
          storageNodeExists=$(wget --no-check-certificate -qO - ${httpproto}://${ipaddress}${webroot}/maintenance/check_node_exists.php --post-data="ip=${ipaddress}")
          echo "Done"
          if [[ $storageNodeExists != exists ]]; then
              [[ -z $maxClients ]] && maxClients=10
              dots "Node being registered"
              curl -s -k -X POST -d "newNode" -d "name=$(echo -n $ipaddress|base64)" -d "path=$(echo -n $storageLocation|base64)" -d "ftppath=$(echo -n $storageLocation|base64)" -d "snapinpath=$(echo -n $snapindir|base64)" -d "sslpath=$(echo -n $sslpath|base64)" -d "ip=$(echo -n $ipaddress|base64)" -d "maxClients=$(echo -n $maxClients|base64)" -d "user=$(echo -n $username|base64)" --data-urlencode "pass=$(echo -n $password|base64)" -d "interface=$(echo -n $interface|base64)" -d "bandwidth=1" -d "webroot=$(echo -n $webroot|base64)" -d "fogverified" ${httpproto}://${ipaddress}${webroot}/maintenance/create_update_node.php
              echo "Done"
          else
              echo " * Node is registered"
          fi
      }
      

      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

      K T 2 Replies Last reply Mar 13, 2024, 10:21 AM Reply Quote 0
      • K
        kamburta @Tom Elliott
        last edited by Mar 13, 2024, 10:21 AM

        @Tom-Elliott
        Thank you very much Tom-Elliott. In fact, I had already found this information but I didn’t know what to do or how to do it. I was thinking something more or less like this: mysql -u -p’ ’ -h fog. It would be interesting to have an option here just to perform this task. Thank you so much. I’ll work on it.

        usage() {
        echo -e “Usage: $0 [-h?dEUuHSCKYXTFA] [-f <filename>] [-N <databasename>]”
        echo -e “\t\t[-D </directory/to/document/root/>] [-c <ssl-path>]”
        echo -e “\t\t[-W <webroot/to/fog/after/docroot/>] [-B </backup/path/>]”
        echo -e “\t\t[-s <192.168.1.10>] [-e <192.168.1.254>] [-b <undionly.kpxe>]”
        echo -e “\t-h -? --help\t\t\tDisplay this info”
        echo -e “\t-o --oldcopy\t\t\tCopy back old data”
        echo -e “\t-d --no-defaults\t\tDon’t guess defaults”
        echo -e “\t-U --no-upgrade\t\tDon’t attempt to upgrade”
        echo -e “\t-H --no-htmldoc\t\tNo htmldoc, means no PDFs”
        echo -e “\t-S --force-https\t\tForce HTTPS for all comunication”
        echo -e “\t-C --recreate-CA\t\tRecreate the CA Keys”
        echo -e “\t-K --recreate-keys\t\tRecreate the SSL Keys”
        echo -e “\t-Y -y --autoaccept\t\tAuto accept defaults and install”
        echo -e “\t-f --file\t\t\tUse different update file”
        echo -e “\t-c --ssl-path\t\tSpecify the ssl path”
        echo -e “\t \t\t\t\tdefaults to /opt/fog/snapins/ssl”
        echo -e “\t-D --docroot\t\t\tSpecify the Apache Docroot for fog”
        echo -e “\t \t\t\t\tdefaults to OS DocumentRoot”
        echo -e “\t-W --webroot\t\t\tSpecify the web root url want fog to use”
        echo -e "\t \t\t\t\t(E.G. http://127.0.0.1/fog,"
        echo -e “\t \t\t\t\t http://127.0.0.1/)”
        echo -e “\t \t\t\t\tDefaults to /fog/”
        echo -e “\t-B --backuppath\t\tSpecify the backup path”
        echo -e “\t --uninstall\t\tUninstall FOG”
        echo -e “\t-s --startrange\t\tDHCP Start range”
        echo -e “\t-e --endrange\t\tDHCP End range”
        echo -e “\t-b --bootfile\t\tDHCP Boot file”
        echo -e “\t-E --no-exportbuild\t\tSkip building nfs file”
        echo -e “\t-X --exitFail\t\tDo not exit if item fails”
        echo -e “\t-T --no-tftpbuild\t\tDo not rebuild the tftpd config file”
        echo -e “\t-F --no-vhost\t\tDo not overwrite vhost file”
        echo -e “\t-A --arm-support\t\tInstall kernel and initrd for ARM platforms”
        exit 0
        }

        1 Reply Last reply Reply Quote 0
        • T
          Tom Elliott @Tom Elliott
          last edited by Tom Elliott Mar 13, 2024, 4:28 AM Mar 13, 2024, 10:28 AM

          @kamburta Or you could just source the installer and call the function:

          source /path/to/fog/installer/lib/commons/functions.sh
          source /opt/fog/.fogsettings
          registerStorageNode
          

          Assuming the fogsettings file has the information to your master node.

          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

          K 2 Replies Last reply Mar 13, 2024, 11:17 AM Reply Quote 0
          • K
            kamburta @Tom Elliott
            last edited by Mar 13, 2024, 11:17 AM

            @Tom-Elliott
            Thank you very much and sorry for my English. I created a structure with a master server and eleven node servers in virtual machines and I intend to place the nodes in containers. It was a really cool structure. I’ll work on it.

            1 Reply Last reply Reply Quote 0
            • K
              kamburta @Tom Elliott
              last edited by Mar 13, 2024, 12:01 PM

              @Tom-Elliott
              Yes, the fog settings are there and correct.
              The command execute as expected but did not appear in master. See the output.

              ./add_storage.sh

              • Checking if this node is registered…Done
              • Node being registered…Done

              Could it be that an update command is missing from the master server database?

              I made a small change to the script, it presents an output but does not add it to the master

              source /fogproject/lib/common/functions.sh
              source /opt/fog/.fogsettings
              checkDatabaseConnection
              registerStorageNode
              updateStorageNodeCredentials

              Exit
              ./add_storage.sh

              • Checking connection to master database…OK
              • Checking if this node is registered…Done
              • Node being registered…Done
              • Ensuring node username and passwords match…Done

              Note: When the installation script runs completely, it works.

              T 1 Reply Last reply Mar 13, 2024, 12:14 PM Reply Quote 0
              • T
                Tom Elliott @kamburta
                last edited by Mar 13, 2024, 12:14 PM

                @kamburta Wondering if the “node” thinks it’s the master?

                For example, let’s say your fogsettings has the snmysqlserver snmysqluser snmysqlpassword has the local database on the storage node rather than the “master” information?

                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

                K 1 Reply Last reply Mar 13, 2024, 12:35 PM Reply Quote 0
                • K
                  kamburta @Tom Elliott
                  last edited by Mar 13, 2024, 12:35 PM

                  @Tom-Elliott
                  No, the node points to the master configurations.
                  installtype=‘S’
                  snmysqluser=‘fogstorage’
                  snmysqlpass=‘password’
                  snmysqlhost=‘ip_master’

                  using the fogproject/bin/installfog.sh

                  • Checking if this node is registered…Done

                  • Node being registered…Done

                  • Ensuring node username and passwords match…Done

                  • Setup complete

                  • You still need to setup this node in the fog management
                    | portal. You will need the username and password listed
                    | below.

                  • Management Server URL:
                    http://fog.test.test/fog/

                    You will need this, write this down!
                    IP Address: 172.17.0.2
                    Interface: eth0
                    Management Username: fogproject
                    Management Password: password

                  I redid the installation using the fogproject/bin/installfog.sh script and everything went well. I deleted the storage node from the master and ran the commands below again, it returned success but the storage node was not added to the master.

                  source /fogproject/lib/common/functions.sh
                  source /opt/fog/.fogsettings
                  registerStorageNode

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  1 / 1
                  • First post
                    2/8
                    Last post

                  301

                  Online

                  12.0k

                  Users

                  17.3k

                  Topics

                  155.2k

                  Posts
                  Copyright © 2012-2024 FOG Project