sh时找不到JAVA_HOME

正文从前

后天很气恼!!想要学点东西,但是老是被环境所界定。Hadoop那么些见鬼的条件,作者只是运转单机格局,结果正是都不成功。好不不难磕磕盼盼的究竟把啥缺的东西都找出来了结果最终依旧退步了。权且笔者实在不想去看退步记录,因为即将睡了后天再说吗。其它作者那里有《Hadoop
权威指南》第叁版的翻译版本(华师范大学翻译)。笔者前日吃完晚饭去书店逛的时候又见到了第六版的盗版书。所以见猎心喜之下买了归来。要是有哪位同志想要哪一页,能够让自家庭扶助助拍一下,当然全本就免了,本人看电子书呢!!

图片 1

正文

后天蒙受的多个一点都不小的标题是。Java笔者无能为力找到安装路径。这几乎是巨坑??配置$HADOOP_HOME/etc/hadoop/hadoop-env.sh这些见鬼的实物的时候,找不到JAVA_HOME???岂不是要gg,那也太惨了???所以自身左找右找,终于给自身逮到了!上面是博客来源,多谢大神!!

Linux环境中查看java的安装路径,设置环境变量

别的,作者用此外一台云服务器亲自说明了自个儿前面介绍的那一篇老外写的很新版的Hadoop教程。具体请看下列链接:

【Hadoop学起来】分布式Hadoop的搭建(Ubuntu
17.04)

其它正是下载的能源立异啦,自身看评论!!

第一步:whereis java

[root@Hadoop Master java]# whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz

第二步:ls -lrt /usr/bin/java

[root@Hadoop Master java]# ls -lrt /usr/bin/java
lrwxrwxrwx. 1 root root 22 Nov  2 23:38 /usr/bin/java -> /etc/alternatives/java

第三步:ls -lrt /etc/alternatives/java

[root@Hadoop Master java]# ls -lrt /etc/alternatives/java
lrwxrwxrwx. 1 root root 46 Nov  2 23:38 /etc/alternatives/java -> /usr/lib/jvm/java

第4步:设置环境变量

vi 此文件/etc/profile
在profile文件末尾到场:,

export JAVA_HOME=/usr/lib/jvm/java
(上面这一行也加到标题里面那个地址的文件中去,记得把原来的删掉)
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
(我记得这一些好像也~/.bashrc这个文件里面,同样的也要生效一下)

第五步:使生效 :source /etc/profile

图片 2

图片 3

综述上边那个步骤就早已成功了更新JAVA的环境变量这一进度~~


图片 4

图片 5

从上边图片能够看出来。当自家运营gps命令的时候。是截然能够来得出Hadoop须要的那几个组件的。理论上来说应该能够达成那个标题。然而本身也不驾驭干什么,总是有bug!!!

root@VM-161-78-ubuntu:/home/ubuntu/hadoop/hadoop# bin/yarn jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.8.2.jar pi 16 1000

地点所供给的难题

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Picked up _JAVA_OPTIONS: -Xmx512M
Number of Maps  = 16
Samples per Map = 1000
18/01/10 00:41:47 WARN hdfs.DataStreamer: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user/root/QuasiMonteCarlo_1515516105834_522663899/in/part0 could only be replicated to 0 nodes instead of minReplication (=1).  There are 0 datanode(s) running and no node(s) are excluded in this operation.
    at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:1728)
    at org.apache.hadoop.hdfs.server.namenode.FSDirWriteFileOp.chooseTargetForNewBlock(FSDirWriteFileOp.java:265)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:2515)
    at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:828)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:507)
    at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:447)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:989)
    at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:847)
    at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:790)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1836)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2486)

    at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1483)
    at org.apache.hadoop.ipc.Client.call(Client.java:1429)
    at org.apache.hadoop.ipc.Client.call(Client.java:1339)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:227)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:116)
    at com.sun.proxy.$Proxy10.addBlock(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.addBlock(ClientNamenodeProtocolTranslatorPB.java:440)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:409)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeMethod(RetryInvocationHandler.java:163)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invoke(RetryInvocationHandler.java:155)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeOnce(RetryInvocationHandler.java:95)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:346)
    at com.sun.proxy.$Proxy11.addBlock(Unknown Source)
    at org.apache.hadoop.hdfs.DataStreamer.locateFollowingBlock(DataStreamer.java:1809)
    at org.apache.hadoop.hdfs.DataStreamer.nextBlockOutputStream(DataStreamer.java:1609)
    at org.apache.hadoop.hdfs.DataStreamer.run(DataStreamer.java:704)
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user/root/QuasiMonteCarlo_1515516105834_522663899/in/part0 could only be replicated to 0 nodes instead of minReplication (=1).  There are 0 datanode(s) running and no node(s) are excluded in this operation.
    at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:1728)
    at org.apache.hadoop.hdfs.server.namenode.FSDirWriteFileOp.chooseTargetForNewBlock(FSDirWriteFileOp.java:265)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:2515)
    at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:828)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:507)
    at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:447)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:989)
    at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:847)
    at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:790)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1836)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2486)

    at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1483)
    at org.apache.hadoop.ipc.Client.call(Client.java:1429)
    at org.apache.hadoop.ipc.Client.call(Client.java:1339)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:227)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:116)
    at com.sun.proxy.$Proxy10.addBlock(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.addBlock(ClientNamenodeProtocolTranslatorPB.java:440)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:409)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeMethod(RetryInvocationHandler.java:163)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invoke(RetryInvocationHandler.java:155)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeOnce(RetryInvocationHandler.java:95)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:346)
    at com.sun.proxy.$Proxy11.addBlock(Unknown Source)
    at org.apache.hadoop.hdfs.DataStreamer.locateFollowingBlock(DataStreamer.java:1809)
    at org.apache.hadoop.hdfs.DataStreamer.nextBlockOutputStream(DataStreamer.java:1609)
    at org.apache.hadoop.hdfs.DataStreamer.run(DataStreamer.java:704)

地方是笔者的运转记录。笔者是实在不想去看哪个地点出难点了。今天延续看本身的书啊,这几个烦恼的问题留到未来化解。现在对这么些东西的掌握还不够,极不雅观出什么难题来!

图片 6

诸君再看一下自笔者别的一台云服务器上的均等操作。那台服务器是异域的,所以那时在官网下载镜像的时候大约通旅客快车到难以想象。不过后来种种幺蛾子,甚至近来自家意识她的NameNode会平时本人关闭,YA中华VN那小畜生也是一样的德行!!

正文之后

背着了!有人催笔者睡觉了。这几天看看Hadoop吧。毕设究竟要做那地方的事物。所以估量会很悠久的战线。开个类别。立个Flag咯~溜了溜了

图片 7

相关文章