系统环境:

单节点运行

Centos 7.6

确保服务器  tcp协议: 2088 ;1099 ;8080 ;2181;20880;端口可以正常访问

运行组件:

JDK 1.8;

mysql 5.7;

manager.deployer-4.2.18.tar.gz

node.deployer-4.2.18.tar.gz

apache-zookeeper-3.7.0.tar.gz

开始安装:
1.下载各个组件
java, mysql 环境就不多介绍了自行安装

1.下载node
wget https://github.com/alibaba/otter/releases/download/otter-4.2.18/node.deployer-4.2.18.tar.gz

2.创建node目录
mkdir node 

3.解压至node目录
tar -zxvf node.deployer-4.2.18.tar.gz -C node

4.下载manager
wget https://github.com/alibaba/otter/releases/download/otter-4.2.18/manager.deployer-4.2.18.tar.gz

5.创建manager目录
mkdir manager

6.解压至manager
tar -zxvf manager.deployer-4.2.18.tar.gz -C manager

7.下载zookeeper
wget https://downloads.apache.org/zookeeper/zookeeper-3.7.0/apache-zookeeper-3.7.0-bin.tar.gz

8.解压zookeeper
tar -zxvf apache-zookeeper-3.7.0.tar.gz
mv apache-zookeeper-3.7.0 zookeeper
 
9.下载数据库初始化脚本
wget https://raw.github.com/alibaba/otter/master/manager/deployer/src/main/resources/sql/otter-manager-schema.sql

2.初始化数据库;
1.新建otter库
mysql >CREATE DATABASE `otter` CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';

2.导入sql 脚本
mysql >use otter;
mysql >source /otter-manager-schema.sql     ###脚本就是第一步下载的初始化脚本

3.###导入sql时候可能会报 NO_AUTO_CREATE_USER 错误。
mysql > show variables like 'sql_mode';

#修改配置文件将 NO_AUTO_CREATE_USER 添加至sql_mode

vim /etc/my.cnf
...
[mysqld]
sql_mode=NO_AUTO_CREATE_USER
...

#保存后重启数据库重新导入sql
4.创建用户并授权访问
CREATE USER `otter`@`%` IDENTIFIED BY '666666';
grant all ON `otter`.* TO `test`@`%`;

#用户名:otter 
#密码:666666

3.启动zookeeper
###修改配置文件
cd /zookeeper/conf/
cp zoo_sample.cfg zoo.cfg
mkdir -p /zookeeper/zkdata

#修改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=/zookeeper/zkdata
# the port at which the clients will connect
clientPort=2181
admin.serverPort=20880
4lw.commands.whitelist=*
...


#1.启动
cd /zookeeper/bin
./zkServer.sh start

#2.检查状态
[root@otter bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /volumes01/zookeeper/bin/../conf/zoo.cfg
Mode: standalone

4.启动manager
1.修改配置文件
cd /manager/conf/
vim otter.properties 
主要修改部分如下图所示

#3.启动manager
cd /manager/bin/
./startup.sh

#访问地址:192.168.57.100:8080
#默认用户名: admin
#默认密码:admin

配置zookeeper

配置node: 注意端口号默认 2088 不要写错了。

保存后注意生成的序号,在配置node 时需要用到;如下图

5.启动node
1.添加nid文件
cd /node/conf/

echo 2 > nid   

###这个序号 2 根据上一步添加节点后节点对应的序号填写,nid 是文件名字,不需要修改.

#2.修改配置文件
cd /node/conf/
vim otter.properties 

如下所示:

#3.启动node
cd /node/bin/
./startup.sh

 

最后,登录manager 检查node状态为一启动。说明配置成功。可以进行后续的使用了

 

打赏
分类: 文档

0 条评论

发表评论