Created
April 5, 2012 20:37
-
-
Save shouichi/2313905 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
*.class | |
data/ | |
out |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This gist is for verifying zookeeper-3.3.4 on JPF. | |
Run "make run" to run on normal JVM, "make" to run on JPF. | |
Please edit Makefile and site.properties fiels and set correct paths of JPF and net-iocache. |
This file contains hidden or 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
# | |
# 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=DEBUG | |
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout | |
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-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=DEBUG | |
log4j.appender.ROLLINGFILE.File=zookeeper.log | |
# 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} - %-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_trace.log | |
log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout | |
### Notice we are including log4j's NDC here (%x) | |
log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L][%x] - %m%n |
This file contains hidden or 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
RM=rm -f | |
JAVAC=javac | |
JAVAC_FLAGS=-g | |
JAVA=java | |
JAVA_FLAGS=-ea | |
CLASSPATH=zookeeper-3.3.4.jar:log4j-1.2.16.jar:. | |
JPF=~/jpf/jpf-core/bin/jpf | |
MAIN=SUT.java | |
CLASS=$(MAIN:.java=.class) | |
CONF_FILE=$(MAIN:.java=.jpf) | |
all: jpf | |
run: $(CLASS) | |
$(JAVA) $(JAVA_FLAGS) -cp $(CLASSPATH) `basename $< .class` | |
jpf: $(CLASS) $(CONF_FILE) | |
$(JPF) $(CONF_FILE) | tee out | |
.SUFFIXES: | |
.SUFFIXES: .java .class | |
.java.class: | |
$(JAVAC) $(JAFAC_FLAG) -cp $(CLASSPATH) $< | |
.PHONY: clean | |
clean: | |
$(RM) *.class |
This file contains hidden or 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
2 |
This file contains hidden or 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
1 |
This file contains hidden or 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
tickTime=2000 | |
initLimit=10 | |
syncLimit=5 | |
dataDir=data/peer | |
clientPort=11227 | |
electionAlg=3 | |
server.1=127.0.0.1:11221:11224 | |
server.2=127.0.0.1:11222:11225 |
This file contains hidden or 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
#!/bin/sh | |
CLASSPATH=zookeeper-3.3.4.jar.original:log4j-1.2.16.jar:. | |
java -cp $CLASSPATH org.apache.zookeeper.server.quorum.QuorumPeerMain conf/peer.cfg |
This file contains hidden or 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
jpf-core = ${user.home}/jpf/jpf-core | |
net-iocache = ${user.home}/jpf/net-iocache | |
#concurrent = ${user.home}/jpf/concurrent | |
#bfs = ${user.home}/jpf/bfs | |
extensions = ${jpf-core},${net-iocache},${concurrent},${bfs} |
This file contains hidden or 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
tickTime=2000 | |
initLimit=10 | |
syncLimit=5 | |
dataDir=data/sut | |
clientPort=11228 | |
electionAlg=3 | |
server.1=127.0.0.1:11221:11224 | |
server.2=127.0.0.1:11222:11225 |
This file contains hidden or 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
import java.io.*; | |
import java.net.*; | |
import org.apache.zookeeper.server.*; | |
import org.apache.zookeeper.server.quorum.*; | |
import org.apache.zookeeper.server.persistence.*;; | |
public class SUT extends QuorumPeerMain { | |
public static void main(String[] args) { | |
args = new String[] { "conf/sut.cfg" }; | |
try { | |
SUT main = new SUT(); | |
main.initializeAndRun(args); | |
} | |
catch (Exception e) { | |
System.exit(1); | |
} | |
} | |
} |
This file contains hidden or 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
zk=. | |
zk.classpath=zookeeper-3.3.4.jar:log4j.jar:. | |
zk.sourcepath=. | |
site=site.properties | |
target=SUT | |
jpf-net-iocache.boot.peer.command=./peer.sh |
View raw
(Sorry about that, but we can’t show files that are this big right now.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment