本文共 5765 字,大约阅读时间需要 19 分钟。
一、jdk1.7.0_80的安装
二、maven的安装三、zookeeper的安装四、安装tomcat##########################################################################################
一、jdk安装 tzr xf jdk-8u152-linux-x64.tar.gz -C /usr/local/vim /etc/profile#---------------------------------------------------------------------------------------------------##JDK1.8.0_152 #添加如下#export JAVA_HOME=/usr/local/jdk1.8.0_152 ##export PATH=$PATH:$JAVA_HOME/bin ##export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/jre/lib/dt.jar:$JAVA_HOME/jre/lib/tools.jar##---------------------------------------------------------------------------------------------------#source /etc/profile #使配置生效#完成后的测试
#[root@ss jdk1.8.0_152]# java -version#java version "1.8.0_152"#Java(TM) SE Runtime Environment (build 1.8.0_152-b16)#Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)####################################################################################################################################################################################
二、maven的安装 #用于制作dubbo war包tar xf apache-maven-3.3.9-bin.tar.gz -C /usr/local/ vim /etc/profile #---------------------------------------------------------------------------# #Maven3.3.9 ##export MAVEN_HOME=/usr/local/apache-maven-3.3.9 ##export PATH=${PATH}:${MAVEN_HOME}/bin ##---------------------------------------------------------------------------#source /etc/profile#完成后的验证
#[root@ss WEB-INF]# mvn -v #查看启动状态#Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)#Maven home: /usr/local/apache-maven-3.3.9#Java version: 1.8.0_152, vendor: Oracle Corporation#Java home: /usr/local/jdk1.8.0_152/jre#Default locale: zh_CN, platform encoding: UTF-8#OS name: "linux", version: "3.10.0-327.el7.x86_64", arch: "amd64", family: "unix" ####################################################################################################################################################################################
三、zookeeper的安装tar xf zookeeper-3.4.6.tar.gz -C /usr/local/cd /usr/local/zookeeper-3.4.6/mkdir datacd conf/cp zoo_simple.cfg zoo.cfgvim zoo.cfg#---------------------------------------------------------------------------##dataDir=/usr/local/zookeeper-3.4.6/data #数据目录#clientPort=2181 #修改端口#---------------------------------------------------------------------------#cd ../bin/./zkServer.sh start #启动zookeeper./zkServer.sh status #查看启动状态#---------------------------------------------------------------------------##JMX enabled by default ##Using config: /usr/local/zookeeper-3.4.6/bin/../conf/zoo.cfg ##Mode: standalone #显示已启用#---------------------------------------------------------------------------#####################################################################################################################################################################################
四、安装tomcatmkdir /usr/local/dubboserver/ #创建服务目录dubboservertar xf apache-tomcat-7.0.94.tar.gz -C /usr/local/dubboserver/mv apache-tomcat-7.0.94/ dubbo-monitor-8888 #修改dubbo监控中心目录名字cd dubbo-monitor-8888vim conf/servere.xml#---------------------------------------------------------------------------#修改端口号,需规划好使用量,视具体情况定#<Server port="3888" shutdown="SHUTDOWN"> #shutdown端口8005改为3888#<Connector port="8888" protocol="HTTP/1.1" #web访问端口号8080改为8888#<Connector port="6888" protocol="AJP/1.3" redirectPort="8443" /> #8009改为6888#---------------------------------------------------------------------------##dubbo-admin的war包的导入
mv dubbo-admin-2.5.6.war /usr/local/dubboserver/dubbo-monitor-8888/webapps/./bin/startup.sh #启动tomcat#---------------------------------------------------------------------------##[root@ss dubbo-monitor-8888]# ps -ef |grep tomcat #查看启动状态#root 15095 1 79 18:25 pts/1 00:00:03 /usr/local/jdk1.8.0_152/bin/java -Djava.util.logging.config.file=/usr/local/dubboserver/dubbo-monitor-8888/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Dignore.endorsed.dirs= -classpath /usr/local/dubboserver/dubbo-monitor-8888/bin/bootstrap.jar:/usr/local/dubboserver/dubbo-monitor-8888/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/dubboserver/dubbo-monitor-8888 -Dcatalina.home=/usr/local/dubboserver/dubbo-monitor-8888 -Djava.io.tmpdir=/usr/local/dubboserver/dubbo-monitor-8888/temp org.apache.catalina.startup.Bootstrap start#---------------------------------------------------------------------------##dubbo监控端tomcat的操作:
配置zookeeper注册中心的用户名密码和端口vim /usr/local/dubboserver/dubbo-monitor-8888/webapps/ROOT/WEB-INF/dubbo.properties#---------------------------------------------------------------------------##dubbo.registry.address=zookeeper://127.0.0.1:2181 ##dubbo.admin.root.password=root ##dubbo.admin.guest.password=guest ##---------------------------------------------------------------------------#浏览器访问dubbo地址加端口,查看
###########################################################################################项目tomcat的操作
查看修改提供者和消费者的zookeeper注册中心地址vim webapps/ROOT/WEB-INF/classes/applicationContext-provider.xml#---------------------------------------------------------------------------##<dubbo:registry protocol="zookeeper" address="10.10.20.16:2181"/> ##---------------------------------------------------------------------------#vim webapps/ROOT/WEB-INF/classes/applicationContext-consumer.xml
#---------------------------------------------------------------------------##<dubbo:registry address="zookeeper://10.10.20.16:2181" check="false"/> ##---------------------------------------------------------------------------###########################################################################################
转载于:https://blog.51cto.com/13006632/2389352