无法写入PID安装Zookeeper [英] FAILED TO WRITE PID installing Zookeeper

查看:94
本文介绍了无法写入PID安装Zookeeper的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Zookeeper的新手,安装并运行它确实是一个问题.我不确定这是哪里出了问题,但我将解释我正在做的事情以使其更清楚:

I am new to Zookeeper and it has being a real issue to install it and run. I am not sure what is wrong in here but I will explain what I've being doing to make it more clear:

1.-我遵循了Apache提供的安装指南.这意味着下载Zookeeper发行版(稳定发行版)会提取文件并移至主目录.

1.- I've followed the installation guide provided by Apache. This means download the Zookeeper distribution (stable release) extracted the file and moved into the home directory.

2.-当我使用Ubuntu 12.04时,我已经修改了.bashrc文件,其中包括:

2.- As I am using Ubuntu 12.04 I've modified the .bashrc file including this:

export ZOOKEEPER_INSTALL=/home/myusername/zookeeper-3.4.5
export PATH=$PATH:$ZOOKEEPER_INSTALL/bin

3.-在conf/zoo.cfg上创建一个配置文件

3.- Create a config file on conf/zoo.cfg

tickTime=2000
dataDir=/var/zookeeper
clientPort=2181

并尝试:

dataDir=/var/log/zookeeper

dataDir=/var/bin/zookeeper

4.-运行启动命令时

4.- When running the start command

zkServer.sh start or `bin/zkServer.sh start` nothing happens and always returns this

JMX enabled by default
Using config: /home/sasuke/zookeeper-3.4.5/bin/../conf/zoo.cfg
mkdir: cannot create directory `/var/zookeeper': Permission denied
Starting zookeeper ... /home/sasuke/zookeeper-3.4.5/bin/zkServer.sh: line 113: /var/zookeeper/zookeeper_server.pid: No such file or directory
FAILED TO WRITE PID

我已经安装了Java,在zookeper目录中有一个zookeeper.jar文件,我认为它没有运行.在此处检查stackoverflow时,有个人说他可以在键入后运行zookeeper.

I have Java installed and inside the zookeper directory there is a zookeeper.jar file that I think it's not running. Checking here on stackoverflow there was a guy that said he could run zookeeper after typing

ssh localhost

但是当我尝试这样做时,会出现此错误

But when I try to do it I get this error

ssh: connect to host localhost port 22: Connection refused

请帮助.我在这里试图解决它太久了.

Please help. I've being here trying to solve it for too long.

动物园管理员入门指南: http://zookeeper.apache.org/doc/r3.1.2/zookeeperStarted.html以前的案例是通过shh localhost解决的 Zookeeper:无法写入PID

Getting started guide of zookeeper: http://zookeeper.apache.org/doc/r3.1.2/zookeeperStarted.html Previous case solved with the shh localhost Zookeeper: FAILED TO WRITE PID

更新:日志的权限为:

drwxr-xr-x 19 root root     4096 Oct 10 07:52 log

对于动物园管理员:

drwxr-xr-x  2 zookeeper         zookeeper    4096 Mar 23  2012 zookeeper

我应该更改其中的任何一个吗?

Should I change any of these?

推荐答案

似乎您没有所需的权限./var/log 所有者将是root.Zookeeper将进程ID和数据快照存储在该目录中.生成的Zookeeper服务器的进程ID存储在文件- zookeeper_server.pid (自3.3.6起)中

It seems you do not have the required permissions. The /var/log owner is is going to be root. Zookeeper stores the process id and snapshot of data in that directory. The process id of the spawned zookeeper server is stored in a file -zookeeper_server.pid (as of 3.3.6)

如果您具有root特权,则可以使用 sudo (root)特权启动zookeeper,它应该可以工作,但绝对不建议这样做.确保以与目录所有者相同(或更高)的权限启动Zookeeper.

If you have root previleges, you could start zookeeper with sudo (root) previleges, it should work but definitely not recommended. Make sure you start zookeeper with the same(or higher) permissions as the owner of the directory.

在您的主文件夹中创建一个新目录,例如/home/username/zookeeper-data .让 dataDir 指向该目录,它应该可以工作.

Create a new directory in your home folder like /home/username/zookeeper-data. Let dataDir point to that directory and it should work.

这篇关于无法写入PID安装Zookeeper的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆