环境准备

  1. otter manager依赖于mysql进行配置信息的存储,所以需要预先安装mysql,并初始化otter manager的系统表结构

    a. 安装mysql,这里不展开,网上一搜一大把

    b. 初始化otter manager系统表:
    下载:

  1. wget https://raw.github.com/alibaba/otter/master/manager/deployer/src/main/resources/sql/otter-manager-schema.sql

载入:

  1. source otter-manager-schema.sql
  1. 整个otter架构依赖了zookeeper进行多节点调度,所以需要预先安装zookeeper,不需要初始化节点,otter程序启动后会自检.

    a. manager需要在otter.properties中指定一个就近的zookeeper集群机器

启动步骤

  1. 下载otter manager

    直接下载 ,可访问:https://github.com/alibaba/otter/releases ,会列出所有历史的发布版本包下载方式,比如以x.y.z版本为例子:

  1. wget https://github.com/alibaba/otter/releases/download/otter-x.y.z/manager.deployer-x.y.z.tar.gz

or
自己编译

  1. git clone git@github.com:alibaba/otter.git
  2. cd otter;
  3. mvn clean install -Dmaven.test.skip -Denv=release

编译完成后,会在根目录下产生target/manager.deployer-$version.tar.gz

  1. 解压缩
  1. mkdir /tmp/manager
  2. tar zxvf manager.deployer-$version.tar.gz -C /tmp/manager
  1. 配置修改
  1. ## otter manager domain name #修改为正确访问ip,生成URL使用
  2. otter.domainName = 127.0.0.1
  3. ## otter manager http port
  4. otter.port = 8080
  5. ## jetty web config xml
  6. otter.jetty = jetty.xml
  7. otter manager database config ,修改为正确数据库信息

  8. otter.database.driver.class.name = com.mysql.jdbc.Driver

  9. otter.database.driver.url = jdbc:mysql://127.0.01:3306/ottermanager

  10. otter.database.driver.username = root

  11. otter.database.driver.password = hello

  12. otter communication port

  13. otter.communication.manager.port = 1099

  14. otter communication pool size

  15. otter.communication.pool.size = 10

  16. default zookeeper address,修改为正确的地址,手动选择一个地域就近的zookeeper集群列表

  17. otter.zookeeper.cluster.default = 127.0.0.1:2181

  18. default zookeeper session timeout = 90s

  19. otter.zookeeper.sessionTimeout = 90000

  20. otter arbitrate connect manager config

  21. otter.manager.address = ${otter.domainName}:${otter.communication.manager.port}

  1. 准备启动
  1. sh startup.sh
  1. 查看日志
  1. vi logs/manager.log
  1. 2013-08-14 13:19:45.911 [] WARN com.alibaba.otter.manager.deployer.JettyEmbedServer - ##Jetty Embed Server is startup!
  2. 2013-08-14 13:19:45.911 [] WARN com.alibaba.otter.manager.deployer.OtterManagerLauncher - ## the manager server is running now ......

出现类似日志,代表启动成功

  1. 验证

    访问: http://127.0.0.1:8080/,出现otter的页面,即代表启动成功

Manager_QuickStart - 图1

访问:http://127.0.0.1:8080/login.htm,初始密码为:admin/admin,即可完成登录. 目前:匿名用户只有只读查看的权限,登录为管理员才可以有操作权限

  1. 关闭
  1. sh stop.sh

it's over.

原文: https://github.com/alibaba/otter/wiki/Manager_Quickstart