标签:准备 服务 increase timeout ase support firewall iat containe
一.准备工作tar -zxvf zookeeper-3.4.10.tar.gz
cd /ZK_HOME
cp zoo_sample.cfg zoo.cfg
---如果是单机环境部署,可以直接通过此命令启动.
---ZK的启动参数有: {start|start-foreground|stop|restart|status|upgrade|print-cmd}
./zkServer.sh start
server.1=192.168.100.10:2888:3181
server.2=192.168.100.11:2888:3181
server.3=192.168.100.12:2888:3181
# 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
server.1=192.168.100.10:2888:3181
server.2=192.168.100.11:2888:3181
server.3=192.168.100.12:2888:3181
dataDir=/tmp/zookeeper
cd /tmp
mkdir /zookeeper
vim myid
---通过vim设置myid
-- 启动zookeeper
./zkServer.sh start
-- 查看运行状态
./zkServer.sh status
zkCli.sh -server 192.168.100.10:2181,192.168.100.11:2181,192.168.100.12:2181
2017-08-19 01:48:03,042 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT
2017-08-19 01:48:03,057 [myid:] - INFO [main:Environment@100] - Client environment:host.name=localhost
2017-08-19 01:48:03,057 [myid:] - INFO [main:Environment@100] - Client environment:java.version=1.8.0_144
2017-08-19 01:48:03,075 [myid:] - INFO [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2017-08-19 01:48:03,076 [myid:] - INFO [main:Environment@100] - Client environment:java.home=/usr/java/jdk1.8.0_144/jre
2017-08-19 01:48:03,076 [myid:] - INFO [main:Environment@100] - Client environment:java.class.path=/lcf-tools/zookeeper-3.4.10/bin/../build/classes:/lcf-tools/zookeeper-3.4.10/bin/../build/lib/*.jar:/lcf-tools/zookeeper-3.4.10/bin/../lib/slf4j-log4j12-1.6.1.jar:/lcf-tools/zookeeper-3.4.10/bin/../lib/slf4j-api-1.6.1.jar:/lcf-tools/zookeeper-3.4.10/bin/../lib/netty-3.10.5.Final.jar:/lcf-tools/zookeeper-3.4.10/bin/../lib/log4j-1.2.16.jar:/lcf-tools/zookeeper-3.4.10/bin/../lib/jline-0.9.94.jar:/lcf-tools/zookeeper-3.4.10/bin/../zookeeper-3.4.10.jar:/lcf-tools/zookeeper-3.4.10/bin/../src/java/lib/*.jar:/lcf-tools/zookeeper-3.4.10/bin/../conf:
2017-08-19 01:48:03,079 [myid:] - INFO [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2017-08-19 01:48:03,080 [myid:] - INFO [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2017-08-19 01:48:03,080 [myid:] - INFO [main:Environment@100] - Client environment:java.compiler=<NA>
2017-08-19 01:48:03,081 [myid:] - INFO [main:Environment@100] - Client environment:os.name=Linux
2017-08-19 01:48:03,081 [myid:] - INFO [main:Environment@100] - Client environment:os.arch=amd64
2017-08-19 01:48:03,081 [myid:] - INFO [main:Environment@100] - Client environment:os.version=3.10.0-514.26.2.el7.x86_64
2017-08-19 01:48:03,082 [myid:] - INFO [main:Environment@100] - Client environment:user.name=root
2017-08-19 01:48:03,082 [myid:] - INFO [main:Environment@100] - Client environment:user.home=/root
2017-08-19 01:48:03,082 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/lcf-tools/zookeeper-3.4.10/conf
2017-08-19 01:48:03,087 [myid:] - INFO [main:ZooKeeper@438] - Initiating client connection, connectString=192.168.100.10:2181,192.168.100.11:2181,192.168.100.12:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@1a86f2f1
2017-08-19 01:48:03,195 [myid:] - INFO [main-SendThread(192.168.100.10:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server 192.168.100.10/192.168.100.10:2181. Will not attempt to authenticate using SASL (unknown error)
Welcome to ZooKeeper!
JLine support is enabled
2017-08-19 01:48:03,746 [myid:] - INFO [main-SendThread(192.168.100.10:2181):ClientCnxn$SendThread@876] - Socket connection established to 192.168.100.10/192.168.100.10:2181, initiating session
[zk: 192.168.100.10:2181,192.168.100.11:2181,192.168.100.12:2181(CONNECTING) 0] 2017-08-19 01:48:04,093 [myid:] - INFO [main-SendThread(192.168.100.10:2181):ClientCnxn$SendThread@1299] - Session establishment complete on server 192.168.100.10/192.168.100.10:2181, sessionid = 0x15df975935c0000, negotiated timeout = 30000
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
bin目录
zk的可执行脚本目录,包括zk服务进程,zk客户端,等脚本。其中,.sh是Linux环境下的脚本,.cmd是Windows环境下的脚本。
conf目录
配置文件目录。zoo_sample.cfg为样例配置文件,需要修改为自己的名称,一般为zoo.cfg。log4j.properties为日志配置文件。
lib
zk依赖的包。
contrib目录
一些用于操作zk的工具包。
---------------------------------------------------------------
Ubuntu(ubuntu-12.04-desktop-amd64)
查看防火墙状态:ufw status
关闭防火墙:ufw disable
---------------------------------------------------------------
centos6.0
查看防火墙状态:service iptables status
关闭防火墙:chkconfig iptables off #开机不启动防火墙服务
--------------------------------------------------------------
centos7.0(默认是使用firewall作为防火墙,如若未改为iptables防火墙,使用以下命令查看和关闭防火墙)
查看防火墙状态:firewall-cmd --state
关闭防火墙:systemctl stop firewalld.service
-----查看端口占用------
方法一 lsof -i:端口号
方法二 netstat -tunlp|grep 端口号
-----杀掉进程---------
推荐方法 kill -s 9 3382 其中9为尽快杀掉进程的意思 3382为pid
标签:准备 服务 increase timeout ase support firewall iat containe
原文地址:http://www.cnblogs.com/LiuChunfu/p/7397350.html