美文网首页
sy后台:启动并测试接口

sy后台:启动并测试接口

作者: f923bd1a20e9 | 来源:发表于2016-12-01 18:53 被阅读0次

    启动并测试接口


    1.运行 zookeeper


    先下载 zookepper

    解压后打开\zookeeper-3.3.6\conf 目录,在目录下增加一个 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=/tmp/zookeeper

    # the port at which the clients will connect

    clientPort=2181

    # the maximum number of client connections.

    # increase this if you need to handle more clients

    #maxClientCnxns=60

    #

    # Be sure to read the maintenance section of the

    # administrator guide before turning on autopurge.

    #

    # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance

    #

    # The number of snapshots to retain in dataDir

    #autopurge.snapRetainCount=3

    # Purge task interval in hours

    # Set to "0" to disable auto purge feature

    #autopurge.purgeInterval=1

    添加这个文件后,打开 bin 目录,运行 zkServer.cmd 

    没问题的话应该是这样子的:

    这时候 zookeeper 就成功启动了

    2.修改配置文件

    测试前需要修改端口号和IP地址:

    修改 sy_web 下的 config.properties ,这个端口号和IP要改为本地zookeeper的对应值

    修改 sy_crm 下的 config.properties dubbo.properties ,其中基本上也是修改IP和端口号,这里还有一个数据库的IP,使用内网测试就是图上那个:

    检查完配置就可以启动了

    3.启动 tomcat

    使用 tomcat 部署运行 sy_web

    先在 tools bar 打开 Edit Configuration 

    然后点左上角的 + 号,找到 tomcat  

    然后做一系列设置,关键是 Depolyment 的部署配置,在这里添加部署的项目,点 + 号 > Artifact ,选择 sy_web 部署

    部署完成后就可以运行 tomcat

    如果只是做单元测试,到这里就可以了,不需要运行下面的 main 方法 

    4.运行 MAIN 方法

    运行这个:

    sy_crmcom.sy.provider.main 下的 LuncherProvider main 方法

    5.测试端口

    打开 http://192.168.57.181:8080/#!/ 就行 

    相关文章

      网友评论

          本文标题:sy后台:启动并测试接口

          本文链接:https://www.haomeiwen.com/subject/yftfmttx.html