Skip to content

Commit

Permalink
added files to configure zookeeper and its config file inside the con…
Browse files Browse the repository at this point in the history
…tainer
  • Loading branch information
vanmellebenjamin committed Apr 16, 2015
1 parent c1722ff commit f0130ae
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 9 deletions.
1 change: 0 additions & 1 deletion roq-deployment/ansible/templates/zoo.cfg.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tickTime={{zk_tick_time}}
tickTime={{zk_tick_time}}
dataDir={{zk_data_dir}}
dataLogDir={{zk_log_dir}}
clientPort={{zk_client_port}}
Expand Down
2 changes: 1 addition & 1 deletion roq-deployment/docker/zookeeper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ WORKDIR /opt/zookeeper
VOLUME ["/opt/zookeeper/conf", "/tmp/zookeeper"]

ENTRYPOINT ["/opt/zookeeper/bin/zkServer.sh"]
CMD ["start-foreground"]
CMD ["start-foreground"
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,12 @@ public void launchHCM() throws Exception {
*/
public void launchZK() throws Exception {
logger.info("Starting ZK container");
final ImmutableList.Builder<String> binds = new ImmutableList.Builder<String>();
binds.add(System.getenv("ROQPATH") + "/roq-simulation/src/main/resources/zkConfig" + ":/opt/zookeeper/conf");
HostConfig.Builder hostConfig = HostConfig.builder().networkMode("bridge").binds(binds.build());

ContainerCreation creation = client.createContainer(configZK);
client.startContainer(creation.id());
client.startContainer(creation.id(), hostConfig.build());

ZKList.add(creation.id());
logger.info(creation.id());
Expand Down
4 changes: 2 additions & 2 deletions roq-simulation/src/main/resources/GCM-docker.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#host settings
#Tue Apr 14 00:15:32 CEST 2015
#Thu Apr 16 14:03:06 CEST 2015
hcmTIMEOUT=5000
zk.servers=172.17.0.74
zk.servers=172.17.0.50
cloud.gateway=192.168.0.1
period=60000
monitor.replication.factor=3
Expand Down
6 changes: 3 additions & 3 deletions roq-simulation/src/main/resources/HCM-docker.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#host settings
#Tue Apr 14 00:15:32 CEST 2015
#Thu Apr 16 14:03:06 CEST 2015
monitor.HBPeriod=5000
monitor.stat.period=60000
zk.address=172.17.0.74
zk.address=172.17.0.50
monitor.maxtimetostart=40
exchange.max.perhost=3
localstate.path=/tmp/hcmlocaldb
Expand All @@ -17,5 +17,5 @@ monitor.timeout=20
exchange.base.port=6000
statmonitor.base.port=5800
exchange.timeout=20
scalingProcess.HBPeriod=5000
scalingProcess.maxtimetostart=40
scalingProcess.HBPeriod=5000
25 changes: 25 additions & 0 deletions roq-simulation/src/main/resources/zkConfig/configuration.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="configuration">
<html>
<body>
<table border="1">
<tr>
<td>name</td>
<td>value</td>
<td>description</td>
</tr>
<xsl:for-each select="property">
<tr>
<td><a name="{name}"><xsl:value-of select="name"/></a></td>
<td><xsl:value-of select="value"/></td>
<td><xsl:value-of select="description"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

50 changes: 50 additions & 0 deletions roq-simulation/src/main/resources/zkConfig/log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# ZooKeeper Logging Configuration
#

# Format is "<default threshold> (, <appender>)+

# DEFAULT: console appender only
log4j.rootLogger=DEBUG

# Example with rolling log file
#log4j.rootLogger=DEBUG, CONSOLE, ROLLINGFILE

# Example with rolling log file and tracing
#log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE

#
# Log INFO level and above messages to the console
#
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n

#
# Add ROLLINGFILE to rootLogger to get log file output
# Log DEBUG level and above messages to a log file
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.file}

# Max log file size of 10MB
log4j.appender.ROLLINGFILE.MaxFileSize=10MB
# uncomment the next line to limit number of backup files
#log4j.appender.ROLLINGFILE.MaxBackupIndex=10

log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n


#
# Add TRACEFILE to rootLogger to get log file output
# Log DEBUG level and above messages to a log file
log4j.appender.TRACEFILE=org.apache.log4j.FileAppender
log4j.appender.TRACEFILE.Threshold=TRACE
log4j.appender.TRACEFILE.File=${zookeeper.tracelog.dir}/${zookeeper.tracelog.file}

log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout
### Notice we are including log4j's NDC here (%x)
log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L][%x] - %m%n

6 changes: 6 additions & 0 deletions roq-simulation/src/main/resources/zkConfig/zoo.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tickTime=1000
dataDir=/var/zookeeper
clientPort=2181
initLimit=3
syncLimit=2
server.1=localhost:2888:3888
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void onEvent(byte[] msg) {

// Create a publisher and send message in a thread
IRoQConnection connection = factory.createRoQConnection("testQ0");
MessageSender sender = new MessageSender(connection, 250);
MessageSender sender = new MessageSender(connection, 160);
Thread senderThread = new Thread(sender);
senderThread.start();

Expand Down

0 comments on commit f0130ae

Please sign in to comment.