spring cloud + docker 微服务架构
http://www.open-open.com/lib/view/open1437363835818.html
实例项目
https://github.com/kbastani/spring-cloud-microservice-example
编译通过。分享下经验
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/share/maven
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el7_2.x86_64/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-123.el7.x86_64", arch: "amd64", family: "unix"
- Maven 3 yum安装的没有编译成功, 后下载 3.3.9 版本覆盖原有内容成功
- Java 8
- Docker
- Docker Compose 下载很慢,可能是网络的事,下载了好多次。
中间遇到了, 提示 Errorinjecting:org.apache.maven.plugin.surefire.surefirePlugin NoClassDefFoundError:... 的异常。
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.:test (default-test) on project shopping-cart-service: There are test failures.
[ERROR]
[ERROR] Please refer to /opt/springevent/spring-cloud-event-sourcing-example-master/shopping-cart-service/target/surefire-reports for the individual test results.
[ERROR] -> [Help ]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help ] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
后来是通过删除maven本地仓库中的 org\apache\maven\surefire 内容,解决的。
推荐看。 http://github.com/shuyouliu/liusy.api
[root@localhost docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kbastani/movies-ui latest 0402aa540503 minutes ago 783.5 MB
kbastani/movie-microservice latest 2eac2d8235ef About an hour ago 841.9 MB
kbastani/consul-microservice latest 0d86931cca38 About an hour ago 748.9 MB
kbastani/hystrix-dashboard latest 65133c05f97f hours ago 719.3 MB
kbastani/config-microservice latest 4260142943c7 hours ago 747.4 MB
kbastani/recommendation-microservice latest 177c907dd951 hours ago 841.9 MB
kbastani/api-gateway-microservice latest 64c554fe728b hours ago 739.1 MB
kbastani/discovery-microservice latest c6708d85bf52 hours ago 748.6 MB
kbastani/users-microservice latest 13d9f61b33eb hours ago 843.1 MB