三、zookeeper的安装
tar zxvf zookeeper-3.4.5-cdh4.3.0.tar.gz
cd zookeeper-3.4.5-cdh4.3.0
mkdir data
mv conf/zoo_sample.cfg conf/zoo.cfg
修改conf/zoo.cfg配置文件:
dataDir=/……/zookeeper/data
autopurge.purgeInterval=1
修改bin/zkEnv.sh脚本:
将ZOO_LOG_DIR="."修改为ZOO_LOG_DIR="/……/zookeeper/data"
将ZOO_LOG4J_PROP=”INFO,CONSOLE”修改为ZOO_LOG4J_PROP="INFO,ROLLINGFILE"
修改bin/zkServer.sh脚本:
将ZOOBIN="${BASH_SOURCE-$0}"修改为ZOOBIN=`readlink -f "${BASH_SOURCE-$0}"`
增加一行环境变量SERVER_JVMFLAGS="-Xms4096m -Xmx4096m",设定进程内存
修改bin/zkCli.sh脚本:
将ZOOBIN="${BASH_SOURCE-$0}"修改为ZOOBIN=`readlink -f "${BASH_SOURCE-$0}"`
echo 1 > data/myid 将本节点id设定到data/myid文件中
启动:sh zkServer.sh start
状态检查:sh zkServer.sh status
四、manager的安装
mkdir manager
cd manager
wget https://github.com/alibaba/otter/releases/download/otter-x.y.z/manager.deployer-x.y.z.tar.gz
tar zxvf manager.deployer-$version.tar.gz
wget https://raw.github.com/alibaba/otter/master/manager /deployer/src/main/resources/sql/otter-manager-schema.sql
进入Mysql中执行:mysql> source /usr/local/otter-manager-schema.sql
修改manager的配置文件:vi conf/otter.properties
## otter manager domain name
otter.domainName =54.244.58.100##本地的域名(用亚马逊云服务器的公有IP)
## otter manager http port
otter.port = 8080 ##对外访问的端口号
## jetty web config xml
otter.jetty = jetty.xml
## otter manager database config
otter.database.driver.class.name = com.mysql.jdbc.Driver
otter.database.driver.url = jdbc:mysql://172.31.37.243:3306/otter ##otter数据的配置(用亚马逊云服务器的私有IP)
otter.database.driver.username = canal ##otter数据的账号
otter.database.driver.password = canal ##otter数据的密码
## otter communication port
otter.communication.manager.port = 1099 ##对应Node中的配置
## otter communication pool size
otter.communication.pool.size = 10
## default zookeeper address
otter.zookeeper.cluster.default = 172.31.37.243:2181##zookeeper的地址
启动: sh startup.sh
完成后,直接访问上面配置的本地的域名:对外访问的端口号 即可。
注意:
将相应的端口加入亚马逊云服务器的安全组;
manager依赖于zookeeper,zookeeper启动成功之后manager才会成功启动。