Open eubnara opened 6 years ago
bin $ pwd
/Users/yubi.lee/workspace/zk/zookeeper-3.4.11/bin
bin $ ls ../conf/
configuration.xsl log4j.properties zoo.cfg zoo_sample.cfg
bin $ cat ../conf/zoo.cfg
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
bin $ ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /Users/yubi.lee/workspace/zk/zookeeper-3.4.11/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
$ ./zkCli.sh -server localhost:2181
[zk: localhost:2181(CONNECTED) 0]
$ ./configure --sbin-path=/Users/yubi.lee/workspace/nginx --prefix=/Users/yubi.lee/workspace/nginx --conf-path=/Users/yubi.lee/workspace/nginx/conf/nginx.conf --pid-path=/Users/yubi.lee/workspace/nginx/pid/nginx.pid --with-stream
$ ./make
$ ./objs/nginx
events {
worker_connections 1024;
}
stream {
server {
listen 8080;
proxy_pass localhost:2181; // zookeeper
}
}
$ ./zkCli.sh -server localhost:8080
[zk: localhost:8080(CONNECTED) 0] ls /
[zookeeper]
[zk: localhost:8080(CONNECTED) 1] ls /
[zookeeper]
[zk: localhost:8080(CONNECTED) 2] ls /zookeeper
[quota]
[zk: localhost:8080(CONNECTED) 3] ls /zookeeper/quota
[]
service discovery
reverse proxy