dubbo入门(一):ubuntu14.04 jdk8下 dubbo-admin编译安装

本文环境:ubuntu14.04 jdk1.8.0_91 intellij idea

第一步编译dubbo-admin

我刚试了http://dubbo.io/的安装方法 发现一些源已经无法访问了 所以就用编译安装的方法
这是阿里dubbo的github https://github.com/alibaba/dubbo
把源码下载下来后 用mvn编译会有各种问题 所以用intellij打开后在mavenproject里将dubbo-admin的pom.xml导入
dubbo入门(一):ubuntu14.04 jdk8下 dubbo-admin编译安装_第1张图片
去掉test的勾选
y由于我用的是jdk8 原先下载下来的pom.xml会有点问题 需要进一步修改
参考链接
http://www.cnblogs.com/varlxj/p/4885489.html
http://blog.csdn.net/zsmissyou/article/details/62445899
最后我的项目依赖如下


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0modelVersion>
    <parent>
        <groupId>com.alibabagroupId>
        <artifactId>dubbo-parentartifactId>
        <version>2.5.4-SNAPSHOTversion>
    parent>
    <artifactId>dubbo-adminartifactId>
    <packaging>warpackaging>
    <name>${project.artifactId}name>
    <description>The admin module of dubbo projectdescription>
    <properties>
        <wtpversion>1.5wtpversion>
        <wtpContextName>/wtpContextName>
        <eclipse.useProjectReferences>falseeclipse.useProjectReferences>
        <skip_maven_deploy>falseskip_maven_deploy>
        <maven.compiler.source>1.8maven.compiler.source>
        <maven.compiler.target>1.8maven.compiler.target>
    properties>
    <dependencies>
        <dependency>
            <groupId>com.alibabagroupId>
            <artifactId>dubboartifactId>
            <version>2.5.3version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframeworkgroupId>
                    <artifactId>springartifactId>
                exclusion>
            exclusions>
        dependency>
        <dependency>
            <groupId>com.alibaba.citrusgroupId>
            <artifactId>citrus-webx-allartifactId>
            <version>3.1.6version>
        dependency>
        <dependency>
            <groupId>org.apache.velocitygroupId>
            <artifactId>velocityartifactId>
            <version>1.7version>
        dependency>
        <dependency>
            <groupId>org.javassistgroupId>
            <artifactId>javassistartifactId>
        dependency>
        <dependency>
            <groupId>org.jboss.nettygroupId>
            <artifactId>nettyartifactId>
        dependency>
        <dependency>
            <groupId>org.apache.minagroupId>
            <artifactId>mina-coreartifactId>
        dependency>
        <dependency>
            <groupId>org.glassfish.grizzlygroupId>
            <artifactId>grizzly-coreartifactId>
        dependency>
        <dependency>
            <groupId>org.apache.httpcomponentsgroupId>
            <artifactId>httpclientartifactId>
        dependency>
        <dependency>
            <groupId>com.alibabagroupId>
            <artifactId>fastjsonartifactId>
        dependency>
        <dependency>
            <groupId>com.thoughtworks.xstreamgroupId>
            <artifactId>xstreamartifactId>
        dependency>
        <dependency>
            <groupId>org.apache.bsfgroupId>
            <artifactId>bsf-apiartifactId>
        dependency>
        <dependency>
            <groupId>org.apache.zookeepergroupId>
            <artifactId>zookeeperartifactId>
        dependency>
        <dependency>
            <groupId>com.github.sgroschupfgroupId>
            <artifactId>zkclientartifactId>
        dependency>
        <dependency>
            <groupId>com.netflix.curatorgroupId>
            <artifactId>curator-frameworkartifactId>
        dependency>
        <dependency>
            <groupId>com.googlecode.xmemcachedgroupId>
            <artifactId>xmemcachedartifactId>
        dependency>
        <dependency>
            <groupId>org.apache.thriftgroupId>
            <artifactId>libthriftartifactId>
        dependency>
        <dependency>
            <groupId>com.cauchogroupId>
            <artifactId>hessianartifactId>
        dependency>
        <dependency>
            <groupId>javax.servletgroupId>
            <artifactId>servlet-apiartifactId>
            <scope>providedscope>
        dependency>
        <dependency>
            <groupId>log4jgroupId>
            <artifactId>log4jartifactId>
        dependency>
        <dependency>
            <groupId>org.slf4jgroupId>
            <artifactId>slf4j-apiartifactId>
        dependency>
        <dependency>
            <groupId>org.slf4jgroupId>
            <artifactId>slf4j-log4j12artifactId>
        dependency>
        <dependency>
            <groupId>redis.clientsgroupId>
            <artifactId>jedisartifactId>
        dependency>
        <dependency>
            <groupId>javax.validationgroupId>
            <artifactId>validation-apiartifactId>
        dependency>
        <dependency>
            <groupId>org.hibernategroupId>
            <artifactId>hibernate-validatorartifactId>
        dependency>
        <dependency>
            <groupId>javax.cachegroupId>
            <artifactId>cache-apiartifactId>
        dependency>
    dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.mortbay.jettygroupId>
                <artifactId>maven-jetty-pluginartifactId>
                <version>${jetty_version}version>
                <configuration>
                    <contextPath>/contextPath>
                    <scanIntervalSeconds>10scanIntervalSeconds>
                    <connectors>
                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                            <port>8080port>
                            <maxIdleTime>60000maxIdleTime>
                        connector>
                    connectors>
                configuration>
            plugin>
        plugins>
    build>
project>

改完之后 点击package打包一个dubbo-admin的war出来

第二步是安装zookeeper

dubbo本身应该是一个rpc也就是远程调度框架 如果我们分布式服务单纯只是做成一些各个服务的接口 供另一些服务器curl 获得json等等
那么当服务接口越来越多,甚至需要对每个服务的服务器进行负载均衡时,我们这些服务的接口将变得非常难以维护
所以我们需要zookeeper来作为服务注册中心 帮我们管理各个服务的服务器集群 我们只需要跟zookeeper拿服务接口即可~

http://apache.fayea.com/zookeeper/
下载完后写一个zoo.cfg 然后用bin/zkServer.sh start启动即可

第三步是部署刚才的war到tomcat中

这个简单啦
在war解压后的文件目录的WEB-INF里可以看到一个dubbo.properties
里面有dubbo-admin的管理员账号密码
登陆后看到如下 搞定
dubbo入门(一):ubuntu14.04 jdk8下 dubbo-admin编译安装_第2张图片

你可能感兴趣的:(架构,dubbo)