Author: challngr Date: Mon Nov 16 22:32:39 2015 New Revision: 1714697 URL: http://svn.apache.org/viewvc?rev=1714697&view=rev Log: UIMA-4577 Allow jmx port, xmx, and 'new' memory to be specified via ducc.properties.
Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/db_create uima/sandbox/uima-ducc/trunk/src/main/admin/ducc.py uima/sandbox/uima-ducc/trunk/src/main/resources/cassandra-env.sh uima/sandbox/uima-ducc/trunk/src/main/resources/default.ducc.properties Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/db_create URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/db_create?rev=1714697&r1=1714696&r2=1714697&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/src/main/admin/db_create (original) +++ uima/sandbox/uima-ducc/trunk/src/main/admin/db_create Mon Nov 16 22:32:39 2015 @@ -101,6 +101,10 @@ class DbCreate(DuccUtil): site_props_name = self.DUCC_HOME + '/resources/site.ducc.properties' ducc_site_properties.load(site_props_name) ducc_site_properties.put('ducc.database.host', db_node); + ducc_site_properties.put('ducc.service.persistence.impl', 'org.apache.uima.ducc.database.StateServicesDb' , ['# Service manager persistence']) + ducc_site_properties.put('ducc.job.history.impl' , 'org.apache.uima.ducc.database.HistoryManagerDb' , ['# History and checkpoint']) + ducc_site_properties.put('ducc.rm.persistence.impl' , 'org.apache.uima.ducc.database.RmStatePersistence', ['# RM state persistence']) + # if we don't die before this we need to enable db in site.ducc.properties and set the # db password into resources.private/ducc.private.properties ducc_site_properties.write(site_props_name) @@ -108,6 +112,7 @@ class DbCreate(DuccUtil): private_props_name = self.DUCC_HOME + '/resources.private/ducc.private.properties' private_properties = Properties() private_properties.load(private_props_name) + private_properties.delete('db_password') private_properties.put('db_password', self.database_pw, ['#Db password']); private_properties.write(private_props_name) Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/ducc.py URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/ducc.py?rev=1714697&r1=1714696&r2=1714697&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/src/main/admin/ducc.py (original) +++ uima/sandbox/uima-ducc/trunk/src/main/admin/ducc.py Mon Nov 16 22:32:39 2015 @@ -49,6 +49,22 @@ class Ducc(DuccUtil): return here = os.getcwd() + + xmx = self.ducc_properties.get('ducc.database.mem.heap') + new = self.ducc_properties.get('ducc.database.mem.new') + + if ( not ( xmx == None and new == None ) ): # if either is set + if ( xmx == None or new == None ) : # then both must be set + print "Database properties ducc.database.mem.heap and ducc.database.mem.new must both be set." + print 'NOTOK' + return + os.environ['MAX_HEAP_SIZE'] = xmx + os.environ['HEAP_NEWSIZE'] = new + + jmxport = self.ducc_properties.get('ducc.database.jmx.port') + if ( jmxport != None ): + os.environ['JMX_PORT'] = jmxport + os.chdir(self.DUCC_HOME + "/cassandra-server") pidfile = self.DUCC_HOME + '/state/cassandra.pid' CMD = "bin/cassandra -p "+ pidfile + " > /dev/null 2>&1" Modified: uima/sandbox/uima-ducc/trunk/src/main/resources/cassandra-env.sh URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/resources/cassandra-env.sh?rev=1714697&r1=1714696&r2=1714697&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/src/main/resources/cassandra-env.sh (original) +++ uima/sandbox/uima-ducc/trunk/src/main/resources/cassandra-env.sh Mon Nov 16 22:32:39 2015 @@ -162,10 +162,15 @@ then export MALLOC_ARENA_MAX=4 fi + # Specifies the default port over which Cassandra will be available for # JMX connections. # For security reasons, you should not expose this port to the internet. Firewall it if needed. -JMX_PORT="7199" +# DUCC: this allows the port to be set externally via ducc.properties +if [ "x$JMX_PORT" = "x" ] +then + JMX_PORT="7199" +fi # Here we create the arguments that will get passed to the jvm when Modified: uima/sandbox/uima-ducc/trunk/src/main/resources/default.ducc.properties URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/resources/default.ducc.properties?rev=1714697&r1=1714696&r2=1714697&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/src/main/resources/default.ducc.properties (original) +++ uima/sandbox/uima-ducc/trunk/src/main/resources/default.ducc.properties Mon Nov 16 22:32:39 2015 @@ -152,7 +152,6 @@ ducc.rm.jvm.args = -Xmx1G ducc.pm.jvm.args = -Xmx1G ducc.sm.jvm.args = -Xmx1G ducc.ws.jvm.args = -Xmx2G -Djava.util.Arrays.useLegacyMergeSort=true -ducc.database.jvm.args = -Xmx8G -Dstorage.useWAL=false -Dstorage.diskCache.bufferSize=8192 -Dtx.useLog=false # ========== General Configuration block ========== @@ -519,6 +518,29 @@ ducc.database.host = --disabl # Name of the database with active state. Svc registry, etc. ducc.state.database.url = ${ducc.head} +# Database JMX port. This is ONLY available from ducc.database.host for security reasons. +ducc.database.jmx.port = 7199 + +#----------------------------------- +# DATABASE MEMORY TUNING +# WARNING: if you're not sure what these do you should probably not change them as incorrect +# values can adversly affect the database, the database node, or both. +# Given that. If you're running on a mostly small system, e.g. 8GB or less, probably you +# should set ducc.database.mem.heap to 1 or 2 GB and ducc.database.mem.new to 100M +# +# By default we allow cassandra to calculate these for us. +# +# IMPORTANT: if you set one of these you MUST set both, or cassandra will refuse to start. +#----------------------------------- +# Database xmx. If not set, cassandra will calculate it for you. +#ducc.database.mem.heap = 4G +# Database setting for 'young' generation. If not set, cassandra will calculate it for you +#ducc.database.mem.new = 100M +#----------------------------------- +k# END OF DATABASE MEMORY TUNING +#----------------------------------- + + # This class implementes the persistence interface for the services registry #ducc.service.persistence.impl = org.apache.uima.ducc.database.StateServicesDb ducc.service.persistence.impl = org.apache.uima.ducc.common.persistence.services.StateServices