JMX

cancel
Showing results for 
Search instead for 
Did you mean: 

JMX

resplin
Intermediate
0 0 8,925

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



3.2AdministrationLogging



Background


By default, system administrators can reconfigure Alfresco by shutting down the server, editing certain property and configuration files and then restarting the server.

However, there are certain support operations that System Administrators would like to perform on-demand at runtime without needing to restart the server. For example, it should be possible to temporarily change log levels in order to debug and/or troubleshoot a live system.

As an Enterprise Only feature, Alfresco 3.2 (and higher) provides access to contains various subsystems that may be configured and restarted via JMX without needing to restart the entire alfresco repository.

Notice: Changes made through JMX in Alfresco Enterprise 3.2 and up, are being persisted!


Introduction


The JMX interface allows System Administrators to access Alfresco Enterprise via a standard JMX console that supports JMX Remoting (JSR-160).

Example consoles include:


  • JConsole (supplied with Java SE 5.0 and higher)
  • VisualVM with MBeans plugin installed (supplied with Java SE 6 and higher)
  • MC4J
  • JManage

Some of these consoles also provide basic graphs and/or alerts for monitoring JMX managed attributes.


Features


Please refer to subsystems for server management features since Alfresco 3.2.


Connecting through JMX Consoles / JSR-160


Alfresco supports JMX Remoting (JSR-160) using Spring JMX. The Alfresco MBean server can be accessed using a suitable JMX console.

To access Alfresco JMX remotely, you will need to enter the following:


  • JMX URL:      service:jmx:rmi:///jndi/rmi://<hostname>:<registry port>/alfresco/jmxrmi
  • JMX Username: controlRole
  • JMX Password: change_asap

IMPORTANT: The default JMX password MUST be changed asap !! Refer to Repository Configuration and files:


  • <configRoot>/alfresco/alfresco-jmxrmi.access
  • <configRoot>/alfresco/alfresco-jmxrmi.password

Example URL


The JMX URLS are somewhat cryptic, here are some examples:

Alfresco Server


  • service:jmx:rmi://ignored/jndi/rmi://localhost:50500/alfresco/jmxrmi
  • service:jmx:rmi:///jndi/rmi://localhost:50500/alfresco/jmxrmi

Or any java server


  • service:jmx:rmi:///jndi/rmi://localhost:50500/jmxrmi

Alfresco virtualisation server


  • service:jmx:rmi://ignored/jndi/rmi://127-0-0-1.ip.alfrescodemo.net:50510/alfresco/jmxrmi

JConsole (example)


The Jconsole application is provided with Sun JDKs.

For more details refer to JConsole

To use Jconsole locally you need to be using a Sun JVM and specify the following option in the Java command line -Dcom.sun.management.jmxremote=true to run Alfresco.   

For example if you are using tomcat you may add it to <Tomcat Home>/bin/catalina.bat

Then start alfresco.

Then start jconsole by running <Java Home>/bin/jconsole.

To use Jconsole remotely you need to use one of the URLs from above.

Note: the example screenshot maybe out-of-date with respect to latest managed attributes/operations.

800px


Visual VM with MBeans plugin (example)


The Visual VM is provided with Sun JDKs.

To see the MBeans tab,  you will need also need to install the MBeans plugin.


MC4J (example)


For more details refer to MC4J

1000px

Note: the example screenshot maybe slightly out-of-date with respect to latest managed attributes/operations.


JManage (example)


For more details refer to JManage

Note: the example screenshot maybe out-of-date with respect to latest managed attributes/operations.

800px


JMXplorer (example)


For more details refer to JMXplorer

Note: the example screenshot maybe out-of-date with respect to latest managed attributes/operations.

800px


Alfresco JMX (pre 3.2)


Note: This section is pre 3.2 and should be removed and/or archived to a separate page.


Change Management


Notice: Changes made through JMX in Alfresco Enterprise 3.2 and up, are being persisted!

Any dynamic changes made via the JMX interface are intended to be transient (pre 3.2) such as changing a log level temporarily. Hence, these changes will be lost after a server restart. If certain dynamic changes need to also be persisted (so that they survive a server restart) then they should also be applied to the appropriate configuration file, where applicable.

For example:


  • log level change - edit log4j.properties on the classpath
  • max users - edit custom repository properties file (server.maxusers property)
  • singe-user mode - edit custom repository properties file (server.singleuseronly.name property)
  • read-only mode - edit custom transaction properties file (server.transaction.allow-writes property)
  • disable/enable file servers (FTP/CIFS/NFS) - edit custom file servers config xml file

Interface Summary


Logging


Uses Log4J's HierarchyDynamicMBean

Note: This is not cluster-aware. If needed, the log level change will need to be applied to each machine. Some consoles (e.g. JManage) may provide basic facilities for accessing each machine in an application cluster.

Editable Attributes


  • dynamic list of loggers with logLevel attribute - can change to ERROR, WARN, INFO, DEBUG (editable)

Operations with Impact


  • addLoggerMBean - add logger, if it has been loaded

File Server Config


Note: This is not cluster-aware. If more than one file server is running (eg. load-balanced FTP) then the change will need to be applied to each machine. Some consoles (e.g. JManage) may provide basic facilities for accessing each machine in an application cluster.

Editable Attributes


  • ftpEnabled - true = enable FTP server, false = disable FTP server
  • cifsEnabled - true = enable CIFS server, false = disable CIFS server
  • nfsEnabled - true = enable NFS server, false = disable NFS server

Non-Editable Attributes


  • cifsServerName - get CIFS server name, if available
  • cifsServerAddress - (not implemented)

Repo Server Management


Note: The managed attributes/operations below are cluster-aware. The editable attributes were replaced by the sysAdmin Subsystem in v3.2.

Editable Attributes


  • readOnly - - set repository transaction mode - true = READONLY, false = WRITABLE
  • singleUserOnly - set single username (eg. 'admin') or blank to disable single user mode and allow all usernames
  • maxUsers - limit for non-expired user logins, -1 if no limit set, 0 to prevent further logins
  • linkValidationDisabled - disable or re-enabled link validation service

Non-Editable Attributes


  • ticketCountNonExpired - count of non-expired tickets
  • ticketCountAll - count of all tickets, including non-expired
  • userCountNonExpired - count of non-expired users
  • userCountAll - count of all users, including non-expired

Operations with Impact


  • invalidateTicketsExpired - invalidate expired tickets only
  • invalidateTicketsAll - invalidate all tickets, expired and non-expired
  • invalidateUser - invalidate all tickets for given username

Operations with No Impact


  • listUserNamesNonExpired - return set of non-expired usernames
  • listUserNamesAll - return set of all usernames, expired and non-expired

Virt Server Registry


This is used directly by the Alfresco Virtualization Server