Linux 下 Eureka 服务器的部署

1. 查看 Linux 相关信息
        版本查看
# cat /etc/issue
CentOS release 6.5 (Final)
        位数查看
# getconf LONG_BIT
64
        第 2 - 4 步是 Eureka Server war 包的构建,如果你嫌自己构建麻烦可以去 http://mvnrepository.com/artifact/com.netflix.eureka/eureka-server 下载一个,比如作者下载的是 eureka-server-1.1.134.war,然后跳过 2 - 4 步直接进入第 5 步。
        2. 安装 git
# yum install git

        查看安装结果
# git --version
git version 1.7.1
# which git
/usr/bin/git
        3. 安装 gradle
        安装 Gradle 要求实现好了 JDK(关于 Linux 上 JDK 的安装参考《如何在 64 位 linux 机器上安装 jdk1.6?》)。Gradle 自带 Groovy 库,已有安装好的 Groovy 将被 Gradle 忽视。
        然后去官网下载 gradle-1.12-bin.zip(大小 41 MB)到 /root/kdf 目录:http://www.gradle.org/downloads
# unzip gradle-1.12-bin.zip
# cp -r ~/kdf/gradle-1.12 /usr/local/gradle-1.12
# vi /etc/profile

        在末尾添加以下几行:

export GRADLE_HOME=/usr/local/gradle-1.12
export PATH=$PATH:$GRADLE_HOME/bin

保存退出,然后执行
# source /etc/profile
        验证环境变量:
# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/java/jdk1.7.0_60/bin:/usr/local/gradle-1.12/bin
        验证 gradle 是否安装成功:
# gradle -v
------------------------------------------------------------
Gradle 1.12
------------------------------------------------------------

Build time:   2014-04-29 09:24:31 UTC
Build number: none
Revision:     a831fa866d46cbee94e61a09af15f9dd95987421

Groovy:       1.8.6
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
Ivy:          2.2.0
JVM:          1.7.0_60 (Oracle Corporation 24.60-b09)
OS:           Linux 2.6.32-431.el6.x86_64 amd64
        输出结果中显示了我们安装的 Gradle 的版本以及本地环境配置信息,证明安装成功。
        4. 构建 Eureka 服务器
        从 github 获取 Eureka 源码:
# git clone https://github.com/Netflix/eureka.git
        在存放源码的路径下执行以下命令以构建 Eureka 服务器:
# cd eureka/
# ./gradlew clean build

        成功后在 ./eureka-server/build/libs/ 目录下找到 war 包。
        5. 安装 tomcat
        安装 Eureka 服务器要求事先安装好了 Tomcat。去 http://tomcat.apache.org/ 下载你想要的版本,比如作者下载的是 apache-tomcat-6.0.41.tar.gz,大小 7 MB。
# tar zxvf apache-tomcat-6.0.41.tar.gz
# cp -r apache-tomcat-6.0.41 /usr/local/tomcat
# /usr/local/tomcat/bin/startup.sh

        其他电脑客户端访问 http://serverIP:8080,如果小猫没出来,在服务器执行
# curl http://localhost:8080
        有 Tomcat 管理界面 HTML 文字输出,说明没有开放服务器防火墙 8080 端口,开放该端口或者直接关掉防火墙。
        6. 部署 Eureka server
# /usr/local/tomcat/bin/shutdown.sh
# cp eureka-server-1.1.134.war /usr/local/tomcat/webapps/eureka.war
# /usr/local/tomcat/bin/startup.sh

        Tomcat 启动以后,其他电脑客户端访问 http://serverIP:8080/eureka,404。查看 /usr/local/tomcat/logs/catalina.out,发现有警告信息:
2014-07-03 09:47:00,614 WARN  com.netflix.config.util.ConfigurationUtils:165 [main] [loadFromPropertiesFile] Unable to load properties file
org.apache.commons.configuration.ConfigurationException: Unable to load the configuration from the URL file:/usr/local/tomcat/webapps/eureka/WEB-INF/classes/eureka-${environment}-${region}.properties
at org.apache.commons.configuration.DefaultFileSystem.getInputStream(DefaultFileSystem.java:84)
at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:323)
at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:234)
at org.apache.commons.configuration.AbstractFileConfiguration.<init>(AbstractFileConfiguration.java:197)
at org.apache.commons.configuration.PropertiesConfiguration.<init>(PropertiesConfiguration.java:285)
at com.netflix.config.util.OverridingPropertiesConfiguration.<init>(ConfigurationUtils.java:267)
at com.netflix.config.util.ConfigurationUtils.loadFromPropertiesFile(ConfigurationUtils.java:160)
at com.netflix.config.util.ConfigurationUtils.getConfigFromPropertiesFile(ConfigurationUtils.java:196)
at com.netflix.config.util.ConfigurationUtils.getPropertiesFromFile(ConfigurationUtils.java:214)
at com.netflix.config.ConfigurationManager.getPropertiesFromFile(ConfigurationManager.java:431)
at com.netflix.config.ConfigurationManager.loadCascadedProperties(ConfigurationManager.java:288)
at com.netflix.config.ConfigurationManager.loadCascadedPropertiesFromResources(ConfigurationManager.java:268)
at com.netflix.eureka.DefaultEurekaServerConfig.init(DefaultEurekaServerConfig.java:93)
at com.netflix.eureka.DefaultEurekaServerConfig.<init>(DefaultEurekaServerConfig.java:75)
at com.netflix.eureka.EurekaBootStrap.initEurekaEnvironment(EurekaBootStrap.java:130)
at com.netflix.eureka.EurekaBootStrap.contextInitialized(EurekaBootStrap.java:88)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.io.FileNotFoundException: /usr/local/tomcat/webapps/eureka/WEB-INF/classes/eureka-${environment}-${region}.properties (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at java.net.URL.openStream(URL.java:1037)
at org.apache.commons.configuration.DefaultFileSystem.getInputStream(DefaultFileSystem.java:80)
... 39 more
        这是找不到 eureka-${environment}-${region}.properties 配置文件
# /usr/local/tomcat/bin/shutdown.sh
# vi /usr/local/tomcat/webapps/eureka/WEB-INF/classes/eureka-server.properties

        将最后一行 
@next=eureka-${environment}-${region}.properties
        去掉。
        此外,/usr/local/tomcat/logs/catalina.out 在上述警告后边还有以下错误:
2014-07-03 09:47:01,920 ERROR com.netflix.discovery.DiscoveryClient:1015 [main] [makeRemoteCall] Can‘t get a response from http://localhost/eureka/v2/apps/
Can‘t contact any eureka nodes - possibly a security group issue?
com.sun.jersey.api.client.ClientHandlerException: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:120)
at com.sun.jersey.api.client.Client.handle(Client.java:648)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:670)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:503)
at com.netflix.discovery.DiscoveryClient.getUrl(DiscoveryClient.java:1389)
at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:960)
at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:909)
at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:757)
at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:653)
at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:237)
at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:169)
at com.netflix.discovery.DiscoveryManager.initComponent(DiscoveryManager.java:84)
at com.netflix.eureka.EurekaBootStrap.initEurekaEnvironment(EurekaBootStrap.java:159)
at com.netflix.eureka.EurekaBootStrap.contextInitialized(EurekaBootStrap.java:88)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:151)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:827)
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
... 39 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
... 46 more
        这是 Tomcat 默认端口是 8080,而 Eureka 默认为 80。本文示例暂时用 8080,所以
# vi /usr/local/tomcat/webapps/eureka/WEB-INF/classes/eureka-client.properties
        将 eureka.port=80 改为 eureka.port=8080。
# vi /usr/local/tomcat/webapps/eureka/WEB-INF/classes/eureka-client-test.properties
        将
eureka.serviceUrl.defaultZone=http://localhost/eureka/v2/
eureka.serviceUrl.default.defaultZone=http://localhost/eureka/v2/
        改为
eureka.serviceUrl.defaultZone=http://localhost:8080/eureka/v2/
eureka.serviceUrl.default.defaultZone=http://localhost:8080/eureka/v2/
        重启 Tomcat
# /usr/local/tomcat/bin/startup.sh
# tail -f /usr/local/tomcat/logs/catalina.out

        或者直接查看 catalina.out,发现有以下错误:
2014-07-03 14:33:05,484 ERROR com.netflix.discovery.DiscoveryClient:1015 [main] [makeRemoteCall] Can‘t get a response from http://localhost:8080/eureka/v2/apps/
Can‘t contact any eureka nodes - possibly a security group issue?
com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:120)
at com.sun.jersey.api.client.Client.handle(Client.java:648)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:670)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:503)
at com.netflix.discovery.DiscoveryClient.getUrl(DiscoveryClient.java:1389)
at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:960)
at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:909)
at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:757)
at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:653)
at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:237)
at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:169)
at com.netflix.discovery.DiscoveryManager.initComponent(DiscoveryManager.java:84)
at com.netflix.eureka.EurekaBootStrap.initEurekaEnvironment(EurekaBootStrap.java:159)
at com.netflix.eureka.EurekaBootStrap.contextInitialized(EurekaBootStrap.java:88)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:712)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:517)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:827)
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
... 39 more
        这个正常的,启动的时候会去找其他的 server,找不到,过一会就自己启动了(这时候我们去访问 http://serverIP:8080 应该看不到那只小猫)。
        等待五分钟左右,访问 http://serverIP:8080,可以看到小猫页面。访问 http://serverIP:8080/eureka/,看到以下界面:

        说明 Eureka Server 部署成功。
        参考资料

Linux 下 Eureka 服务器的部署,布布扣,bubuko.com

时间: 2024-11-06 07:39:26

Linux 下 Eureka 服务器的部署的相关文章

Linux下Memcached服务器部署

操作系统:CentOS 6.x 64位 实现目的:安装部署Memcached服务器 一.防火墙设置 vi /etc/sysconfig/iptables #编辑防火墙配置文件,添加下面代码 -A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT :wq! #保存退出 service iptables restart #最后重启防火墙使配置生效 二.关闭SELINUX vi /etc/selinux/config #S

Linux下DNS服务器搭建详解

 Linux下DNS服务器搭建详解 DNS  即Domain Name System(域名系统)的缩写,它是一种将ip地址转换成对应的主机名或将主机名转换成与之相对应ip地址的一种机制.其中通过域名解析出ip地址的叫做正向解析,通过ip地址解析出域名的叫做反向解析. 下面对DNS的工作流程及原理进行简要说明 DNS的查询流程:需要解析服务的Client先查看本机的/etc/hosts:若无结果,则client查看本地的DNS缓存服务器:若无结果,则查找所属域的首选DNS服务器:若此时本地首选DN

linux下dhcp服务器的架构与实现

一.实验原理 在linux系统下架构DHCP服务器,为网络中的主机动态获取ip地址. 二.地址规划 192.168.2.0网络动态分配地址 地址池192.168.2.200 192.168.2.240 子网掩码 255.255.255.0 网关 192.168.2.254 DNS指向 202.102.224.68 202.102.227.68 三.实验步骤 ① 挂载光驱,安装dhcp server vim /etc/sysconfig/network-scripts/ifcfg-eth0 mou

linux下svn服务器的搭建

网上的教程实在是太恶心了,不是太老,就是有问题,刚参考的一篇文章也有问题.自己记录下来,以后用就方便了,现在一边重新安装一遍,一边记录.笔者亲测,今天是5月29号深夜. linux用的是centos6.2,yum install subversion,安装svn服务端.本篇操作均为root用户权限. 1.建立svn库目录. mkdir -p /opt/svndata/repos1 2.建立版本库 svnadmin create /opt/svndata/repos1 3.修改配置文件 (1)服务

linux下不同服务器间数据传输(rcp,scp,rsync,ftp,sftp,lftp,wget,curl)

因为工作原因,需要经常在不同的服务器见进行文件传输,特别是大文件的传输,因此对linux下不同服务器间数据传输命令和工具进行了研究和总结.主要是rcp,scp,rsync,ftp,sftp,lftp,wget,curl. rcp rcp不是一种安全的的传输文件的方式,rcp通过rsh(rsh见下面)来执行远程命令,要使用rcp必须经过一些配置,现在rcp已经被scp取代了,常用scp来进行文件传输.要使用rcp,需要具备以下条件: (1)如果系统中有/etc/hosts 文件,应确保该文件包含要

Linux下DHCP服务器的搭建

1.关闭防火墙和SELinux [[email protected] /]# service iptables stop [[email protected] /]# vim /etc/selinux/config SELINUX=permissive(将 enforcing改为permissive)保存退出 2.准备两台虚拟机,一台作为服务器,一台作为客户机,配置两个主机的IP地址,使服务器和客户机能够通信 服务器: [[email protected] /]# vim /etc/syscon

linux下不同服务器间数据传输(rcp,scp,rsync,ftp,sftp,lftp,wget,curl)(zz)

linux下不同服务器间数据传输(rcp,scp,rsync,ftp,sftp,lftp,wget,curl) 分类: linux2011-10-10 13:21 8773人阅读 评论(1) 收藏 举报 服务器linuxftp服务器文档commandssh 目录(?)[+] 因为工作原因,需要经常在不同的服务器见进行文件传输,特别是大文件的传输,因此对linux下不同服务器间数据传输命令和工具进行了研究和总结.主要是rcp,scp,rsync,ftp,sftp,lftp,wget,curl. r

Linux下Memcache服务器的安装

Linux下Memcache服务器的安装 环境需求: 安装Memcached需要libevent库的支持,所以请在安装Memcached之前检查有没有安装libevent.测试环境还需要PHP的支持,本文假设PHP已经安装到/usr/local/php目录下. 服务器端主要是安装memcache服务器端,Memcache用到了libevent这个库用于Socket的处理,所以还需要安装libevent. memcached下载地址:http://www.danga.com/memcached/

linux下不同服务器间数据传输(wget,scp)

一.wget是Linux下最常用的http/ftp文件下载工具1.wget断点续传,只需要加上-c参数即可,例如:代码:wget-chttp://www.abc.com/abc.zip-Oabc.zip2.当服务器上的文件比本地指定目录下的文件更新时才下载,-P指定目录,-N表示检查文件文件是否更新代码:wget-N-P/hom 一.wget是Linux下最常用的http/ftp文件下载工具1.wget断点续传,只需要加上-c参数即可,例如:代码: wget -c http://www.abc.