7.抢购网设计介绍
压缩包中的jar包,在部分公网环境下,无法使用maven以来直接获取。如出现此种情况,使用者可以将相关jar包,使用nexus直接上传至私服。还有一种解决方法。
jar包位置是:E:\spring-boot-starter-dubbo-1.0.0.jar
E:\>mvn install:install-file -Dfile=.\spring-boot-starter-dubbo-1.0.0.jar -Dgrou
pId=com.alibaba.hl -DartifactId=spring-boot-starter-dubbo -Dversion=1.0.0 -Dpack
ageing=jar
E:\
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom
---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.952 s
[INFO] Finished at: 2018-06-08T15:22:33+08:00
[INFO] Final Memory: 8M/113M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4
:install-file (default-cli) on project standalone-pom: The artifact information
is incomplete or not valid:
[ERROR] [0] 'packaging' is missing.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
E:\>mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=
.\spring-boot-starter-dubbo-1.0.0.jar -DgroupId=com.alibaba.hl -DartifactId=spri
ng-boot-starter-dubbo -Dversion=1.0.0 -Dpackageing=jar
E:\
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install-file (default-cli) @ standalone-po
m ---
[INFO] Installing E:\spring-boot-starter-dubbo-1.0.0.jar to E:\local\repo\com\al
ibaba\hl\spring-boot-starter-dubbo\1.0.0\spring-boot-starter-dubbo-1.0.0.jar
[INFO] Installing C:\Users\ADMINI~1\AppData\Local\Temp\mvninstall328720955820700
6406.pom to E:\local\repo\com\alibaba\hl\spring-boot-starter-dubbo\1.0.0\spring-
boot-starter-dubbo-1.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.602 s
[INFO] Finished at: 2018-06-08T15:26:15+08:00
[INFO] Final Memory: 7M/114M
[INFO] ------------------------------------------------------------------------
E:\>
第一条命令不能执行,执行第二条命令。
错误解决方法http://maven.apache.org/plugins/maven-install-plugin/examples/custom-pom-installation.html
运行shop-user-provider报错“java.lang.IllegalStateException: Zookeeper is not connected yet!
环境描述:
我把一个台式机当服务器。台式机是连接的有线。ip地址是192.168.32.135。但是我运行shop-user-provider报错“java.lang.IllegalStateException: Zookeeper is not connected yet!”
项目shop-user-provider的application.properties
spring.datasource.url=jdbc:mysql://192.168.32.134:3306/qg_user_db?useUnicode=true&characterEncoding=gbk&zeroDateTimeBehavior=convertToNull
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
mybatis.mapper-locations=classpath:mapper/*Mapper.xml
spring.dubbo.appname=spring-boot-starter-dubbo-user-provider
#spring.dubbo.registry=zookeeper://192.168.32.134:2181
spring.dubbo.registry=zookeeper://192.168.32.134:2181
spring.dubbo.protocol=dubbo
spring.dubbo.port=20802
server.port=8092
#Redis数据库索引(默认为0)
spring.redis.database=0
#Redis服务器地址
spring.redis.host=192.168.32.134
#Redis服务器连接端口
spring.redis.port=6379
#Redis服务器连接密码(默认为空)
spring.redis.user=root
spring.redis.password=123456
#连接池最大连接数(使用负值表示没有限制)
spring.redis.pool.max-active=8
#连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.pool.max-wait=-1
#连接池中的最大空闲连接
spring.redis.pool.max-idle=8
#连接池中的最小空闲连接
spring.redis.pool.min-idle=0
#连接超时时间(毫秒)
spring.redis.timeout=3000
项目shop-user-consumer的applicaiton.properties
spring.datasource.url=jdbc:mysql://192.168.32.134:3306/qg_user_db?useUnicode=true&characterEncoding=gbk&zeroDateTimeBehavior=convertToNull
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
mybatis.mapper-locations=classpath:mapper/*Mapper.xml
#dubbo
spring.dubbo.appname=spring-boot-starter-dubbo-user-consumer
spring.dubbo.registry=zookeeper://192.168.32.134:2181
#spring.dubbo.registry=zookeeper://192.168.10.5:2181
spring.dubbo.protocol=dubbo
spring.dubbo.port=20807
server.port=8082
#Redis数据库索引(默认为0)
spring.redis.database=0
#Redis服务器地址
spring.redis.host=192.168.32.134
#Redis服务器连接端口
spring.redis.port=6379
#Redis服务器连接密码(默认为空)
spring.redis.user=root
spring.redis.password=123456
#连接池最大连接数(使用负值表示没有限制)
spring.redis.pool.max-active=8
#连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.pool.max-wait=-1
#连接池中的最大空闲连接
spring.redis.pool.max-idle=8
#连接池中的最小空闲连接
spring.redis.pool.min-idle=0
#连接超时时间(毫秒)
spring.redis.timeout=3000
原因:zookeeper的地址没有映射出去。端口2181确定有没有映射出去。
在shipyard可视化工具里面
解决方法:
run.sh zookeeper可以重新运行一遍。
root@ubuntu:/home/docker/tools/dokerfiles-master/env10.1# ./run.sh zookeeper
env10_5_Zookeeper01
env10_5_Zookeeper01
acdd5ed7e25a7a799c1c863acd880b060d9623b57761733ced60d733d37c784c
问题描述:解决了问题2,项目运行不报错了。但是在浏览器输入da.local.com。发现服务没有刚才运行的几个项目。
原因:确定dubbo 里有指定zookeeper地址吗
解决方法:
dubbo的dubbo.properties原来是
[root@966f2b7ce1b0 WEB-INF]# cat dubbo.properties
dubbo.registry.address=zookeeper://192.168.10.5:2181
#dubbo.registry.username=root
#dubbo.registry.password=root
dubbo.registry.protocol=zookeeper
dubbo.admin.root.password=root
改一下dubbo.register.address=zookeeper:192.168.32.134:2181
改地址应该填写:zookeeper容器所在宿主机的IP还有你映射出来的端口
改完后,需要重启tomcat