1、下载dubbo-admin服务器版本
2、上传至服务器, 并解压
3、进入解压后的目录D:\WorkJava\dubbo-admin-0.2.0
4、默认启动8080端口, 可能会存在冲突,
修改dubbo-admin-server的端口 D:\WorkJava\dubbo-admin-0.2.0\dubbo-admin-server\src\main\resources\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.
#
# 新版注册中心
admin.config-center=zookeeper://127.0.0.1:2181
# 老版注册中心,建议注释,因为无法显示服务的方法
#这里取消了这两个配置,必须在zookeeper创建文件,否则jar包运行失败
#zookeeper创建/dubbo/config/dubbo/dubbo.properties文件 内容
#dubbo.registry.address=zookeeper://127.0.0.1:2181
#dubbo.metadata-report.address=zookeeper://127.0.0.1:2181
#admin.registry.address=zookeeper://127.0.0.1:2181
#admin.metadata-report.address=zookeeper://127.0.0.1:2181
admin.registry.group=dubbo
admin.apollo.token=e16e5cd903fd0c97a116c873b448544b9d086de9
admin.apollo.appId=test
admin.apollo.env=dev
admin.apollo.cluster=default
admin.apollo.namespace=dubbo
server.port=8090
注意:
#这里取消了这两个配置,必须在zookeeper创建文件,否则jar包运行失败
zookeeper创建/dubbo/config/dubbo/dubbo.properties文件 内容
dubbo.registry.address=zookeeper://127.0.0.1:2181
dubbo.metadata-report.address=zookeeper://127.0.0.1:2181
public static void main(String[] args) throws Exception {
CuratorFramework zkClient = CuratorFrameworkFactory.builder().
connectString("192.168.247.129:2181").
retryPolicy(new ExponentialBackoffRetry(1000, 3)).build();
zkClient.start();
if (zkClient.checkExists().forPath("/dubbo/config/dubbo/dubbo.properties") == null) {
zkClient.create().creatingParentsIfNeeded().forPath("/dubbo/config/dubbo/dubbo.properties");
}
zkClient.setData().forPath("/dubbo/config/dubbo/dubbo.properties", ("dubbo.registry.address=zookeeper://192.168.247.129:2181\n" +
"dubbo.metadata-report.address=zookeeper://192.168.247.129:2181").getBytes());
}
修改dubbo-admin-ui的端口 D:\WorkJava\dubbo-admin-0.2.0\dubbo-admin-ui\config
4、进行打包 D:\WorkJava\dubbo-admin-0.2.0
mvn clean package -Dmaven.test.skip=true
5.进入到dubbo-admin-distribution目录中 D:\WorkJava\dubbo-admin-0.2.0\dubbo-admin-distribution\target
将dubbo-admin-0.2.0.jar包本地部署或者服务器部署,执行运行命令 java -jar
启动成功;访问ip:8090会出现如下页面, 代表部署已经成功。