Apache Zookeeper 下载安装
Apache ZooKeeper 是一个开发和维护开源服务器的项目,它支持高度可靠的分布式协调。
下载地址
zookeeper-3.4.14 下载地址
https://mirrors.bfsu.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz
遇到过的问题
Zookeeper 3.5 启动时 8080 端口被占用
通过查阅 Zookeeper3.5 的官方文档,发现这是 Zookeeper3.5 的新特性:
1 | New in 3.5.0: The AdminServer is an embedded Jetty server that provides an HTTP interface to the four letter word commands. By default, the server is started on port 8080, and commands are issued by going to the URL "/commands/[command name]", e.g., http://localhost:8080/commands/stat. The command response is returned as JSON. Unlike the original protocol, commands are not restricted to four-letter names, and commands can have multiple names; for instance, "stmk" can also be referred to as "set_trace_mask". To view a list of all available commands, point a browser to the URL /commands (e.g., http://localhost:8080/commands). See the AdminServer configuration options for how to change the port and URLs. |
这是 Zookeeper AdminServer,默认使用 8080 端口,它的配置属性如下:

我们可以修改在 zoo.cfg 中修改 AdminServer 的端口:
1 | admin.serverPort=8888 |
保存后,再次启动,Zookeeper 启动成功。
这是 zookeeper 自己搞了一个简易应用服务器,可以查看一些信息
Linux-服务器上建立用户并分配权限
whoami
要查看当前登录用户的用户名
who am i
表示打开当前伪终端的用户的用户名
创建用户
useradd 只创建用户,创建完了用 passwd xxx 去设置新用户的密码。
修改密码
passwd 命令是 password 这个英语单词的缩写,表示“密码”
删除用户
deluser newname
Linux-环境变量与文件查找
Shell 变量
使用 declare 命令创建一个变量名为 tmp 的变量:declare tmp
其实也可以不用 declare 预声明一个变量,直接即用即创建,这里只是告诉你 declare 的作用,这在创建其它指定类型的变量(如数组)时会用到。
使用 = 号赋值运算符,将变量 tmp 赋值为 shiyanlou。注意,与其他语言不同的是, Shell 中的赋值操作,= 两边不可以输入空格,否则会报错。