Installation of Dubbo admin management platform under centos7

Keywords: Dubbo Tomcat Zookeeper Java

1. Download Dubbo source code at https://github.com/alibaba/dubbo

 

 

2. Unzip the zip file to the directory "D: \ technical data \ zookeeper \ Dubbo master \ Dubbo master"

 

Manual packaging. Here you only need to package the war package of Dubbo admin. So go to the Dubbo admin directory and use maven to package mvn package -Dmaven.skip.test=true. Then you can see the packaged war package in the target directory
3. check the dubbo.propeties file in the WEB-INF directory under the war package

dubbo.registry.address=zookeeper://192.168.2.2:2181
dubbo.admin.root.password=root
dubbo.admin.guest.password=guest

The default configuration is port 2181 of the local zookeeper. Remember the user name and password root/root and guest/guest

At this time, Tomcat can be started directly, but because zk uses port 8080 by default, in order to prevent conflicts, modify the conf/server.xml configuration port to 8082, and then execute bin/startup.cmd. (if the local machine is configured with multiple tomcat, if the CATALINA_HOME in the environment variable is inconsistent with the current Tomcat directory, set CATALINA_HOME can be configured at the beginning of startup.cmd =Current Tomcat directory)

The server.xml configuration of tomcat is adjusted as follows

 <Connector port="8082" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />


 <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
         <!--dubbo-admin Console -->
         <Context docBase="/usr/local/java/dubbo-admin" path="/" reloadable="true" />

      </Host>

Visit: http://192.168.2.2:8080/

Enter root

4. Dubbo admin configuration self startup

vim /etc/init.d/dubboAdmin

Add script content:

#!/bin/bash
# description: Tomcat7 Start Stop Restart
# processname: tomcat7
# chkconfig: 234 20 80
export JAVA_HOME=/usr/local/java/jdk1.8.0_181
export JRE_HOME=${JAVA_HOME}/jre
export PATH=$PATH:${JAVA_HOME}/bin:${JRE_HOME}/bin

DUBBOADMIN_HOME=/usr/local/java/tomcat/tomcat-8082-dubbo-admin

case $1 in
        start)
                sh ${DUBBOADMIN_HOME}/bin/startup.sh
                ;;
        stop)
                sh ${DUBBOADMIN_HOME}/bin/shutdown.sh
                ;;
        restart)
                sh ${DUBBOADMIN_HOME}/bin/shutdown.sh
                sh ${DUBBOADMIN_HOME}/bin/startup.sh
                ;;
        *)
                echo 'please use : tomcat {start | stop | restart}'
        ;;
esac
exit 0

: wq save the script.

Execute scripts to start, stop, and restart services.

Start: service tomcat start

Stop: service tomcat stop

Restart: service tomcat restart

Add to service list

chkconfig --add dubboAdmin
chkconfig dubboAdmin on

chkconfig --list | grep dubboAdmin

Firewall open port 8082

firewall-cmd --permanent --zone=public --add-port=8082/tcp  //Permanently add the port
firewall-cmd --reload //Load configuration to make changes valid

 

Posted by tito on Fri, 31 Jan 2020 00:15:56 -0800