在学习这篇文章之前,可以先把zookeeper安装一下
安装教程指路:window10下载与安装zookeeper,图文说明
拉取代码,一般教程都会让我去github官网拉取,但是因为该网站经常打不开,所以我就在gitee里面找到了同款替换
git clone https://gitee.com/aimmuselisa/dubbo-admin.git
application.properties
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
server.port=38089
dubbo.protocol.port=30880
dubbo.application.qos-port=32222
# centers in dubbo, if you want to add parameters, please add them to the url
admin.registry.address=zookeeper://127.0.0.1:2181
admin.config-center=zookeeper://127.0.0.1:2181
admin.metadata-report.address=zookeeper://127.0.0.1:2181
# nacos config, add parameters to url like username=nacos&password=nacos
#admin.registry.address=nacos://127.0.0.1:8848?group=DEFAULT_GROUP&namespace=public
#admin.config-center=nacos://127.0.0.1:8848?group=dubbo
#admin.metadata-report.address=nacos://127.0.0.1:8848?group=dubbo
#group (Deprecated it is recommended to use URL to add parameters,will be removed in the future)
#admin.registry.group=dubbo
#admin.config-center.group=dubbo
#admin.metadata-report.group=dubbo
#namespace used by nacos. (Deprecated it is recommended to use URL to add parameters,will be removed in the future)
#admin.registry.namespace=public
#admin.config-center.namespace=public
#admin.metadata-report.namespace=public
admin.root.user.name=root
admin.root.user.password=root
#session timeout, default is one hour
admin.check.sessionTimeoutMilli=3600000
# apollo config
# admin.config-center = apollo://localhost:8070?token=e16e5cd903fd0c97a116c873b448544b9d086de9&app.id=test&env=dev&cluster=default&namespace=dubbo
# (Deprecated it is recommended to use URL to add parameters,will be removed in the future)
admin.apollo.token=e16e5cd903fd0c97a116c873b448544b9d086de9
admin.apollo.appId=test
admin.apollo.env=dev
admin.apollo.cluster=default
admin.apollo.namespace=dubbo
#compress
server.compression.enabled=true
server.compression.mime-types=text/css,text/javascript,application/javascript
server.compression.min-response-size=10240
#token timeout, default is one hour
admin.check.tokenTimeoutMilli=3600000
#Jwt signingKey
admin.check.signSecret=86295dd0c4ef69a1036b0b0c15158d77
#dubbo config
dubbo.application.name=dubbo-admin
dubbo.registry.address=${admin.registry.address}
# mysql
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.url=jdbc:mysql://localhost:3306/test?characterEncoding=utf8&connectTimeout=1000&socketTimeout=10000&autoReconnect=true
#spring.datasource.username=root
#spring.datasource.password=
# h2
#spring.datasource.url=jdbc:h2:mem:~/dubbo-admin;MODE=MYSQL;
#spring.datasource.username=sa
#spring.datasource.password=
# id generate type
mybatis-plus.global-config.db-config.id-type=none
dubbo.application.logger=slf4j
我存放项目的路径:
执行命令:
mvn clean package -Dmaven.test.skip=true
执行图示:
执行成功:
进入目录 :D:\dubboDev\dubbo-damin\dubbo-admin\dubbo-admin-server\target
每个人目录不同,根据各自情况处理
执行命令:
java -jar dubbo-admin-server-0.7.0-SNAPSHOT.jar
执行图示:
根据配置文件的端口号来 server.port=38089
重点说明:
在安装Dubbo Admin的时候,我用的是jdk17,能够正常打包项目 但是在启动的时候,总会报错,一些莫名奇妙的错误,但是同事启动正常,比较之下,发现他用的是jdk1.8,于是就换成了jdk1.8, 果然,项目正常启动了,估计是版本不匹配的问题
【踩坑四次】Dubbo Admin 安装与配置详细教程 + 排错解析
解决Dobbo错误:Unable to canonicalize address 127.0.0.1/:2181 because it’s not resolvable
Unexpected character (‘.‘ (code 46)): Expected space separating root-level values