Dubbo environment construction

1, Install registry

Zookeeper registration center is recommended

Official website documents:

Registration Center: https://dubbo.apache.org/zh/docs/references/registry/

    zookeeper: https://dubbo.apache.org/zh/docs/references/registry/zookeeper/

1. Install zookeeper for windows

(1) Download zookeeper

Website: https://archive.apache.org/dist/zookeeper/zookeeper-3.4.13/

(2) unzip zookeeper

Unzip and run zkserver CMD, an error will be reported during the initial operation, and the zoo cannot be found Cfg file

 

 

Copy a zoo in the conf directory_ sample. CFG, and modify it to zoo CFG, you can run normally.

  

 

(3) modify zoo CFG configuration file

Note several important points:

dataDir=./   Directory of temporary data store (writable relative path)
clientPort=2181   zookeeper Port number of
 Start again after modification zookeeper

  

(4) use zkcli CMD test

ls /: list zookeeper All nodes saved under the root
create –e /njf 123: Create a njf Node with a value of 123
get /njf: obtain/njf The value of the node

    

 

2. Installing zookeeper for Linux

(1) install JDK

a. download jdk

      http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

      

Do not use the wget command to obtain the jdk link. This is a default disagreement, resulting in an error in the downloaded jdk compressed content

 

b. upload it to the server and unzip it

    

c. setting environment variables

      /usr/local/java/jdk1.8.0_171

      

Add the following configuration at the end of the file:

export JAVA_HOME=/usr/local/java/jdk1.8.0_171
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

        

 

 

 

d. validate environment variables & test JDK

      

 

 

(2) install zookeeper

a. download zookeeper

 

website https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/ 
wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz

 

  

 

b. decompression

      

c. move to the specified location and change the name to zookeeper

 

 

 

(3) start zookeeper

a. copy the following script:

 

#!/bin/bash
#chkconfig:2345 20 90
#description:zookeeper
#processname:zookeeper
ZK_PATH=/usr/local/zookeeper
export JAVA_HOME=/usr/local/java/jdk1.8.0_171
case $1 in
         start) sh  $ZK_PATH/bin/zkServer.sh start;;
         stop)  sh  $ZK_PATH/bin/zkServer.sh stop;;
         status) sh  $ZK_PATH/bin/zkServer.sh status;;
         restart) sh $ZK_PATH/bin/zkServer.sh restart;;
         *)  echo "require start|stop|status|restart"  ;;
esac

 

 

 

    

b. register the script as a Service

    

c. add permissions

    

 

(4) configure zookeeper

a. initialize the zookeeper configuration file

 

Copy / usr/local/zookeeper/conf/zoo_sample.cfg  

 

Go to the same directory and change the name to zoo cfg

 

 

b. start zookeeper

 

 

2, Installation of monitoring center

dubbo itself is not a service software. It is actually a jar package, which can help your java program connect to zookeeper and use zookeeper to consume and provide services. So you don't have to start any dubbo service on Linux.

However, in order to allow users to better manage and monitor many dubbo services, the official provides a visual monitoring program, but this monitoring will not affect the use even if it is not installed.

1. Install Windows} Dubbo admin management console

(1) Download Dubbo admin at: https://github.com/apache/incubator-dubbo-ops

    

    

(2) unzip and enter the Dubbo admin project, and modify SRC \ main \ resources \ application Properties specifies the zookeeper address

    

(3) package Dubbo admin

In Dubbo admin's POM Run cmd in the XML directory and package with maven

mvn clean package -Dmaven.test.skip=true   #Skip tests, faster
mvn clean package 

  

(4) run Dubbo admin

Start cmd in the jar package directory and use the command to start the service:

java -jar dubbo-admin-0.0.1-SNAPSHOT.jar

  

Note: [it is possible that the console is started, but the web page cannot be opened. You need to press ctrl+c on the console]

Log in with root/root by default

Be sure to save that zookeeper is always running.

 

 

2. Install Dubbo admin console for Linux

(1) install Tomcat 8 (the old version of Dubbo admin is war, and the new version is jar. Tomcat does not need to be installed)

a. download Tomcat8 and unzip it

 

https://tomcat.apache.org/download-80.cgi
wget http://mirrors.shu.edu.cn/apache/tomcat/tomcat-8/v8.5.32/bin/apache-tomcat-8.5.32.tar.gz

 

  

 

b. unzip and move to the specified location

c. start tomcat8

 

Copy the following script:

#!/bin/bash
#chkconfig:2345 21 90
#description:apache-tomcat-8
#processname:apache-tomcat-8
CATALANA_HOME=/opt/apache-tomcat-8.5.32
export JAVA_HOME=/opt/java/jdk1.8.0_171
case $1 in
start)
    echo "Starting Tomcat..."  
    $CATALANA_HOME/bin/startup.sh
    ;;

stop)
    echo "Stopping Tomcat..."  
    $CATALANA_HOME/bin/shutdown.sh
    ;;

restart)
    echo "Stopping Tomcat..."  
    $CATALANA_HOME/bin/shutdown.sh
    sleep 2
    echo  
    echo "Starting Tomcat..."  
    $CATALANA_HOME/bin/startup.sh
    ;;
*)
    echo "Usage: tomcat {start|stop|restart}"  
    ;; esac

 

 

d. Register Services & add permissions

 

e. start service & Access tomcat test

 

(2) install Dubbo admin

Put the jar package on Linux and start it directly.

 

Keywords: Dubbo

Added by cytech on Sun, 09 Jan 2022 12:43:34 +0200