sy后台:启动并测试接口

启动并测试接口


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/#!/ 就行 

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,715评论 19 139
  • 姐姐大我7岁,年幼的我,在懂事的姐姐面前总是顽皮。我可能生下来就有病,但却一样拥有一个幸福的童年。 我不太会走路,...
    南渡风阅读 445评论 2 0
  • 我慢慢地走 路边的风景如掠影瞬间而过 不知道有没有看着记得想过 时间如筛 希望如花在夏季 随心而开灿烂那晨曦的一抹...
    卿若安阅读 245评论 0 0

友情链接更多精彩内容