⑴ apache安装后我用的8000端口 输入localhost:8000 IE显示it works 而火狐和谷歌浏览器显示index of/
8000端口已经被占用了,你查一下看是哪个服务用了这个端口,可以改下apache的默认端口版(端口号要没被占用权),也可以把另外那个服务的默认端口改下。
改apache的默认端口的方法:找到apache安装目录,下面有一个conf的文件夹,进去里面有个httpd.conf的文件,用记事本打开,ctrl+f 查找Listen,找到
#Listen 12.34.56.78:80
Listen 8000
这一段,把8000改下就好了。你输入网址的时候端口号要对应改下
⑵ Google guava和Apache commons哪个好
guava是通过maven构建的,最新代码可以从github上下载, 在Eclipse中,通过File-Import,选择maven就可以轻松导入了
⑶ Google推出了Apache Beam以后,spark和flink的路已经要走完了么
可能是这样的:后期大数据处理平台变得很多之后,各领域需要使用不同的平台处回理不一样的业务,这样就答需要了解各种平台的二次开发。
且如果业务之间有交互,就会对业务人员编程能力有较高的要求。如果用了Beam,Bang!你只需要学会Beam的编程模式就可以了,底层执行通过配置项来实现。
⑷ apache日志如何记录百度谷歌等蜘蛛(追加分)
你想要查看网络或者是谷歌的蜘蛛是否爬过自己的网站,我可以给你提供一下例子,呵呵版,把自权己的日志分享给你看一下,告诉你如何来看蜘蛛来访情况。
你打开网站的日志,在里面查找网络或者是谷歌蜘蛛的名字
网络的蜘蛛是spider,谷歌的蜘蛛是Googlebot
然后可以看一下具体的情况,假如像下面这个例子:
GET /index.htm - 80 - 220.181.7.32 Baispider+(+http://www..com/search/spider.htm) 200 0 0
它的含义是:来自220.181.7.32这个IP地址的网络蜘蛛来到你的网站,成功的抓取了index.htm首页,200代码表示的是成功抓取,404是错误页,还有一些其他的代码你可以在网上查一下。
希望通过上面的这个例子,你能了解自己站的情况。
⑸ Google guava和Apache commons哪个好
Guava 的 FAQ 部分有专门解答:
Why did Google build all this, when it could have tried to improve the Apache Commons Collections instead?
The Apache Commons Collections very clearly did not meet our needs. It does not use generics, which is a problem for us as we hate to get compilation warnings from our code. It has also been in a "holding pattern" for a long time. We could see that it would require a pretty major investment from us to fix it up until we were happy to use it, and in the meantime, our own library was already growing organically.
An important difference between the Apache library and ours is that our collections very faithfully adhere to the contracts specified by the JDK interfaces they implement. If you review the Apache documentation, you'll find countless examples of violations. They deserve credit for pointing these out so clearly, but still, deviating from standard collection behavior is risky! You must be careful what you do with such a collection; bugs are always just waiting to happen.
Our collections are fully generified and never violate their contracts (with isolated exceptions, where JDK implementations have set a strong precedent for acceptable violations). This means you can pass one of our collections to any method that expects a Collection and feel pretty confident that things will work exactly as they should.
简单地说:
Apache Commons Collections 3.x 不支持泛型,Guava 支持
Guava 实现了 JDK 的标准接口,而 Apache Commons Collections 3.x 有很多违反标准的地方
Apache Commons Collections 4.x 的发行注记如下:
Majorchangessince3.2.1
(varargs,Iterable)
Removeddeprecatedclasses/
.util.Queue
/Get(seealsopackagesplitmap)
从 4.x 开始,Apache Commons Collections 开始使用 JDK 5 的特性(包括泛型),此外也去除、添加了很多内容
各有千秋, 我主要使用Apache Commons ,辅助使用 Google guava
但是细节方法上还是有区别的, 比如
GoogleGuava Splitter 对比 Apache StringUtils
apache commons的StringUtils提供的常用功能介绍,但是google的guava也提供了一些字符串处理的常见功能,所以,将对两者的字符串分割函数做一次比较详细的对比(结果比较surprise)。
区别
首先看基本的使用方法:
//ApacheStringUtils...
String[]tokens1=StringUtils.split("one,two,three",',');
//GoogleGuavasplitter...
Iteratable<String>tokens2=Splitter.on(','),split("one,two,three");
google提供的方法更加的面向对象一点,因为它要先创建一个Splitter对象,然后使用它来分割字符串,而apache的方法则有点函数式编程的味道,它的方法都是静态的。
这里我更加倾向于采用google的splitter,因为这个对象是可以重用的,且可以在其上附加更多的功能,比如trim,去掉空的元素等,一切都很简单。
SplitterniceCommaSplitter=Splitter.on(',').omitEmptyString().trimResults();
niceCommaSplitter.split("one,,two,three");//"one","two","three"
niceCommaSplitter.split("four,five");//"four","five"
看起来有点用,还有其他区别么?
另外一个需要注意的地方就是Splitter返回的是Iteratable<String>,而StringUtils.split返回的是一个String数组。
大部分使用分隔符的情况是我们需要对字符串按照分隔符进行遍历处理,仅此而已。
下面就是常用的代码性能对比的例子:
finalStringnumberList="One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten";
longstart=System.currentTimeMillis();
for(inti=0;i<1000000;i++){
StringUtils.split(numberList,',');
}
System.out.println(System.currentTimeMillis()-start);
start=System.currentTimeMillis();
for(inti=0;i<1000000;i++){
Splitter.on(',').split(numberList);
}
System.out.println(System.currentTimeMillis()-start);
代码很简单,就是都对同一个字符串进行100万次的分隔操作,看看时间上的区别,结果如下:
983
165
很明显,guava的速度快很多,这个程序如果运行在每天处理大量字符串的服务中,那么性能差异更加明显。我想其中的原因是Splitter返回的是Iterable<String>,而StringUtils.split返回的是一个String[],需要创建新的String对象,导致耗时增加。
如果我们对Splitter对象缓存,那么速度提高更多:
start=System.currentTimeMillis();
Splitters=Splitter.on(',');
for(inti=0;i<1000000;i++){
s.split(numberList);
}
System.out.println(System.currentTimeMillis()-start);
结果为12,神奇吧,呵呵
⑹ 开源项目属于谁就像安卓 apache开源等开源项目,那么谷歌拥有安卓吗
谷歌当然拥有安卓,要不然谷歌不会花那么多钱、人力与精力推广安卓。
开源项目属于开发开源项目的个人或者公司所有,正常不收费,如果要企业定制就需要收费了。
⑺ Google guava和Apache commons哪个好
Guava 的 FAQ 部分有专门解答:
Why did Google build all this, when it could have tried to improve the Apache Commons Collections instead?
The Apache Commons Collections very clearly did not meet our needs. It does not use generics, which is a problem for us as we hate to get compilation warnings from our code. It has also been in a "holding pattern" for a long time. We could see that it would require a pretty major investment from us to fix it up until we were happy to use it, and in the meantime, our own library was already growing organically.
An important difference between the Apache library and ours is that our collections very faithfully adhere to the contracts specified by the JDK interfaces they implement. If you review the Apache documentation, you'll find countless examples of violations. They deserve credit for pointing these out so clearly, but still, deviating from standard collection behavior is risky! You must be careful what you do with such a collection; bugs are always just waiting to happen.
Our collections are fully generified and never violate their contracts (with isolated exceptions, where JDK implementations have set a strong precedent for acceptable violations). This means you can pass one of our collections to any method that expects a Collection and feel pretty confident that things will work exactly as they should.
简单地说:
Apache Commons Collections 3.x 不支持泛型,Guava 支持
Guava 实现了 JDK 的标准接口,而 Apache Commons Collections 3.x 有很多违反标准的地方
Apache Commons Collections 4.x 的发行注记如下:
Major changes since 3.2.1
Use of generics and other language features introced in Java 5 (varargs, Iterable)
Removed deprecated classes / methods and features which are now supported by the JDK
Replaced Buffer interface with java.util.Queue
Added concept of split maps with respective interfaces Put / Get (see also package splitmap)
Added new Trie interface together with an implementation of a Patricia Trie
从 4.x 开始,Apache Commons Collections 开始使用 JDK 5 的特性(包括泛型),此外也去除、添加了很多内容
各有千秋, 我主要使用Apache Commons ,辅助使用 Google guava
⑻ Google推出了Apache Beam以后,spark和flink的路已经要走完了么
实时领域不一定要使用它这个架构,但是可以借用这个框架,尤其是在一些内细分的场景上。
一个简单的容场景是提供一套API可以在Storm和Flink上切换引擎。不过自从Flink问世后,开源Storm的使用价值已经不大了,除了360携程等厂使用自己改造的Storm或者JStorm,新上线的业务一般还是走了Spark Streaming 或者Flink.
⑼ Apache的Mesos和Google的Kubernetes 有什么区别
Kubernetes是一个开源项目,它把谷歌的集群管理工具引入到虚拟机和裸机场景中。它可以完美运行在现代的操作系统环境(比如CoreOS
和Red Hat
Atomic),并提供可以被你管控的轻量级的计算节点。Kubernetes使用Golang开发,具有轻量化、模块化、便携以及可扩展的特点。我们
(Kubernetes开发团队)正在和一些不同的技术公司(包括维护着Mesos项目的MesoSphere)合作来把Kubernetes升级为一种
与计算集群交互的标准方式。Kubernetes重新实现了Google在构建集群应用时积累的经验。这些概念包括如下内容:
Pods:一种将容器组织在一起的方法;
Replication Controllers:一种控制容器生命周期的方法(译者注:Replication Controller确保任何时候Kubernetes集群中有指定数量的pod副本(replicas)在运行);
Labels:一种可以找到和查询容器的方法;
Services:一个用于实现某一特定功能的容器组;
因此,只要使用Kubernetes你就能够简单并快速的启动、移植并扩展集群。在这种情况下,集群就像是类似虚拟机一样灵活的资源,它是一个逻辑运算单元。打开它,使用它,调整它的大小,然后关闭它,就是这么快,就是这么简单。
Mesos和Kubernetes的愿景差不多,但是它们在不同的生命周期中各有不同的优势。Mesos是分布式系统内核,它可以将不同的机器整
合在一个逻辑计算机上面。当你拥有很多的物理资源并想构建一个巨大的静态的计算集群的时候,Mesos就派上用场了。有很多的现代化可扩展性的数据处理应
用都可以在Mesos上运行,包括Hadoop、Kafka、Spark等,同时你可以通过容器技术将所有的数据处理应用都运行在一个基础的资源池中。在
某个方面来看,Mesos是一个比Kubernetes更加重量级的项目,但是得益于那些像Mesosphere一样的贡献者,Mesos正在变得更加简
单并且容易管理。
有趣的是Mesos正在接受Kubernetes的理念,并已经开始支持Kubernetes
API。因此如果你需要它们的话,它将是对你的Kubernetes应用去获得更多能力的一个便捷方式(比如高可用的主干、更加高级的调度命令、去管控很
大数目结点的能力),同时能够很好的适用于产品级工作环境中(毕竟Kubernetes仍然还是一个初始版本)。
当被问到区别的时候,我会这样回答:
如果你是一个集群世界的新手,那Kubernetes是一个很棒的开始。它可以用最快的、最简单的、最轻量级的方式来解决你的问题,并帮
助你进行面向集群的开发。它提供了一个高水平的可移植方案,因为很多厂商已经开始支持Kubernetes,例如微软、IBM、Red
Hat、CoreOS、MesoSphere、VMWare等。
如果你拥有已经存在的工作任务(Hadoop、Spark、Kafka等),那Mesos可以给你提供了一个将不同工作任务相互交错的框架,然后还可以加入一些新的东西,比如Kubernetes应用。
如果你想使用的功能Kuberntes还没实现,那Mesos是一个不错的替代品,毕竟它已经成熟。
⑽ 为什么Google用Apache Beam彻底替换掉MapRece
原因主要有两点:
1、尽管在过去谷歌一直是闭源的,但在为云客户服务的过程中,谷歌已经认识到了开源软件的的巨大价值,比如基于谷歌三篇论文产生的Hadoop社区就是一个非常好的例子。思想上的转变使Apache Beam的诞生成为可能;
2、就Beam这个项目而言,要成功的必要条件之一是,必须有已经开源的Runner为Beam模型提供充分的支持,这样它才会在自建云和非谷歌云的场景下成为一个非常有竞争力的备选方案。去年Apache Flink在他们的系统内采用了Beam模型,这一条件也得到了满足;
无利不起早,谷歌这样做也是有着直接商业动机的,就是希望能有尽可能多的Apache Beam数据处理流水线可以运行在谷歌的Cloud Dataflow上,别忘了这是Apache Beam的原型。进一步说,采用开源的方式来引导这件事,也是有许多直接好处的:
1、支持Apache Beam的Runner越多,它作为一个平台的吸引力就越大;
2、使用Apache Beam的用户越多,想在谷歌云平台上运行Apache Beam的用户也就越多;
3、开发Apache Beam过程中吸引到的伙伴越多,那对这样的数据处理模型的推广就越有利;
而且,好处也不会全都归于谷歌,Apache Beam项目中的所有参与方都会受益。如果在构建数据处理流水线时存在着这样一个可移植的抽象层,那就会更容易出现新的Runner,它们可以专注于技术创新,提供更高的性能、更好的可靠性、更方便的运维管理等。换句话说,消除了对API的锁定,就解放了处理引擎,会导致更多产品之间的竞争,从而最终对整个行业起到良性的促进作用。
谷歌坚信Apache Beam就是数据批量处理和流式处理的未来。这么做会为各种不同的Runner营造一个健康的生态系统,让它们之间相互竞争,而最后可以让用户得到实在的好处。