跳到主要内容

thrift 安装

安装 git

centos6.5上编译安装 git 时候报错:

In file included from http.c:1:
http.h:6:23: warning: curl/curl.h: no such file or directory
http.h:7:23: warning: curl/easy.h: no such file or directory
In file included from http.c:1:
http.h:46: error: expected specifier-qualifier-list before ‘CURLcode’
http.h:51: error: expected specifier-qualifier-list before ‘CURL’
http.h:97: error: ‘CURL_ERROR_SIZE’ undeclared here (not in a function)
http.h: In function ‘missing__target’:
http.h:102: error: ‘CURLE_FILE_COULDNT_READ_FILE’ undeclared (first use in this function)
http.h:102: error: (Each undeclared identifier is reported only once
http.h:102: error: for each function it appears in.)
http.h:104: error: ‘CURLE_HTTP_NOT_FOUND’ undeclared (first use in this function)

解决方法是安装相关依赖:

yum install perl-ExtUtils-MakeMaker.x86_64
yum install libcurl-devel.x86_64
yum install expat-devel.x86_64

安装 zookeeper

# zkServer.sh start
JMX enabled by default
Using config: /usr/local/zk/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
  1. 打开zkServer.sh 找到

STAT=`echo stat | nc localhost $(grep clientPort "$ZOOCFG" | sed -e 's/.*=//') 2> /dev/null| grep Mode

在nc与localhost之间加上 -q 1 (是数字1而不是字母l) 如果已存在则去掉,有的版本zkServer.sh脚本文件里根本没有这一行,所以没有生效

  1. 调用sh zkServer.sh status 遇到这个问题。百度,google了后发现有人是修改sh脚本里的一个nc的参数来解决,可在3.4.6的sh文件里并没有找到nc的调用。配置文档里指定的log目录没有创建导致出错,手动增加目录后重启,问题解决。 注:我想不是日志的问题所以这个方法根本就没有试

  2. 创建数据目录,也就是在你zoo.cfg配置文件里dataDir指定的那个目录下创建myid文件,并且指定id, 改id为你zoo.cfg文件中server.1=localhost:2887:3887中的1.只要在myid头部写入1即可.

  3. 而其他两个节点却是现实正常;最后检查配置zoo.cfg配置发现是该节点的主机名写错了; 先停止三个节点zookeeper服务,逐一的修改节点上zoo.cfg配置文件,在逐一的启动 ,结果显示正常;

  4. 另外一个是说端口号匹配问题造成的,方案地址

问题 出现ERROR: Can't get master address from ZooKeeper; znode data == null解决办法