• 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

  • 相关阅读:
    系统集成项目管理工程师计算题(成本管理计算)
    系统集成项目管理工程师计算题(进度管理计算)
    系统集成项目管理工程师计算题(期望值)
    系统集成项目管理工程师计算题(三点估算)
    系统集成项目管理工程师计算题(沟通渠道)
    Asp.net core web Api 应用Jwt 验证
    Linux vmstat命令
    关于Java集合的小抄
    @Resource和@Autowire
    Servlet是线程安全的吗?
  • 原文地址:https://www.cnblogs.com/xidianzxm/p/14384065.html
Copyright © 2020-2023  润新知