-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1174 from Marketcetera/MATP-1188
MATP-1188 Create Server Installer
- Loading branch information
Showing
9 changed files
with
1,302 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/sh | ||
|
||
. "$(dirname $0)/../../setEnv.sh" | ||
|
||
app_stop() | ||
{ | ||
exit $1 | ||
} | ||
|
||
trap app_stop EXIT INT TERM | ||
|
||
APPLICATION_DIR=dare | ||
|
||
cd "${DARE_HOME}" | ||
|
||
THE_CLASSPATH=./conf | ||
for file in `ls -1 ./lib/*.jar` | ||
do | ||
THE_CLASSPATH=${THE_CLASSPATH}:${file} | ||
done | ||
|
||
rm -f dare.pid | ||
# | ||
# Set this to the log directory defined in the logger config file | ||
LOGDIR="${DARE_HOME}/logs" | ||
# Set this to the name of the stderr/stdout file you want to write for each instance | ||
LOGNAME=dareout | ||
# Set this to a relative directory to the cluster installation | ||
INSTANCE_DIR=instances | ||
# | ||
# These port values are used for day-to-day work, just make sure they are unique and leave enough room for each instance | ||
# | ||
# DARE RPC port | ||
RPC_PORT=9000 | ||
# Cluster port | ||
CLUSTER_PORT=9010 | ||
# | ||
# These values are typically the ones you'll need to change | ||
# | ||
# This port value is what web services connect to | ||
# DARE WS port | ||
WS_PORT=9020 | ||
# | ||
# This port value is what incoming FIX sessions would connect to the DARE instance | ||
DARE_ACCEPTOR_PORT=9030 | ||
# | ||
# Set this to a comma-separated list of cluster hosts | ||
CLUSTER_TCPIP_MEMBERS=127.0.0.1 | ||
# | ||
# Set this to the total number of instances you want to create, excluding the master instance | ||
TOTAL_INSTANCES=1 | ||
# | ||
# Set this to the number of milliseconds to delay between starting instances | ||
INSTANCE_START_DELAY=5000 | ||
# | ||
# Set this to the min heap size for each instance | ||
INSTANCE_XMS=4096m | ||
# Set this to the max heap size for each instance | ||
INSTANCE_XMX=4096m | ||
# | ||
java -Xms384m -Xmx512m -Xlog:gc:"${LOGDIR}/dare_gc.out" -server -Dorg.marketcetera.appDir="${METC_HOME}/${APPLICATION_DIR}"\ | ||
-XX:+UseParallelGC\ | ||
-Dlog.configurationFile="${METC_HOME}/${APPLICATION_DIR}/conf/log4j2.xml"\ | ||
-cp "${THE_CLASSPATH}"\ | ||
-Dorg.marketcetera.app=org.marketcetera.server.DareApplication\ | ||
-Dmetc.cluster.tcpip.members=${CLUSTER_TCPIP_MEMBERS}\ | ||
-Dmetc.logdir="${LOGDIR}"\ | ||
-Dmetc.logname=${LOGNAME}\ | ||
-Dmetc.total.instances=${TOTAL_INSTANCES}\ | ||
-Dmetc.instance.spring.config.location=conf/application.properties\ | ||
-Dmetc.instance.log.configurationFile=conf/log4j2.xml\ | ||
-Dmetc.instance.Xms${INSTANCE_XMS}\ | ||
-Dmetc.instance.Xmx${INSTANCE_XMX}\ | ||
-Dmetc.start.delay=${INSTANCE_START_DELAY}\ | ||
-Dmetc.port.metc.rpc.port=${RPC_PORT}\ | ||
-Dmetc.port.server.port=${WS_PORT}\ | ||
-Dmetc.port.metc.cluster.port=${CLUSTER_PORT}\ | ||
-Dmetc.port.metc.dare.acceptor.port=${DARE_ACCEPTOR_PORT}\ | ||
-Dorg.marketcetera.instanceDir=${INSTANCE_DIR}\ | ||
-Dmetc.instance.XX:+UseParallelGC\ | ||
-Dmetc.instance.Xlog:gc:"${LOGDIR}/dare_gc.out"\ | ||
-Dmetc.instance=0\ | ||
org.marketcetera.core.MultiInstanceApplicationContainer $* & | ||
retval=$? | ||
pid=$! | ||
[ ${retval} -eq 0 ] && [ ${pid} -eq ${pid} ] && echo ${pid} > dare.pid | ||
exit ${retval} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
## | ||
## Set environment variables for the Marketcetera Platform | ||
## | ||
## Future: If messages are an output of this script, then those messages | ||
## will have to be localized using resource bundles, not hard-coded. | ||
## | ||
## Author: [email protected] | ||
## Since: 1.5.0 | ||
## Version: $Id: setEnv.sh 16121 2012-01-18 22:03:10Z colin $ | ||
## | ||
|
||
# Make sure we're not the root user. | ||
if [ "$(id -u)" = "0" ]; then | ||
echo "This script must not be run as root." 1>&2 | ||
exit 1 | ||
fi | ||
|
||
export METC_HOME="${installer:sys.installationDir}" | ||
export DATA_HOME="${installer:sys.installationDir}" | ||
|
||
export DARE_HOME=${METC_HOME}/dare | ||
export PATH=${DARE_HOME}/bin:${PATH} |
17 changes: 17 additions & 0 deletions
17
packages/dare-package/src/main/sample_data/bin/startServerComponents.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
## | ||
## Start server components for the Marketcetera Platform | ||
## | ||
## Future: If messages are an output of this script, then those messages | ||
## will have to be localized using resource bundles, not hard-coded. | ||
## | ||
## Author: [email protected] | ||
## Since: 1.5.0 | ||
## Version: $Id: startServerComponents.sh 15467 2009-06-10 17:06:18Z klim $ | ||
## | ||
|
||
. "$(dirname $0)/setEnv.sh" | ||
|
||
cd "${DARE_HOME}" | ||
./bin/dare.sh |
22 changes: 22 additions & 0 deletions
22
packages/dare-package/src/main/sample_data/bin/stopServerComponents.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
## | ||
## Stop server components for the Marketcetera Platform | ||
## | ||
## Future: If messages are an output of this script, then those messages | ||
## will have to be localized using resource bundles, not hard-coded. | ||
## | ||
## Author: [email protected] | ||
## Since: 1.5.0 | ||
## Version: $Id: stopServerComponents.sh 15403 2009-04-22 23:30:16Z klim $ | ||
## | ||
|
||
. "$(dirname $0)/setEnv.sh" | ||
|
||
cd "${DARE_HOME}" | ||
if [ -f dare.pid ] | ||
then | ||
kill `cat dare.pid` | ||
else | ||
pkill -f java | ||
fi |
186 changes: 186 additions & 0 deletions
186
packages/dare-package/src/main/sample_data/conf/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
spring.datasource.pool-size=30 | ||
spring.jpa.hibernate.use-new-id-generator-mappings=true | ||
spring.jpa.show-sql=false | ||
spring.jpa.generate-ddl=false | ||
spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy | ||
spring.jpa.hibernate.ddl-auto=validate | ||
spring.jpa.properties.javax.persistence.schema-generation.create-source=metadata | ||
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true | ||
spring.flyway.enabled=true | ||
# | ||
# Marketcetera platform settings | ||
# | ||
# hostname for socket connections | ||
metc.ws.hostname=0.0.0.0 | ||
# interval in seconds at which to record metrics | ||
metc.metric.service.log.reporter.interval=10 | ||
# list of classes that can be marshaled to and from XML | ||
metc.xml.context.path.classes=org.marketcetera.trade.Equity,org.marketcetera.trade.Future | ||
# determines how long to delay evaluation of work units | ||
metc.cluster.work.unit.evaluation.delay=1000 | ||
# indicates how long, if at all, to delay FIX session creation from config | ||
metc.fix.session.creation.delay=10000 | ||
# | ||
# Database Settings | ||
# | ||
spring.datasource.url=${installer:jdbcUrl} | ||
spring.datasource.username=${installer:databaseUsername} | ||
spring.datasource.password=${installer:databasePassword} | ||
spring.datasource.driver-class-name=${installer:jdbcDriver} | ||
spring.flyway.locations=db/migration/${installer:flywayVendor} | ||
# | ||
# Security Settings | ||
# | ||
# number of log rounds used to compute the hash, larger is more secure but slower, min value 10 recommended | ||
metc.security.bcrypt.strength=10 | ||
# BCrypt version to use, one of {$2A,$2Y,$2B} | ||
metc.security.bcrypt.version=$2A | ||
# indicate whether client RPC calls will use SSL or not | ||
metc.security.use.ssl=false | ||
# public key path for SSL cert | ||
metc.security.ssl.public.key.path= | ||
# private key path for SSL cert | ||
metc.security.ssl.private.key.path= | ||
# | ||
# Strategy Service Settings | ||
# | ||
# interval in ms to poll the incoming strategy directory for uploaded strategies | ||
metc.strategy.incoming.directory.polling.intervalms=5000 | ||
# directory to poll for incoming strategies | ||
metc.strategy.incoming.directory=instances/strategy_incoming | ||
# directory to store strategies | ||
metc.strategy.storage.directory=instances/strategy_storage | ||
# directory to temporarily store incoming strategies | ||
metc.strategy.temporary.directory=/tmp | ||
# general provisioning directory | ||
metc.provisioning.directory=instances/provisioning | ||
# | ||
# logging settings | ||
# | ||
logging.config=conf/log4j2.xml | ||
# | ||
# FIX Session Provider | ||
# | ||
metc.fix.message.store.factory.class:org.marketcetera.fix.store.HibernateMessageStoreFactory | ||
# | ||
# initiator global session settings | ||
# | ||
fix.session-descriptors[0].settings.ConnectionType=initiator | ||
fix.session-descriptors[0].settings.HeartBtInt=30 | ||
fix.session-descriptors[0].settings.SLF4JLogHeartbeats=N | ||
fix.session-descriptors[0].settings.StartTime=00:00:00 | ||
fix.session-descriptors[0].settings.EndTime=00:00:00 | ||
fix.session-descriptors[0].settings.TimeZone=US/Pacific | ||
fix.session-descriptors[0].settings.UseDataDictionary=Y | ||
fix.session-descriptors[0].settings.ReconnectInterval=1 | ||
fix.session-descriptors[0].settings.ResetOnLogon=Y | ||
fix.session-descriptors[0].settings.ResetOnLogout=Y | ||
fix.session-descriptors[0].settings.ResetOnDisconnect=Y | ||
fix.session-descriptors[0].settings.ResetOnError=Y | ||
fix.session-descriptors[0].settings.ValidateUserDefinedFields=N | ||
fix.session-descriptors[0].settings.SLF4JLogHeartbeats=N | ||
# | ||
# initiator sessions | ||
# | ||
# initiator session 1 | ||
# | ||
fix.session-descriptors[0].sessions[0].name=Exsim Initiator1 | ||
fix.session-descriptors[0].sessions[0].description=Exsim initiator 1 | ||
fix.session-descriptors[0].sessions[0].broker-id=exsim1 | ||
fix.session-descriptors[0].sessions[0].host=exchange.marketcetera.com | ||
fix.session-descriptors[0].sessions[0].port=7001 | ||
fix.session-descriptors[0].sessions[0].enabled=true | ||
fix.session-descriptors[0].sessions[0].settings.BeginString=FIXT.1.1 | ||
fix.session-descriptors[0].sessions[0].settings.SenderCompID=${installer:senderCompId} | ||
fix.session-descriptors[0].sessions[0].settings.TargetCompID=MRKTC-EXCH | ||
fix.session-descriptors[0].sessions[0].settings.AppDataDictionary=FIX50SP2.xml | ||
fix.session-descriptors[0].sessions[0].settings.TransportDataDictionary=FIXT11.xml | ||
fix.session-descriptors[0].sessions[0].settings.DefaultApplVerID=9 | ||
# | ||
# acceptor global session settings | ||
# | ||
fix.session-descriptors[1].settings.ConnectionType=acceptor | ||
fix.session-descriptors[1].settings.SLF4JLogHeartbeats=N | ||
fix.session-descriptors[1].settings.StartTime=00:00:00 | ||
fix.session-descriptors[1].settings.EndTime=00:00:00 | ||
fix.session-descriptors[1].settings.TimeZone=US/Pacific | ||
fix.session-descriptors[1].settings.UseDataDictionary=Y | ||
fix.session-descriptors[1].settings.ReconnectInterval=1 | ||
fix.session-descriptors[1].settings.ResetOnLogon=Y | ||
fix.session-descriptors[1].settings.ResetOnLogout=Y | ||
fix.session-descriptors[1].settings.ResetOnDisconnect=Y | ||
fix.session-descriptors[1].settings.ResetOnError=Y | ||
fix.session-descriptors[1].settings.ValidateUserDefinedFields=N | ||
fix.session-descriptors[1].settings.SLF4JLogHeartbeats=N | ||
# | ||
# acceptor sessions | ||
# | ||
# acceptor session 1 | ||
# | ||
fix.session-descriptors[1].sessions[0].name=Acceptor1 | ||
fix.session-descriptors[1].sessions[0].description=Test acceptor 1 | ||
fix.session-descriptors[1].sessions[0].broker-id=acceptor1 | ||
fix.session-descriptors[1].sessions[0].enabled=true | ||
fix.session-descriptors[1].sessions[0].settings.BeginString=FIX.4.2 | ||
fix.session-descriptors[1].sessions[0].settings.DataDictionary=FIX42.xml | ||
fix.session-descriptors[1].sessions[0].settings.SenderCompID=TARGET1 | ||
fix.session-descriptors[1].sessions[0].settings.TargetCompID=MATP | ||
# | ||
# table sorting aliases | ||
# | ||
metc.persistent.report.aliases={ \ | ||
'brokerid':'brokerID', \ | ||
'user':'mActor', \ | ||
'actor':'mActor', \ | ||
'fixmessage':'mFixMessage', \ | ||
'message':'mFixMessage', \ | ||
'originator':'mOriginator', \ | ||
'reporttype':'mReportType', \ | ||
'orderid':'orderID', \ | ||
'reportid':'reportID', \ | ||
'sessionid':'sessionIdValue' \ | ||
} | ||
metc.persistent.execution.report.aliases={ \ | ||
'brokerid':'report.brokerID', \ | ||
'user':'actor', \ | ||
'actor':'actor', \ | ||
'originator':'report.mOriginator', \ | ||
'reporttype':'report.mReportType', \ | ||
'orderid':'orderId', \ | ||
'originalorderid':'origOrderID', \ | ||
'cumulativequantity':'cumQuantity', \ | ||
'averageprice':'avgPrice', \ | ||
'executiontype':'execType', \ | ||
'transacttime':'report.transactTime', \ | ||
'instrument':'securityType,symbol,optionType,expiry,strikePrice' \ | ||
} | ||
# | ||
# Exsim Market Data Adapter Configuration | ||
# | ||
metc.marketdata.exsim.senderCompId=mda-${installer:senderCompId} | ||
# target comp id value to use | ||
metc.marketdata.exsim.targetCompId=MRKTC-EXCH | ||
# hostname to connect to | ||
metc.marketdata.exsim.hostname=exchange.marketcetera.com | ||
# port to connect to | ||
metc.marketdata.exsim.port=7001 | ||
# FIX version to use for exchange traffic | ||
metc.marketdata.exsim.fixVersion=FIX.4.4 | ||
# FIX application version if using FIXT11 | ||
metc.marketdata.exsim.fixAplVersion= | ||
# interval in seconds at which to connect to the exchange | ||
metc.marketdata.exsim.reconnectInterval=5 | ||
# session heart beat interval | ||
metc.marketdata.exsim.heartBtInt=30 | ||
# session start time | ||
metc.marketdata.exsim.startTime=00:00:00 | ||
# session end time | ||
metc.marketdata.exsim.endTime=22:45:00 | ||
# session time zone | ||
metc.marketdata.exsim.timeZone=US/Pacific | ||
# session FIX dictionary | ||
metc.marketdata.exsim.dataDictionary=FIX44.xml | ||
# session FIX application data dictionary if using FIXT11 | ||
metc.marketdata.exsim.appDataDictionary= | ||
# number of milliseconds to wait for the feed to become available if a request is made while it is offline | ||
metc.marketdata.exsim.feedAvailableTimeout=10000 |
Oops, something went wrong.