Merge remote-tracking branch 'origin/master' into simulator_dev

This commit is contained in:
Christopher Ronnewinkel (D036654)
2013-07-16 16:19:44 +02:00
29 changed files with 260 additions and 51 deletions
+43 -5
View File
@@ -379,11 +379,21 @@ if [[ "$@" == "install" ]] || [[ "$@" == "all" ]]; then
# make sure to save the information from env.sh
. $ACDIR/env.sh
echo "$VERSION_INFO-$MONGODB_PORT-$MEMORY-$REPLICATION_CHANNEL" > $ACDIR/configuration/jetty/version.txt
echo "$VERSION_INFO System:" > $ACDIR/configuration/jetty/version.txt
sed -i "s/mongo.port=.*$/mongo.port=$MONGODB_PORT/g" $ACDIR/configuration/config.ini
sed -i "s/expedition.udp.port=.*$/expedition.udp.port=$EXPEDITION_PORT/g" $ACDIR/configuration/config.ini
sed -i "s/replication.exchangeName=.*$/replication.exchangeName=$REPLICATION_CHANNEL/g" $ACDIR/configuration/config.ini
# When a server is installed using this script
# then we no longer define important options in
# config.ini because this is generated by product
# installer. Instead we inject these properties
# using system properties. This works because
# context.getProperty() searches for system properties
# if it can't find them in config.ini (framework config)
sed -i "/mongo.host/d" $ACDIR/configuration/config.ini
sed -i "/mongo.port/d" $ACDIR/configuration/config.ini
sed -i "/expedition.udp.port/d" $ACDIR/configuration/config.ini
sed -i "/replication.exchangeName/d" $ACDIR/configuration/config.ini
sed -i "/replication.exchangeHost/d" $ACDIR/configuration/config.ini
sed -i "s/^.*jetty.port.*$/<Set name=\"port\"><Property name=\"jetty.port\" default=\"$SERVER_PORT\"\/><\/Set>/g" $ACDIR/configuration/jetty/etc/jetty.xml
echo "I have read the following configuration from $ACDIR/env.sh:"
echo "SERVER_NAME: $SERVER_NAME"
@@ -391,7 +401,9 @@ if [[ "$@" == "install" ]] || [[ "$@" == "all" ]]; then
echo "MEMORY: $MEMORY"
echo "TELNET_PORT: $TELNET_PORT"
echo "MONGODB_PORT: $MONGODB_PORT"
echo "MONGODB_HOST: $MONGODB_HOST"
echo "EXPEDITION_PORT: $EXPEDITION_PORT"
echo "REPLICATION_HOST: $REPLICATION_HOST"
echo "REPLICATION_CHANNEL: $REPLICATION_CHANNEL"
echo ""
@@ -418,6 +430,30 @@ if [[ "$@" == "remote-deploy" ]]; then
exit;;
esac
$SSH_CMD "test -d $REMOTE_SERVER/plugins"
if [[ $? -eq 1 ]]; then
echo "Did not find directory $REMOTE_SERVER/plugins - assuming empty server that needs to be initialized! Using data from $PROJECT_HOME"
$SSH_CMD "mkdir -p $REMOTE_SERVER/plugins"
$SSH_CMD "mkdir -p $REMOTE_SERVER/logs"
$SSH_CMD "mkdir -p $REMOTE_SERVER/tmp"
$SSH_CMD "mkdir -p $REMOTE_SERVER/configuration/jetty/etc"
$SCP_CMD $p2PluginRepository/configuration/config.ini $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/
$SCP_CMD $PROJECT_HOME/java/target/configuration/jetty/etc/jetty.xml $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/jetty/etc
$SCP_CMD $PROJECT_HOME/java/target/configuration/jetty/etc/realm.properties $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/jetty/etc
$SCP_CMD $PROJECT_HOME/java/target/configuration/monitoring.properties $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/
$SCP_CMD $PROJECT_HOME/java/target/env.sh $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/
$SCP_CMD $PROJECT_HOME/java/target/start $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/
$SCP_CMD $PROJECT_HOME/java/target/stop $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/
$SCP_CMD $PROJECT_HOME/java/target/status $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/
$SCP_CMD $PROJECT_HOME/java/target/udpmirror $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/
$SCP_CMD $PROJECT_HOME/java/target/http2udpmirror $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/
$SCP_CMD $PROJECT_HOME/java/target/configuration/logging.properties $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/
fi
echo ""
echo "Starting deployment to $REMOTE_HOME/$SERVER..."
@@ -428,7 +464,7 @@ if [[ "$@" == "remote-deploy" ]]; then
$SCP_CMD $p2PluginRepository/configuration/org.eclipse.equinox.simpleconfigurator $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/
$SCP_CMD $p2PluginRepository/plugins/*.jar $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/plugins/
echo "$VERSION_INFO-remotedly-deployed" > /tmp/version-remote-deploy.txt
echo "$VERSION_INFO System: remotedly-deployed" > /tmp/version-remote-deploy.txt
$SCP_CMD /tmp/version-remote-deploy.txt $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/jetty/version.txt
rm /tmp/version-remote-deploy.txt
@@ -460,3 +496,5 @@ if [[ "$@" == "deploy-startpage" ]]; then
cp $PROJECT_HOME/java/com.sap.sailing.www/index.html $TARGET_DIR_STARTPAGE
echo "OK"
fi
echo "Operation finished at `date`"
Regular → Executable
+9 -8
View File
@@ -6,14 +6,15 @@ for PORT in $MONGOPORTS
do
MONGOEXPORT="/opt/mongodb/bin/mongoexport --port $PORT -d winddb"
echo $MONGOEXPORT
$MONGOEXPORT -c EVENTS > EVENTS.json
$MONGOEXPORT -c LEADERBOARD_GROUPS > LEADERBOARD_GROUPS.json
$MONGOEXPORT -c LEADERBOARDS > LEADERBOARDS.json
$MONGOEXPORT -c RACE_LOGS > RACE_LOGS.json
$MONGOEXPORT -c REGATTA_FOR_RACE_ID > REGATTA_FOR_RACE_ID.json
$MONGOEXPORT -c REGATTAS > REGATTAS.json
$MONGOEXPORT -c TRACTRAC_CONFIGURATIONS > TRACTRAC_CONFIGURATIONS.json
$MONGOEXPORT -c WIND_TRACKS > WIND_TRACKS.json
$MONGOEXPORT -c EVENTS > EVENTS-$PORT.json
$MONGOEXPORT -c LEADERBOARD_GROUPS > LEADERBOARD_GROUPS-$PORT.json
$MONGOEXPORT -c LEADERBOARDS > LEADERBOARDS-$PORT.json
$MONGOEXPORT -c RACE_LOGS > RACE_LOGS-$PORT.json
$MONGOEXPORT -c REGATTA_FOR_RACE_ID > REGATTA_FOR_RACE_ID-$PORT.json
$MONGOEXPORT -c REGATTAS > REGATTAS-$PORT.json
$MONGOEXPORT -c TRACTRAC_CONFIGURATIONS > TRACTRAC_CONFIGURATIONS-$PORT.json
echo "Exporting wind data... (can take a loooong time)"
$MONGOEXPORT -c WIND_TRACKS > WIND_TRACKS-$PORT.json
done
echo "Compressing..."
Regular → Executable
+10 -4
View File
@@ -1,6 +1,12 @@
#!/bin/bash
MONGOPORTS=$@
MONGOIMPORT="/opt/mongodb/bin/mongoexport --port $PORT -d winddb"
MONGOPORT=$@
MONGOIMPORT="/opt/mongodb/bin/mongoimport --upsert --port $MONGOPORT -d winddb"
echo "Importing data to $MONOGPORTS..."
for i in *.json; do c=`basename $i .json`; $MONGOIMPORT --upsert --port $MONGOPORT -d winddb -c $c $i; done
echo "Uncompressing data..."
tar xvzf exported.tar.gz
echo "Importing data to $MONOGPORT..."
for i in *-$MONGOPORT.json; do
c=`basename $i .json`;
echo "$MONGOIMPORT -c $c $i"
$MONGOIMPORT -c $c $i;
done
@@ -8,9 +8,6 @@
<launcherArgs>
<programArgs>-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console -clean</programArgs>
<vmArgs>-Declipse.ignoreApp=true -Dosgi.noShutdown=true
-Xmx1024m -Djetty.home=configuration/jetty
-XX:+UseMembar</vmArgs>
</launcherArgs>
<windowImages/>
@@ -69,10 +66,7 @@
<plugin id="org.eclipse.jetty.xml" autoStart="true" startLevel="4" />
<plugin id="org.mortbay.jetty.util" autoStart="true" startLevel="4" />
<property name="eclipse.ignoreApp" value="true" />
<property name="expedition.udp.port" value="2010" />
<property name="mongo.port" value="10200" />
<property name="osgi.noShutdown" value="true" />
<property name="replication.exchangeName" value="sapsailinganalytics-dev" />
</configurations>
</product>
@@ -35,6 +35,7 @@ import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.view.client.ListDataProvider;
import com.google.gwt.view.client.MultiSelectionModel;
import com.google.gwt.view.client.ProvidesKey;
import com.google.gwt.view.client.SelectionChangeEvent;
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
import com.sap.sailing.gwt.ui.adminconsole.LeaderboardConfigPanel.AnchorCell;
@@ -424,7 +425,7 @@ public class LeaderboardGroupConfigPanel extends AbstractRegattaPanel implements
}
if (Window.confirm(messageBuilder.toString())) {
removeGroups(groupsSelectionModel.getSelectedSet());
removeLeaderboardGroups(groupsSelectionModel.getSelectedSet());
}
}
});
@@ -505,7 +506,13 @@ public class LeaderboardGroupConfigPanel extends AbstractRegattaPanel implements
groupsTable.addColumn(groupActionsColumn, stringMessages.actions());
groupsTable.addColumnSortHandler(leaderboardGroupsListHandler);
groupsSelectionModel = new MultiSelectionModel<LeaderboardGroupDTO>();
ProvidesKey<LeaderboardGroupDTO> groupsKeyProvider = new ProvidesKey<LeaderboardGroupDTO>() {
@Override
public Object getKey(LeaderboardGroupDTO group) {
return group.getName();
}
};
groupsSelectionModel = new MultiSelectionModel<LeaderboardGroupDTO>(groupsKeyProvider);
groupsSelectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
@@ -682,7 +689,7 @@ public class LeaderboardGroupConfigPanel extends AbstractRegattaPanel implements
});
}
private void removeGroups(final Collection<LeaderboardGroupDTO> groups) {
private void removeLeaderboardGroups(final Collection<LeaderboardGroupDTO> groups) {
if (!groups.isEmpty()) {
Set<String> groupNames = new HashSet<String>();
for (LeaderboardGroupDTO group : groups) {
@@ -705,7 +712,9 @@ public class LeaderboardGroupConfigPanel extends AbstractRegattaPanel implements
}
private void removeLeaderboardGroup(final LeaderboardGroupDTO group) {
sailingService.removeLeaderboardGroups(Collections.singleton(group.getName()), new AsyncCallback<Void>() {
Set<String> groups = new HashSet<String>();
groups.add(group.getName());
sailingService.removeLeaderboardGroups(groups, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable t) {
errorReporter.reportError("Error trying to remove leaderboard group " + group.getName() + ": "
@@ -795,7 +804,7 @@ public class LeaderboardGroupConfigPanel extends AbstractRegattaPanel implements
}
private void moveToGroup() {
LeaderboardGroupDTO selectedGroup = getSelectedGroup();
final LeaderboardGroupDTO selectedGroup = getSelectedGroup();
ArrayList<StrippedLeaderboardDTO> selectedLeaderboards = new ArrayList<StrippedLeaderboardDTO>(leaderboardsSelectionModel.getSelectedSet());
if (isSingleGroupSelected && selectedGroup != null && selectedLeaderboards != null && !selectedLeaderboards.isEmpty()) {
Collections.sort(selectedLeaderboards, new Comparator<StrippedLeaderboardDTO>() {
@@ -18,15 +18,15 @@ import com.sap.sailing.resultimport.ResultUrlRegistry;
import com.sap.sailing.xrr.resultimport.ParserFactory;
public class Activator implements BundleActivator {
// private static String MANAGE2SAIL_TEST_URL = "https://orm.manage2sail.com/shadowtest_info/api/public/links/event/58f73e6c-ec07-4655-972c-e5d730f0048e?accesstoken=bDAv8CwsTM94ujZ&mediaType=json";
private static String MANAGE2SAIL_PROD_URL = "http://manage2sail.com/api/public/links/event/da33884e-24fe-44f6-8501-d253587f7cc8?accesstoken=bDAv8CwsTM94ujZ&mediaType=json";
// private static String MANAGE2SAIL_KIELWEEK_2013_URL = "http://manage2sail.com/api/public/links/event/da33884e-24fe-44f6-8501-d253587f7cc8?accesstoken=bDAv8CwsTM94ujZ&mediaType=json";
private static String MANAGE2SAIL_TW_2013_URL = "http://manage2sail.com/api/public/links/event/937a5c0a-5a28-4a07-806a-8c8ec1efc85c?accesstoken=bDAv8CwsTM94ujZ&mediaType=json";
public void start(BundleContext bundleContext) throws Exception {
final ScoreCorrectionProviderImpl service = new ScoreCorrectionProviderImpl(ParserFactory.INSTANCE, ResultUrlRegistry.INSTANCE);
bundleContext.registerService(ScoreCorrectionProvider.class, service, /* properties */null);
// ResultUrlRegistry.INSTANCE.registerResultUrl(ScoreCorrectionProviderImpl.NAME, new URL(MANAGE2SAIL_TEST_URL));
ResultUrlRegistry.INSTANCE.registerResultUrl(ScoreCorrectionProviderImpl.NAME, new URL(MANAGE2SAIL_PROD_URL));
// ResultUrlRegistry.INSTANCE.registerResultUrl(ScoreCorrectionProviderImpl.NAME, new URL(MANAGE2SAIL_KIELWEEK_2013_URL));
ResultUrlRegistry.INSTANCE.registerResultUrl(ScoreCorrectionProviderImpl.NAME, new URL(MANAGE2SAIL_TW_2013_URL));
createAnAllCertificatesTrustingManagerforSSL();
}
@@ -66,6 +66,5 @@ public class Activator implements BundleActivator {
// Install the all-trusting host verifier
HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
}
}
}
@@ -73,6 +73,7 @@ public abstract class AbstractServerReplicationTest {
protected Pair<ReplicationServiceTestImpl, ReplicationMasterDescriptor> basicSetUp(
boolean dropDB, RacingEventServiceImpl master, RacingEventServiceImpl replica) throws IOException, InterruptedException {
final String exchangeName = "test-sapsailinganalytics-exchange";
final String exchangeHost = "localhost";
final UUID serverUuid = UUID.randomUUID();
final MongoDBService mongoDBService = MongoDBService.INSTANCE;
if (dropDB) {
@@ -90,11 +91,11 @@ public abstract class AbstractServerReplicationTest {
this.replica = new RacingEventServiceImpl(mongoDBService);
}
ReplicationInstancesManager rim = new ReplicationInstancesManager();
masterReplicator = new ReplicationServiceImpl(exchangeName, rim, this.master);
masterReplicator = new ReplicationServiceImpl(exchangeName, exchangeHost, rim, this.master);
replicaDescriptor = new ReplicaDescriptor(InetAddress.getLocalHost(), serverUuid, "");
masterReplicator.registerReplica(replicaDescriptor);
masterDescriptor = new ReplicationMasterDescriptorImpl("localhost", exchangeName, SERVLET_PORT, 0, UUID.randomUUID().toString());
ReplicationServiceTestImpl replicaReplicator = new ReplicationServiceTestImpl(exchangeName, resolveAgainst, rim,
ReplicationServiceTestImpl replicaReplicator = new ReplicationServiceTestImpl(exchangeName, exchangeHost, resolveAgainst, rim,
replicaDescriptor, this.replica, this.master, masterReplicator, masterDescriptor);
Pair<ReplicationServiceTestImpl, ReplicationMasterDescriptor> result = new Pair<>(replicaReplicator, masterDescriptor);
replicaReplicator.startInitialLoadTransmissionServlet();
@@ -128,12 +129,12 @@ public abstract class AbstractServerReplicationTest {
private final ReplicationService masterReplicationService;
private final ReplicationMasterDescriptor masterDescriptor;
public ReplicationServiceTestImpl(String exchangeName, DomainFactory resolveAgainst,
public ReplicationServiceTestImpl(String exchangeName, String exchangeHost, DomainFactory resolveAgainst,
ReplicationInstancesManager replicationInstancesManager, ReplicaDescriptor replicaDescriptor,
RacingEventService replica, RacingEventService master, ReplicationService masterReplicationService,
ReplicationMasterDescriptor masterDescriptor)
throws IOException {
super(exchangeName, replicationInstancesManager, replica);
super(exchangeName, exchangeHost, replicationInstancesManager, replica);
this.resolveAgainst = resolveAgainst;
this.replicaDescriptor = replicaDescriptor;
this.master = master;
@@ -11,6 +11,7 @@ public class Activator implements BundleActivator {
private static final Logger logger = Logger.getLogger(Activator.class.getName());
private static final String PROPERTY_NAME_EXCHANGE_NAME = "replication.exchangeName";
private static final String PROPERTY_NAME_EXCHANGE_HOST = "replication.exchangeHost";
private ReplicationInstancesManager replicationInstancesManager;
@@ -19,11 +20,15 @@ public class Activator implements BundleActivator {
public void start(BundleContext bundleContext) throws Exception {
defaultContext = bundleContext;
String exchangeName = bundleContext.getProperty(PROPERTY_NAME_EXCHANGE_NAME);
String exchangeHost = bundleContext.getProperty(PROPERTY_NAME_EXCHANGE_HOST);
if (exchangeName == null) {
exchangeName = "sapsailinganalytics";
}
if (exchangeHost == null) {
exchangeHost = "localhost";
}
replicationInstancesManager = new ReplicationInstancesManager();
ReplicationService serverReplicationMasterService = new ReplicationServiceImpl(exchangeName, replicationInstancesManager);
ReplicationService serverReplicationMasterService = new ReplicationServiceImpl(exchangeName, exchangeHost, replicationInstancesManager);
bundleContext.registerService(ReplicationService.class, serverReplicationMasterService, null);
logger.info("Registered replication service "+serverReplicationMasterService+" using exchange name "+exchangeName);
}
@@ -71,6 +71,7 @@ public class ReplicationServiceImpl implements ReplicationService, OperationExec
* serialized form. Clients need to know this name to be able to bind their queues to the exchange.
*/
private final String exchangeName;
private final String exchangeHost;
/**
* UUID that identifies this server
@@ -80,7 +81,7 @@ public class ReplicationServiceImpl implements ReplicationService, OperationExec
private Replicator replicator;
private Thread replicatorThread;
public ReplicationServiceImpl(String exchangeName, final ReplicationInstancesManager replicationInstancesManager) throws IOException {
public ReplicationServiceImpl(String exchangeName, String exchangeHost, final ReplicationInstancesManager replicationInstancesManager) throws IOException {
this.replicationInstancesManager = replicationInstancesManager;
replicaUUIDs = new HashMap<ReplicationMasterDescriptor, String>();
racingEventServiceTracker = new ServiceTracker<RacingEventService, RacingEventService>(
@@ -88,6 +89,7 @@ public class ReplicationServiceImpl implements ReplicationService, OperationExec
racingEventServiceTracker.open();
localService = null;
this.exchangeName = exchangeName;
this.exchangeHost = exchangeHost;
replicator = null;
serverUUID = UUID.randomUUID();
logger.info("Setting " + serverUUID.toString() + " as unique replication identifier.");
@@ -98,20 +100,21 @@ public class ReplicationServiceImpl implements ReplicationService, OperationExec
* an OSGi service tracker to discover the {@link RacingEventService}, the service to replicate is "injected" here.
* @param exchangeName the name of the exchange to which replicas can bind
*/
public ReplicationServiceImpl(String exchangeName,
public ReplicationServiceImpl(String exchangeName, String exchangeHost,
final ReplicationInstancesManager replicationInstancesManager, RacingEventService localService) throws IOException {
this.replicationInstancesManager = replicationInstancesManager;
replicaUUIDs = new HashMap<ReplicationMasterDescriptor, String>(); // XXX why is this a map? there should be only one connection to a master
this.localService = localService;
this.exchangeName = exchangeName;
this.exchangeHost = exchangeHost;
replicator = null;
serverUUID = UUID.randomUUID();
logger.info("Setting " + serverUUID.toString() + " as unique replication identifier.");
}
private Channel createMasterChannel(String exchangeName) throws IOException {
private Channel createMasterChannel(String exchangeName, String exchangeHost) throws IOException {
final ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("localhost"); // ...and use default port
connectionFactory.setHost(exchangeHost); // ...and use default port
Channel result = null;
try {
@@ -144,7 +147,7 @@ public class ReplicationServiceImpl implements ReplicationService, OperationExec
addAsListenerToRacingEventService();
synchronized (this) {
if (masterChannel == null) {
masterChannel = createMasterChannel(exchangeName);
masterChannel = createMasterChannel(exchangeName, exchangeHost);
}
}
}
@@ -0,0 +1,30 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Travemünder Woche 2013 Links</title>
</head>
<body>
<h3>Travemünder Woche 2013 Links</h3>
<table>
<tr><td><a href="http://tw2013.sapsailing.com">SAP Sailing Analytics</a></td></tr>
<tr><td><a href="http://tw2013.sapsailing.com/gwt/AdminConsole.html">Administration Console</a></td></tr>
<tr><td><a href="http://tw2013.sapsailing.com/gwt/RegattaOverview.html?event=b0a721cf-89c3-486c-9a84-25e1aaeb3225">Regatta Overview</a></td></tr>
<tr><td><a href="http://manage2sail.com/api/public/links/event/937a5c0a-5a28-4a07-806a-8c8ec1efc85c?accesstoken=bDAv8CwsTM94ujZ&mediaType=json">Manage2Sail result import (JSON)</a></td></tr>
<tr><td><a href="http://livecenter.travemuender-woche.com/">Travemünder Woche Live Center</a></td></tr>
<tr><td><a href="http://tw2013.sapsailing.com/sailingserver/expeditionWindStatus">Expedition Wind Status Servlet</a></td></tr>
<tr><td><a href="https://docs.google.com/spreadsheet/ccc?key=0AmMcAB8qg_dzdHJpX3dLaTFKTFlVTXlIOHd3cWhuaVE&usp=sharing">Regatta Name Mapping</a></td></tr>
<tr><td><a href="http://manage2sail.com/de-DE/event/937a5c0a-5a28-4a07-806a-8c8ec1efc85c/">Official Results (Manage2Sail)</a></td></tr>
</table>
<h3>Leaderboard Groups</h3>
<table>
<tr><td><a href="http://tw2013.sapsailing.com/gwt/Spectator.html?leaderboardGroupName=Travem%C3%BCnder%20Woche%202013&showRaceDetails=true&canReplayDuringLiveRaces=true">All Leaderboards</a></td></tr>
<tr><td><a href="http://tw2013.sapsailing.com/gwt/Spectator.html?leaderboardGroupName=Travem%C3%BCnder%20Woche%202013%20-%20Championships&showRaceDetails=true&canReplayDuringLiveRaces=true">International - Championships</a></td></tr>
<tr><td><a href="http://tw2013.sapsailing.com/gwt/Spectator.html?leaderboardGroupName=Travem%C3%BCnder%20Woche%202013%20-%20International%20classes&showRaceDetails=true&canReplayDuringLiveRaces=true">International classes</a></td></tr>
<tr><td><a href="http://tw2013.sapsailing.com/gwt/Spectator.html?leaderboardGroupName=Travem%C3%BCnder%20Woche%202013%20-%20Offshore%20classes&showRaceDetails=true&canReplayDuringLiveRaces=true">Offshore</a></td></tr>
<tr><td><a href="http://tw2013.sapsailing.com/gwt/Spectator.html?leaderboardGroupName=Travem%C3%BCnder%20Woche%202013%20-%20Trave%20Races&showRaceDetails=true&canReplayDuringLiveRaces=true">Trave Races</a></td></tr>
</table>
</body>
</html>
@@ -10,5 +10,6 @@ bin.includes = META-INF/,\
webfonts/,\
mobile.css,\
site.css,\
KW2013/
KW2013/,\
TW2013/
output.. = WEB-INF/classes/
+23 -1
View File
@@ -4,15 +4,37 @@ SERVER_NAME=MASTER
MEMORY="1024m"
# Queue Host and Name of the queue where to
# send messages for replicas (this server is master)
REPLICATION_HOST=localhost
REPLICATION_CHANNEL=sapsailinganalytics-master
TELNET_PORT=14888
SERVER_PORT=8888
MONGODB_HOST=localhost
MONGODB_PORT=27017
EXPEDITION_PORT=2010
# Start replication upon startup
REPLICATE_ON_START=False
REPLICATE_MASTER_SERVLET_HOST=
REPLICATE_MASTER_SERVLET_PORT=
REPLICATE_MASTER_QUEUE_HOST=
REPLICATE_MASTER_QUEUE_PORT=
ADDITIONAL_JAVA_ARGS="-XX:+UseMembar"
JAVA_HOME=$HOME/jdk1.7.0_02
echo "Setting JAVA_HOME to $JAVA_HOME"
# Make it possible to overwrite configuration
# by using user-data that is injected into an instance
ON_AMAZON=`command -v ec2-metadata`
if [[ ! -z "$ON_AMAZON" ]]; then
echo "This server is running on Amazon. Following data is being used (based on user-data injected into instance):"
VARS=$(ec2-metadata -d | sed "s/user-data\: //g")
for var in $VARS; do
echo $var
export $var
done
fi
+24 -1
View File
@@ -27,7 +27,30 @@ LIB_DIR=`pwd`/native-libraries
echo "Script directory is $scriptdir and LIB_DIR is $LIB_DIR"
nohup $JAVA_BINARY $ADDITIONAL_JAVA_ARGS -D$SERVER_NAME -Dcom.sap.sailing.server.name=$SERVER_NAME -Djava.io.tmpdir=`pwd`/tmp -Dfile.encoding=cp1252 -Djetty.home=$scriptdir/configuration/jetty -Djava.util.logging.config.file=$scriptdir/configuration/logging.properties -Djava.library.path=$LIB_DIR -Xmx$MEMORY -jar plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar -console $TELNET_PORT -configuration ./ -clean 2>/dev/null >/dev/null &
# Make really sure that parameters from config.ini are not used
sed -i "/mongo.host/d" ./configuration/config.ini
sed -i "/mongo.port/d" ./configuration/config.ini
sed -i "/expedition.udp.port/d" ./configuration/config.ini
sed -i "/replication.exchangeName/d" ./configuration/config.ini
sed -i "/replication.exchangeHost/d" ./configuration/config.ini
# Ensure that Jetty Port is set correctly
sed -i "s/^.*jetty.port.*$/<Set name=\"port\"><Property name=\"jetty.port\" default=\"$SERVER_PORT\"\/><\/Set>/g" ./configuration/jetty/etc/jetty.xml
# Update monitoring with the right ports
sed -i "s/127.0.0.1:[0-9][0-9][0-9][0-9]\//127.0.0.1:$SERVER_PORT\//g" ./configuration/monitoring.properties
# Inject information for system
HEAD_DATE=$(date "+%Y%m%d%H%M")
sed -i "s/System:.*$/ System: $MONGODB_HOST:$MONGODB_PORT-$EXPEDITION_PORT-$REPLICATION_HOST\/$REPLICATION_CHANNEL Started: $HEAD_DATE/g" ./configuration/jetty/version.txt
# Apply app parameters from env.sh
APP_PARAMETERS="-Dmongo.host=$MONGODB_HOST -Dmongo.port=$MONGODB_PORT -Dexpedition.udp.port=$EXPEDITION_PORT -Dreplication.exchangeHost=$REPLICATION_HOST -Dreplication.exchangeName=$REPLICATION_CHANNEL"
# Apply parameters for automatic replication start
REPLICATION_PARAMETERS="-Dreplication.start=$REPLICATE_ON_START -Dreplicate.master.servlet.host=$REPLICATE_MASTER_SERVLET_HOST -Dreplicate.master.servlet.port=$REPLICATE_MASTER_SERVLET_PORT -Dreplicate.master.queue.host=$REPLICATE_MASTER_QUEUE_HOST -Dreplicate.master.queue.port=$REPLICATE_MASTER_QUEUE_PORT"
nohup $JAVA_BINARY -D$SERVER_NAME $ADDITIONAL_JAVA_ARGS -Dcom.sap.sailing.server.name=$SERVER_NAME $APP_PARAMETERS $REPLICATION_PARAMETERS -Djava.io.tmpdir=`pwd`/tmp -Dfile.encoding=cp1252 -Djetty.home=$scriptdir/configuration/jetty -Djava.util.logging.config.file=$scriptdir/configuration/logging.properties -Djava.library.path=$LIB_DIR -Xmx$MEMORY -jar plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar -console $TELNET_PORT -configuration ./ -clean 2>/dev/null >/dev/null &
echo "Starting server..."
sleep 2
@@ -0,0 +1,79 @@
# Create a new Amazon app instance
The following screenshots will help you creating a new Amazon application instance. An application instance is the container for exactly one Java application server. Each instance is configured using so called "user data". This configuration will then be read by the java server.
## AMI Selection
In the "Classic Wizard" select "My AMIs"
<img src="/wiki/images/amazon/StartInstance1.JPG" width="70%" height="70%"/>
Make sure to select the AMI with the name "App"
<img src="/wiki/images/amazon/StartInstance2.JPG" width="70%" height="70%"/>
Select a subnet that matches the one of the database server
<img src="/wiki/images/amazon/StartInstance3.JPG" width="70%" height="70%"/>
Select the correct instance type. Micro also works if you don't want to put that much load on your server.
<img src="/wiki/images/amazon/StartInstance4.JPG" width="70%" height="70%"/>
Leave Kernel and RAM disk to Default. Then put the configuration for this server into the text area labeled "User Data". This configuration should at least contain `MONGODB_*` and `REPLICATION_*` parameters. Here one example:
<pre>
SERVER_NAME=LIVE1
MEMORY=1024m
REPLICATION_HOST=172.31.25.253
REPLICATION_CHANNEL=sapsailinganalytics-live
TELNET_PORT=14888
SERVER_PORT=8888
MONGODB_HOST=172.31.25.253
MONGODB_PORT=10202
EXPEDITION_PORT=2010
REPLICATE_ON_START=False
REPLICATE_MASTER_SERVLET_HOST=
REPLICATE_MASTER_SERVLET_PORT=
REPLICATE_MASTER_QUEUE_HOST=
REPLICATE_MASTER_QUEUE_PORT=
</pre>
It does not really matter which SERVER_PORTS you use because there is only one app per instance. But this makes it easier to configure instances for Apache, a Load Balancer or other uses. If you want to create a cluster that is self-replicating and has a load balancer in front of it then make sure that all your instances are running on the same port.
<img src="/wiki/images/amazon/StartInstance5.JPG" width="70%" height="70%"/>
Use a new interface for your Network. Do not change any other field.
<img src="/wiki/images/amazon/StartInstance6.JPG" width="70%" height="70%"/>
Now make sure to click on the "Edit" button
<img src="/wiki/images/amazon/StartInstance7.JPG" width="70%" height="70%"/>
In order to select "Delete on Termination" for your root volume
<img src="/wiki/images/amazon/StartInstance8.JPG" width="70%" height="70%"/>
Then give your instance a meaningful name by inserting a value for the tag "Name"
<img src="/wiki/images/amazon/StartInstance9.JPG" width="70%" height="70%"/>
Use the existing "Administrator" Key. Do NOT generate your own key - this won't work. In order to access instances you should've got two private keys. If not then contact one of the administrators.
<img src="/wiki/images/amazon/StartInstance10.JPG" width="70%" height="70%"/>
Then select the preconfigured security group "Sailing Analytics App". Do NOT select anything other than that or create your own.
<img src="/wiki/images/amazon/StartInstance11.JPG" width="70%" height="70%"/>
Your instance is now launching. You can create alarms if you want to monitor the state of the application. Be aware that monitoring is costy.
<img src="/wiki/images/amazon/StartInstance12.JPG" width="70%" height="70%"/>
Your application is now ready. Check that everything is green.
<img src="/wiki/images/amazon/StartInstance13.JPG" width="70%" height="70%"/>
You can access the application server by using the DNS and the port you've configured.
<img src="/wiki/images/amazon/StartInstance14.JPG" width="70%" height="70%"/>
+1 -3
View File
@@ -1,5 +1,3 @@
# Amazon EC2 for SAP
- URL: https://skyesapicl.hana.ondemand.com/skye/
- IO: 135676 - Project Travel Exp. Technology Sponsors.
- Instance: RHEL
[[Creating a new application instance|wiki/amazon-ec2-create-new-app-instance]]
Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB