dubbo教程

Zookeeper注册中心

zookeeper安装

更改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=../data/
# 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

## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true

admin.serverPort=8888//不改默认会占用8080端口

zookeeper安装启动错误

logs日志下
错误: 找不到或无法加载主类 org.apache.zookeeper.server.quorum.QuorumPeerMain

MacBookPro:zookeeper-server zhangxm$ pwd
/Users/zhangxm/tools/apache-zookeeper-3.6.2/zookeeper-server

mvn package -Dmaven.test.skip=true

cd /Users/zhangxm/tools/apache-zookeeper-3.6.2/bin
MacBookPro:bin zhangxm$ ./zkServer.sh start
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /Users/zhangxm/tools/apache-zookeeper-3.6.2/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
MacBookPro:bin zhangxm$ ./zkServer.sh status
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /Users/zhangxm/tools/apache-zookeeper-3.6.2/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Mode: standalone
MacBookPro:bin zhangxm$ lsof -i:2181
COMMAND   PID    USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
java    96481 zhangxm   92u  IPv6 0xae579d67d9d36e51      0t0  TCP *:eforward (LISTEN)

安装dubbo admin

下载dubbo-admin
cd /Users/zhangxm/tools/dubbo-admin-develop

修改/Users/zhangxm/tools/dubbo-admin-develop/dubbo-admin-server工程下的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.
#

# centers in dubbo2.7
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

#admin.registry.address=nacos://127.0.0.1:8848
#admin.config-center=nacos://127.0.0.1:8848
#admin.metadata-report.address=nacos://127.0.0.1:8848

admin.root.user.name=root
admin.root.user.password=root
#group
admin.registry.group=dubbo
admin.config-center.group=dubbo
admin.metadata-report.group=dubbo

#session timeout, default is one hour
admin.check.sessionTimeoutMilli=3600000

#namespace used by nacos
admin.registry.namespace=public
admin.config-center.namespace=public
admin.metadata-report.namespace=public

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
1:Production Setup

Clone source code on develop branch git clone https://github.com/apache/dubbo-admin.git

2:Specify registry address in dubbo-admin-server/src/main/resources/application.properties
3:Build

mvn clean package -Dmaven.test.skip=true

4:Start

mvn --projects dubbo-admin-server spring-boot:run
OR
cd dubbo-admin-distribution/target; java -jar dubbo-admin-0.1.jar

5:Visit http://localhost:8080

Default username and password is root

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xidianzxm

您的打赏是我继续创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值