|
| 1 | +# Dubbo 环境安装和配置 |
| 2 | + |
| 3 | + |
| 4 | +## Dubbo-Admin 搭建 |
| 5 | + |
| 6 | +### 需要环境 |
| 7 | + |
| 8 | +- CentOS 6 |
| 9 | +- JDK 1.8(必须是 1.8) |
| 10 | +- Tomcat 7 或 8(我测试都可以) |
| 11 | +- Dubbo 版本:2.5.4-SNAPSHOT(当前这个版本是最新的。2.5.3 我测试是不行的) |
| 12 | +- Dubbo-Admin 需要修改部分代码,让它支持 JDK 8,具体看文章:<https://github.com/alibaba/dubbo/issues/50> |
| 13 | +- 最终我的 Dubbo-admin 的 pom.xml 为这样的: |
| 14 | + |
| 15 | + |
| 16 | +``` xml |
| 17 | +<!-- |
| 18 | + - Copyright 1999-2011 Alibaba Group. |
| 19 | + - |
| 20 | + - Licensed under the Apache License, Version 2.0 (the "License"); |
| 21 | + - you may not use this file except in compliance with the License. |
| 22 | + - You may obtain a copy of the License at |
| 23 | + - |
| 24 | + - http://www.apache.org/licenses/LICENSE-2.0 |
| 25 | + - |
| 26 | + - Unless required by applicable law or agreed to in writing, software |
| 27 | + - distributed under the License is distributed on an "AS IS" BASIS, |
| 28 | + - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 29 | + - See the License for the specific language governing permissions and |
| 30 | + - limitations under the License. |
| 31 | +--> |
| 32 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 33 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
| 34 | + <modelVersion>4.0.0</modelVersion> |
| 35 | + <parent> |
| 36 | + <groupId>com.alibaba</groupId> |
| 37 | + <artifactId>dubbo-parent</artifactId> |
| 38 | + <version>2.5.4-SNAPSHOT</version> |
| 39 | + </parent> |
| 40 | + <artifactId>dubbo-admin</artifactId> |
| 41 | + <packaging>war</packaging> |
| 42 | + <name>${project.artifactId}</name> |
| 43 | + <description>The admin module of dubbo project</description> |
| 44 | + <properties> |
| 45 | + <wtpversion>1.5</wtpversion> |
| 46 | + <wtpContextName>/</wtpContextName> |
| 47 | + <eclipse.useProjectReferences>false</eclipse.useProjectReferences> |
| 48 | + <skip_maven_deploy>false</skip_maven_deploy> |
| 49 | + </properties> |
| 50 | + <dependencies> |
| 51 | + <dependency> |
| 52 | + <groupId>com.alibaba</groupId> |
| 53 | + <artifactId>dubbo</artifactId> |
| 54 | + <version>${project.parent.version}</version> |
| 55 | + <exclusions> |
| 56 | + <exclusion> |
| 57 | + <groupId>org.springframework</groupId> |
| 58 | + <artifactId>spring</artifactId> |
| 59 | + </exclusion> |
| 60 | + </exclusions> |
| 61 | + </dependency> |
| 62 | + |
| 63 | + <dependency> |
| 64 | + <groupId>com.alibaba.citrus</groupId> |
| 65 | + <artifactId>citrus-webx-all</artifactId> |
| 66 | + <version>3.1.6</version> |
| 67 | + </dependency> |
| 68 | + <dependency> |
| 69 | + <groupId>org.apache.velocity</groupId> |
| 70 | + <artifactId>velocity</artifactId> |
| 71 | + <version>1.7</version> |
| 72 | + </dependency> |
| 73 | + |
| 74 | + <dependency> |
| 75 | + <groupId>org.javassist</groupId> |
| 76 | + <artifactId>javassist</artifactId> |
| 77 | + </dependency> |
| 78 | + <dependency> |
| 79 | + <groupId>org.jboss.netty</groupId> |
| 80 | + <artifactId>netty</artifactId> |
| 81 | + </dependency> |
| 82 | + <dependency> |
| 83 | + <groupId>org.apache.mina</groupId> |
| 84 | + <artifactId>mina-core</artifactId> |
| 85 | + </dependency> |
| 86 | + <dependency> |
| 87 | + <groupId>org.glassfish.grizzly</groupId> |
| 88 | + <artifactId>grizzly-core</artifactId> |
| 89 | + </dependency> |
| 90 | + <dependency> |
| 91 | + <groupId>org.apache.httpcomponents</groupId> |
| 92 | + <artifactId>httpclient</artifactId> |
| 93 | + </dependency> |
| 94 | + <dependency> |
| 95 | + <groupId>com.alibaba</groupId> |
| 96 | + <artifactId>fastjson</artifactId> |
| 97 | + </dependency> |
| 98 | + <dependency> |
| 99 | + <groupId>com.thoughtworks.xstream</groupId> |
| 100 | + <artifactId>xstream</artifactId> |
| 101 | + </dependency> |
| 102 | + <dependency> |
| 103 | + <groupId>org.apache.bsf</groupId> |
| 104 | + <artifactId>bsf-api</artifactId> |
| 105 | + </dependency> |
| 106 | + <dependency> |
| 107 | + <groupId>org.apache.zookeeper</groupId> |
| 108 | + <artifactId>zookeeper</artifactId> |
| 109 | + </dependency> |
| 110 | + <dependency> |
| 111 | + <groupId>com.github.sgroschupf</groupId> |
| 112 | + <artifactId>zkclient</artifactId> |
| 113 | + </dependency> |
| 114 | + <dependency> |
| 115 | + <groupId>com.netflix.curator</groupId> |
| 116 | + <artifactId>curator-framework</artifactId> |
| 117 | + </dependency> |
| 118 | + <dependency> |
| 119 | + <groupId>com.googlecode.xmemcached</groupId> |
| 120 | + <artifactId>xmemcached</artifactId> |
| 121 | + </dependency> |
| 122 | + <dependency> |
| 123 | + <groupId>org.apache.thrift</groupId> |
| 124 | + <artifactId>libthrift</artifactId> |
| 125 | + </dependency> |
| 126 | + <dependency> |
| 127 | + <groupId>com.caucho</groupId> |
| 128 | + <artifactId>hessian</artifactId> |
| 129 | + </dependency> |
| 130 | + <dependency> |
| 131 | + <groupId>javax.servlet</groupId> |
| 132 | + <artifactId>servlet-api</artifactId> |
| 133 | + <scope>provided</scope> |
| 134 | + </dependency> |
| 135 | + <dependency> |
| 136 | + <groupId>log4j</groupId> |
| 137 | + <artifactId>log4j</artifactId> |
| 138 | + </dependency> |
| 139 | + <dependency> |
| 140 | + <groupId>org.slf4j</groupId> |
| 141 | + <artifactId>slf4j-api</artifactId> |
| 142 | + </dependency> |
| 143 | + <dependency> |
| 144 | + <groupId>org.slf4j</groupId> |
| 145 | + <artifactId>slf4j-log4j12</artifactId> |
| 146 | + </dependency> |
| 147 | + <dependency> |
| 148 | + <groupId>redis.clients</groupId> |
| 149 | + <artifactId>jedis</artifactId> |
| 150 | + </dependency> |
| 151 | + <dependency> |
| 152 | + <groupId>javax.validation</groupId> |
| 153 | + <artifactId>validation-api</artifactId> |
| 154 | + </dependency> |
| 155 | + <dependency> |
| 156 | + <groupId>org.hibernate</groupId> |
| 157 | + <artifactId>hibernate-validator</artifactId> |
| 158 | + </dependency> |
| 159 | + <dependency> |
| 160 | + <groupId>javax.cache</groupId> |
| 161 | + <artifactId>cache-api</artifactId> |
| 162 | + </dependency> |
| 163 | + </dependencies> |
| 164 | + <build> |
| 165 | + <plugins> |
| 166 | + <plugin> |
| 167 | + <groupId>org.mortbay.jetty</groupId> |
| 168 | + <artifactId>maven-jetty-plugin</artifactId> |
| 169 | + <version>${jetty_version}</version> |
| 170 | + <configuration> |
| 171 | + <contextPath>/</contextPath> |
| 172 | + <scanIntervalSeconds>10</scanIntervalSeconds> |
| 173 | + <connectors> |
| 174 | + <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> |
| 175 | + <port>8080</port> |
| 176 | + <maxIdleTime>60000</maxIdleTime> |
| 177 | + </connector> |
| 178 | + </connectors> |
| 179 | + </configuration> |
| 180 | + </plugin> |
| 181 | + </plugins> |
| 182 | + </build> |
| 183 | +</project> |
| 184 | + |
| 185 | +``` |
| 186 | + |
| 187 | +- 部署在 Tomcat 之后,如果需要修改 zookeeper 的地址,以及默认用户的登录密码,可以在这里改:`vim /usr/program/tomcat8/webapps/ROOT/WEB-INF/dubbo.properties` |
| 188 | +- 里面内容: |
| 189 | + |
| 190 | +``` ini |
| 191 | +dubbo.registry.address=zookeeper://127.0.0.1:2181 |
| 192 | +dubbo.admin.root.password=root |
| 193 | +dubbo.admin.guest.password=guest |
| 194 | +``` |
0 commit comments