5 Replies Latest reply on Oct 4, 2004 9:05 PM by didickman

    Proposal to redesign and simplify server instance setup

      This proposal is motivated by the desire to make JBoss more suitable in a shared-style enterprise installation. For example, in this situation a system admin would unpack jboss under the /opt directory which is a read-only partition. This is a problem because jboss needs to have write access to $JBOSS_HOME/server by default. The typical solution is to make use of the jboss.server.base.dir property to use a different directory to which a developer has write permissions.

      I'm proposing to make some changes to JBoss that address this issue. What's more, this proposal would make the creation of custom server instances drastically easier, quicker and less error prone.

      The basic idea is to create a script called $JBOSS_HOME/bin/setup.{bat,sh} which would be responsible for creating server instance configurations rather than supplying pre-built instances like all, default, minimal, and standard. This script would prompt the developer for the required information, and automatically modify some template configuration files to create a server instance.

      The setup script would use template files stored in $JBOSS_HOME/conf/. Jars needed by the setup script would be stored in the $JBOSS_HOME/server/ directory. (ie. this directory would only contain the common jars that are currently stored under $JBOSS_HOME/server/*/lib/, all other existing files under the server directory would be turned into templates and moved to the conf directory). The idea is that this new server directory, containing jars useful for server instances, would parallel the existing client directory which contains jars used by clients.

      When running the setup script it would prompt the developer for things like: JDK to use if $JAVA_HOME is not defined, location to store the server instance configuration files, which services should be enabled (eg. jndi, http, clustering), and for each service which ports should be used, etc. Once all questions have been answered the server instance will be created.

      What's more, the setup script should be usable in interactive mode (as described above) as well as in non-interactive mode. The idea is that a developer could record the choices they make in interactive mode and create a scripted session which could be used to automate this server instance configuration process. This scripted file could be used in continuous build systems and could be version controlled. Example scripted files should be shipped with JBoss which can be used to automatically recreate the same "all", "default", "minimal", and "standard" configurations that are currently shipped with jboss under the server directory.

      Using this script will have a few benefits. For example, it will make it much easier for beginner developers to know exactly which services a server instance actually contains (today it's not really obvious what the differences between default and standard are, for example). Secondly, having these automated scripts will probably cut down a huge amount of questions like "I can't get X working, here is my config file" which is then followed by "Your file looks wrong, you should have had Y". Finally, this is a nice way to get jboss installed in a shared-style installation which is what this proposal was meant to address in the first place.

        • 1. Re: Proposal to redesign and simplify server instance setup
          starksm64

          Make it an ant script so that two completely different scripts with different capabilities do not need to be maintained. Submit a prototype to the sourceforge patches section to get this going.

          • 2. Re: Proposal to redesign and simplify server instance setup

            I'm worried that ant isn't an easy way to get this functionality. For example, how would you take user input and use it to do a search and replace in an xml file using ant? If we wanted something system independent, perl or python would be far better choices, no?

            • 3. Re: Proposal to redesign and simplify server instance setup
              raja05

              Python might be a very good thing to do for these types of user-prompting and taking action, thast IMO. The one thing you might want to watch out is dependencies. If a particular developer is looking for specific services, it might depend on other services that he has not requested. You need to include the dependent services as well for the server to bootstrap.

              • 4. Re: Proposal to redesign and simplify server instance setup
                starksm64

                Ant has user input and search and replace facilities.

                • 5. Re: Proposal to redesign and simplify server instance setup

                  I have a feeling the input and replace tasks won't work for 100% of what i want, but in the interest of getting this started i'll do my first go at this in ant and we'll see how things work out.

                  Scott, I'm not that familiar with all the intricacies of the existing configurations. Do you have some hints about how you might want to structure this? For example, is there a list of all the services that the setup script should prompt for? Also, what are the dependencies between these services?

                  To be honest, I usually just start off with the 'default' or 'all' instance and modify as i have the need... but hopefully i can learn more about the actual details by trying to get this going...