For Grouper 2.5+ see the new approach for Grouper 2.5+ packaging and versioning strategy   


Description

The Grouper installer admin tool will help Grouper administrators perform tasks administrative tasks on Grouper (generally for grouper installed by the installer but might be useful for other installations as well).  

Run the admin tool

 

java -jar grouperInstaller.jar
Do you want to 'install' a new installation of grouper, 'upgrade' an existing installation
  or 'patch' an existing installation
  (enter: 'install', 'upgrade', 'patch', 'admin' or blank for the default) [install]: admin

Main menu

in the admin tool you can:

What admin action do you want to do (manage, upgradeTask)?
  • manage
    • find logs
    • stop/start services
  • upgrade tasks
    • convert ehcache xml to properties

Admin - Manage

What do you want to manage (logs, services, back, exit)?


Admin - Manage - Services

What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? :


Admin - Manage - Logs

API logs example

Chriss-MacBook-Air:grouper-installer mchyzer$ java -jar grouperInstaller.jar

Do you want to 'install' a new installation of grouper, 'upgrade' an existing installation, 'patch' an existing installation, 'admin' utilities, or 'createPatch' for Grouper developers (enter: 'install', 'upgrade', 'patch', 'admin', 'createPatch' or blank for the default): admin

What admin action do you want to do (manage, upgradeTask)? : manage

Enter in the Grouper install directory (note: better if no spaces or special chars) : /Users/mchyzer/tmp/grouperInstaller

What do you want to manage (logs, services, back, exit)? logs

What do you want to look at logs for?  api, ui, ws, pspng, or psp? [api]: 

First we need to find where the application is running, then find the log4j.properties in the classpath.

The API (generally invoked via GSH) logs to where the log4.properties specifies.

By default the installer configures the log file to be: /Users/mchyzer/tmp/grouperInstaller/grouper.apiBinary-2.3.0/logs/grouper_error.log

The log4j.properties is located in: /Users/mchyzer/tmp/grouperInstaller/grouper.apiBinary-2.3.0/conf/log4j.properties

Examine the log4j.properties to see where it is logging

Generally the log4j.rootLogger property shows where logs go, it is set to: ERROR, grouper_error

The log4j.rootLogger property in log4j.properties is set to: grouper_error

There is a property in log4j.properties: log4j.appender.grouper_error.File = ${grouper.home}logs/grouper_error.log

Grouper log should be: /Users/mchyzer/tmp/grouperInstaller/grouper.apiBinary-2.3.0/logs/grouper_error.log

Press <enter> to continue.

What do you want to manage (logs, services, back, exit)? : exit
Chriss-MacBook-Air:grouper-installer mchyzer$ 

UI logs example

Chriss-MacBook-Air:grouper-installer mchyzer$ java -jar grouperInstaller.jar

Do you want to 'install' a new installation of grouper, 'upgrade' an existing installation, 'patch' an existing installation, 'admin' utilities, or 'createPatch' for Grouper developers (enter: 'install', 'upgrade', 'patch', 'admin', 'createPatch' or blank for the default) [admin]: 

What admin action do you want to do (manage, upgradeTask)? : manage

Enter in the Grouper install directory (note: better if no spaces or special chars) : /Users/mchyzer/tmp/grouperInstaller 

What do you want to manage (logs, services, back, exit)? : logs

What do you want to look at logs for?  api, ui, ws, pspng, or psp? [api]: ui

Find where the application is running, then find the log4j.properties in the classpath.

Tomcat logs STDOUT and STDERR to the catalinaErr.log and catalinaOut.log logfiles, which should be here: /Users/mchyzer/tmp/grouperInstaller/apache-tomcat-6.0.35/logs

Locate the logs files.

By default the installer has the UI running based on the tomcat server.xml, but could also run in the webapps dir.

The server.xml is located: /Users/mchyzer/tmp/grouperInstaller/apache-tomcat-6.0.35/conf/server.xml

What is the URL starting path? [grouper]: grouper

Looking for an entry in the server.xml that looks like this:

  <Context docBase="/Users/mchyzer/tmp/grouperInstaller/grouper.ui-2.3.0/dist/grouper" path="/grouper" reloadable="false"/>
The docBase for the grouper entry in the server.xml is: /Users/mchyzer/tmp/grouperInstaller/grouper.ui-2.3.0/dist/grouper

The log4j.properties is located in: /Users/mchyzer/tmp/grouperInstaller/grouper.ui-2.3.0/dist/grouper/WEB-INF/classes/log4j.properties

Examine the log4j.properties to see where it is logging

Generally the log4j.rootLogger property shows where logs go, it is set to: ERROR, grouper_error

The log4j.rootLogger property in log4j.properties is set to: grouper_error

There is a property in log4j.properties: log4j.appender.grouper_error.File = /Users/mchyzer/tmp/grouperInstaller/apache-tomcat-6.0.35/logs/grouperUi/grouper_error.log

Grouper log should be: /Users/mchyzer/tmp/grouperInstaller/apache-tomcat-6.0.35/logs/grouperUi/grouper_error.log

Press <enter> to continue.

What do you want to manage (logs, services, back, exit)? : exit

Chriss-MacBook-Air:grouper-installer mchyzer$ 

UI logs not from installer

[appadmin@i2midev1 patchesAuto]$ java -jar grouperInstaller.jar
Do you want to 'install' a new installation of grouper, 'upgrade' an existing installation,
  'patch' an existing installation, 'admin' utilities, or 'createPatch' for Grouper developers
  (enter: 'install', 'upgrade', 'patch', 'admin', 'createPatch' or blank for the default) [install]: admin
What admin action do you want to do (manage, upgradeTask)? : manage
Enter in the Grouper install directory (note: better if no spaces or special chars) [/opt/grouper/2.3/patchesAuto]: /opt/tomcats/tomcat_f
What do you want to manage (logs, services, back, exit)? : logs
What do you want to look at logs for?  api, ui, ws, pspng, or psp? [api]: ui
Find where the application is running, then find the log4j.properties in the classpath.
Tomcat logs STDOUT and STDERR to the catalinaErr.log and catalinaOut.log logfiles, which should be here: /opt/tomcats/tomcat_f/logs
Locate the UI application files.
By default the installer has the UI running based on the tomcat server.xml, but could also run in the webapps dir.
The server.xml is located: /opt/tomcats/tomcat_f/conf/server.xml
What is the URL starting path? [grouper]: grouper_v2_3
Looking for an entry in the server.xml that looks like this:
  <Context docBase="/opt/tomcats/tomcat_f/grouper.ui-2.3.0/dist/grouper" path="/grouper_v2_3" reloadable="false"/>
The docBase could not be found in the server.xml, check in the tomcat/webapps directory
The log4j.properties is located in: /opt/tomcats/tomcat_f/webapps/grouper_v2_3/WEB-INF/classes/log4j.properties
Examine the log4j.properties to see where it is logging
Generally the log4j.rootLogger property shows where logs go, it is set to: ERROR, grouper_error
The log4j.rootLogger property in log4j.properties is set to: grouper_error
There is a property in log4j.properties: log4j.appender.grouper_error.File = /opt/tomcats/tomcat_f/logs/grouper_v2_3/grouper_error.log
Grouper log should be: /opt/tomcats/tomcat_f/logs/grouper_v2_3/grouper_error.log
Press <enter> to continue.

What do you want to manage (logs, services, back, exit)? : exit
[appadmin@i2midev1 patchesAuto]$ 

Admin - manage - services - database (only hsql):


java –jar grouperInstaller.jar
Do you want to 'install' a new installation of grouper, 'upgrade' an existing installation,
'patch' an existing installation, 'admin' utilities, or 'createPatch' for Grouper developers
(enter: 'install', 'upgrade', 'patch', 'admin', 'createPatch' or blank for the default) [install]: admin
What admin action do you want to do (manage, upgradeTask)? : manage
Enter in the Grouper install directory (note: better if no spaces or special chars): C:/temp/temp/grouperInstaller
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : database
What database action do you want to perform? stop, start, restart, status? : status
grouper.hibernate.properties read from: C:\temp\temp\grouperInstaller\grouper.apiBinary-2.3.0\conf\grouper.hibernate.properties
Database URL (hibernate.connection.url from grouper.hibernate.properties) is: jdbc:hsqldb:hsql://localhost:9001/grouper
Trying query: SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
Database could not be connected to from Java. Perhaps it is down or there is a network problem?
Do you want to see the stacktrace from the connection error? (t|f) [f]: 
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : database
What database action do you want to perform? stop, start, restart, status? : start
grouper.hibernate.properties read from: C:\temp\temp\grouperInstaller\grouper.apiBinary-2.3.0\conf\grouper.hibernate.properties
Database URL (hibernate.connection.url from grouper.hibernate.properties) is: jdbc:hsqldb:hsql://localhost:9001/grouper
Starting DB with command: C:\dev_inst\java7\bin\java -cp C:\temp\temp\grouperInstaller\grouper.apiBinary-2.3.0\lib\jdbcSamples\hsqldb.jar org.hsqldb.Server -database.0 file:C:\temp\temp\grouperInstaller\grouper.apiBinary-2.3.0\grouper -dbname.0 grouper -port 9001
Success: database is up, connection successful.
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : database
What database action do you want to perform? stop, start, restart, status? : status
grouper.hibernate.properties read from: C:\temp\temp\grouperInstaller\grouper.apiBinary-2.3.0\conf\grouper.hibernate.properties
Database URL (hibernate.connection.url from grouper.hibernate.properties) is: jdbc:hsqldb:hsql://localhost:9001/grouper
Trying query: SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
Database is up and connection from Java successful.
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : database
What database action do you want to perform? stop, start, restart, status? : stop
grouper.hibernate.properties read from: C:\temp\temp\grouperInstaller\grouper.apiBinary-2.3.0\conf\grouper.hibernate.properties
Database URL (hibernate.connection.url from grouper.hibernate.properties) is: jdbc:hsqldb:hsql://localhost:9001/grouper
Shutting down HSQL before starting it by sending the SQL: SHUTDOWN
Success: database is down.
Press <enter> to continue or type 'exit' to end: exit


Admin - manage - services - tomcat

java –jar grouperInstaller.jar
Do you want to 'install' a new installation of grouper, 'upgrade' an existing installation,
'patch' an existing installation, 'admin' utilities, or 'createPatch' for Grouper developers
(enter: 'install', 'upgrade', 'patch', 'admin', 'createPatch' or blank for the default) [install]: admin
What admin action do you want to do (manage, upgradeTask)? : manage
Enter in the Grouper install directory (note: better if no spaces or special chars) : C:/temp/temp/grouperInstaller
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : tomcat
What tomcat action do you want to perform? stop, start, restart, status? : start
Enter the default IP address for checking ports (just hit enter to accept the default unless on a machine with no network, might want to change to 127.0.0.1): [0.0.0.0]:
##################################
Tomcat start with command (note you need CATALINA_HOME and JAVA_HOME set):
C:\temp\temp\grouperInstaller\apache-tomcat-6.0.35\bin\startup.bat

End tomcat start (note: logs are in C:\temp\temp\grouperInstaller\apache-tomcat-6.0.35\logs)
##################################
Should we check ports to see if tomcat was able to start (t|f)? [t]: 
Waiting for tomcat to start...
Tomcat listening on port: 8700
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : tomcat
What tomcat action do you want to perform? stop, start, restart, status? : status
Enter the default IP address for checking ports (just hit enter to accept the default unless on a machine with no network, might want to change to 127.0.0.1): [0.0.0.0]: 
Tomcat is running. It is detected to be listening on port: 8700
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : tomcat
What tomcat action do you want to perform? stop, start, restart, status? : stop
Enter the default IP address for checking ports (just hit enter to accept the default unless on a machine with no network, might want to change to 127.0.0.1): [0.0.0.0]:

##################################
Tomcat stop with command (note you need CATALINA_HOME and JAVA_HOME set):
C:\temp\temp\grouperInstaller\apache-tomcat-6.0.35\bin\shutdown.bat

End tomcat stop (note: logs are in C:\temp\temp\grouperInstaller\apache-tomcat-6.0.35\logs)
##################################
Should we check ports to see if tomcat was able to stop (t|f)? [t]: 
Waiting for tomcat to stop...
Tomcat not listening on port: 8700
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : tomcat
What tomcat action do you want to perform? stop, start, restart, status? : status
Enter the default IP address for checking ports (just hit enter to accept the default unless on a machine with no network, might want to change to 127.0.0.1): [0.0.0.0]: 
Tomcat is stopped. It is not detected to be listening on port: 8700
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : exit


Admin - manage - services - grouperDaemon

[appadmin@i2midev1 grouperInstaller]$ java -jar grouperInstaller.jar 

Do you want to 'install' a new installation of grouper, 'upgrade' an existing installation,
'patch' an existing installation, 'admin' utilities, or 'createPatch' for Grouper developers
(enter: 'install', 'upgrade', 'patch', 'admin', 'createPatch' or blank for the default) [install]: admin
What admin action do you want to do (manage, upgradeTask)? : manage
Enter in the Grouper install directory (note: better if no spaces or special chars) [/tmp/grouperInstaller]: 
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : grouperDaemon
What grouperDaemon action do you want to perform? stop, start, restart, status? : status
In unix you should have a /etc/init.d or launchctl script which manages the grouper daemon (see details on wiki).
If you have a service configured please enter name or <enter> to continue without a service: 
Using shell command: bash
Finding the grouper daemon process with: bash -c "/bin/ps -ef | /bin/grep /tmp/grouperInstaller/grouper.apiBinary-2.3.0/bin/gsh | /bin/grep -- -loader | /bin/grep -v grep"
Grouper loader is running, here is the process output:
appadmin 1900 1 0 22:06 pts/0 00:00:00 /bin/sh /tmp/grouperInstaller/grouper.apiBinary-2.3.0/bin/gsh.sh -loader
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : grouperDaemon
What grouperDaemon action do you want to perform? stop, start, restart, status? : stop
In unix you should have a /etc/init.d or launchctl script which manages the grouper daemon (see details on wiki).
If you have a service configured please enter name or <enter> to continue without a service: 
Stopping the grouper daemon is not an exact science, be careful!
This script will find the process id of the daemon and kill it. Make it is correct!
Finding the grouper daemon process with: bash -c "/bin/ps -ef | /bin/grep /tmp/grouperInstaller/grouper.apiBinary-2.3.0/bin/gsh | /bin/grep -- -loader | /bin/grep -v grep"
The command to kill the daemon is: /bin/kill -KILL 1900
Found pid 1900, do you want this script to kill it? (t|f) [t]: 
Finding the grouper daemon process with: bash -c "/bin/ps -ef | /bin/grep /tmp/grouperInstaller/grouper.apiBinary-2.3.0/bin/gsh | /bin/grep -- -loader | /bin/grep -v grep"
Cannot find the grouper daemon process, it is not running
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : grouperDaemon
What grouperDaemon action do you want to perform? stop, start, restart, status? : status
In unix you should have a /etc/init.d or launchctl script which manages the grouper daemon (see details on wiki).
If you have a service configured please enter name or <enter> to continue without a service: 
Finding the grouper daemon process with: bash -c "/bin/ps -ef | /bin/grep /tmp/grouperInstaller/grouper.apiBinary-2.3.0/bin/gsh | /bin/grep -- -loader | /bin/grep -v grep"
Cannot find the grouper daemon process, it is not running
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : grouperDaemon
What grouperDaemon action do you want to perform? stop, start, restart, status? : start
In unix you should have a /etc/init.d or launchctl script which manages the grouper daemon (see details on wiki).
If you have a service configured please enter name or <enter> to continue without a service:
##################################
Starting the Grouper loader (daemons): bash -c "nohup /tmp/grouperInstaller/grouper.apiBinary-2.3.0/bin/gsh.sh -loader > /dev/null 2>&1 &"

End starting the Grouper loader (daemons)
##################################
Finding the grouper daemon process with: bash -c "/bin/ps -ef | /bin/grep /tmp/grouperInstaller/grouper.apiBinary-2.3.0/bin/gsh | /bin/grep -- -loader | /bin/grep -v grep"
Grouper loader is running, here is the process output:
appadmin 2920 1 0 22:13 pts/0 00:00:00 /bin/sh /tmp/grouperInstaller/grouper.apiBinary-2.3.0/bin/gsh.sh -loader
Press <enter> to continue or type 'exit' to end:
What do you want to manage (logs, services, back, exit)? : services
What service do you want to manage? database, tomcat, grouperDaemon? : grouperDaemon
What grouperDaemon action do you want to perform? stop, start, restart, status? : status
In unix you should have a /etc/init.d or launchctl script which manages the grouper daemon (see details on wiki).
If you have a service configured please enter name or <enter> to continue without a service: 
Finding the grouper daemon process with: bash -c "/bin/ps -ef | /bin/grep /tmp/grouperInstaller/grouper.apiBinary-2.3.0/bin/gsh | /bin/grep -- -loader | /bin/grep -v grep"
Grouper loader is running, here is the process output:
appadmin 2920 1 0 22:13 pts/0 00:00:00 /bin/sh /tmp/grouperInstaller/grouper.apiBinary-2.3.0/bin/gsh.sh -loader
Press <enter> to continue or type 'exit' to end: exit
[appadmin@i2midev1 grouperInstaller]$



Admin - Upgrade - Convert ehcache XML to properties

[appadmin@i2midev1 patchesAuto]$ java -jar grouperInstaller.jar
Do you want to 'install' a new installation of grouper, 'upgrade' an existing installation,
  'patch' an existing installation, 'admin' utilities, or 'createPatch' for Grouper developers
  (enter: 'install', 'upgrade', 'patch', 'admin', 'createPatch' or blank for the default) [install]: admin
What admin action do you want to do (manage, upgradeTask)? : upgradeTask
What upgrade task do you want to do (convertEhcacheXmlToProperties)? : convertEhcacheXmlToProperties
Note, you need to convert the ehcache.xml file for each Grouper runtime, e.g. loader, WS, UI.
Note, you need to be running Grouper 2.3.0 with API patch 35 installed.
Enter the location of the ehcache.xml file: /opt/tomcats/tomcat_f/webapps/grouper_v2_3/WEB-INF/classes/ehcache.xml
Enter the location of the grouper.cache.base.properties file [/opt/tomcats/tomcat_f/webapps/grouper_v2_3/WEB-INF/classes/grouper.cache.base.properties]:
Enter the location of the grouper.cache.properties file (to be created)  [/opt/tomcats/tomcat_f/webapps/grouper_v2_3/WEB-INF/classes/grouper.cache.properties]:
File was written: /opt/tomcats/tomcat_f/webapps/grouper_v2_3/WEB-INF/classes/grouper.cache.properties


sdf







sdf

  • No labels

2 Comments

  1. Interesting idea, but I'd rather see it implemented as part of the Grouper UI (something only etc:wheel can use) rather than a CLI type thing.

  2. Import-export functionality, especially if it supports importing/exporting a particular folder and does not rely on UUIDs since those are internal and may not be the same across Grouper instances. Folder/group ID path, subject ID or identifier are human-readable, more transportable, and could even be generated by a script.