首页 \ 问答 \ 设置数据节点时Hadoop中的特权操作异常?(Privileged action exception in Hadoop while setting up data nodes?)

设置数据节点时Hadoop中的特权操作异常?(Privileged action exception in Hadoop while setting up data nodes?)

我在我的mac OS X中设置了hadoop框架。使用virtualbox,我安装了ubuntu服务器(一个nameNode)和另外两个ubuntu服务器作为datanode。 我已经根据我的知识正确设置了core-site.xml和其他配置。 当我使用start-all.sh启动框架时,一切似乎都很好。 在NameNode上执行jps ,每个数据节点都显示该进程处于活动状态。 但是在GUI网址上,我看到没有节点存在。 看附图。 以下是来自日志文件的错误消息:

2014-06-23 18:00:01,167 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: Web-server up at: 0.0.0.0:50070
2014-06-23 18:00:01,174 INFO org.apache.hadoop.ipc.Server: IPC Server Responder: starting
2014-06-23 18:00:01,175 INFO org.apache.hadoop.ipc.Server: IPC Server listener on 10001: starting
2014-06-23 18:00:01,178 INFO org.apache.hadoop.ipc.Server: IPC Server handler 0 on 10001: starting
2014-06-23 18:00:01,186 INFO org.apache.hadoop.ipc.Server: IPC Server handler 1 on 10001: starting
2014-06-23 18:00:01,190 INFO org.apache.hadoop.ipc.Server: IPC Server handler 2 on 10001: starting
2014-06-23 18:00:01,195 INFO org.apache.hadoop.ipc.Server: IPC Server handler 3 on 10001: starting
2014-06-23 18:00:01,195 INFO org.apache.hadoop.ipc.Server: IPC Server handler 4 on 10001: starting
2014-06-23 18:00:01,196 INFO org.apache.hadoop.ipc.Server: IPC Server handler 5 on 10001: starting
2014-06-23 18:00:01,198 INFO org.apache.hadoop.ipc.Server: IPC Server handler 6 on 10001: starting
2014-06-23 18:00:01,201 INFO org.apache.hadoop.ipc.Server: IPC Server handler 7 on 10001: starting
2014-06-23 18:00:01,206 INFO org.apache.hadoop.ipc.Server: IPC Server handler 8 on 10001: starting
2014-06-23 18:00:01,213 INFO org.apache.hadoop.ipc.Server: IPC Server handler 9 on 10001: starting
2014-06-23 18:00:05,692 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:sridhar cause:java.io.IOException: File /usr/local/hadoop/tmp/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2014-06-23 18:00:05,692 INFO org.apache.hadoop.ipc.Server: IPC Server handler 4 on 10001, call addBlock(/usr/local/hadoop/tmp/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_1288778011_1, null) from 127.0.0.1:56524: error: java.io.IOException: File /usr/local/hadoop/tmp/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
java.io.IOException: File /usr/local/hadoop/tmp/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
        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.hadoop.ipc.RPC$Server.call(RPC.java:587)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
2014-06-23 18:00:06,716 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:sridhar cause:java.io.IOException: File /usr/local/hadoop/tmp/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2014-06-23 18:00:06,716 INFO org.apache.hadoop.ipc.Server: IPC Server handler 0 on 10001, call addBlock(/usr/local/hadoop/tmp/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_1288778011_1, null) from 127.0.0.1:56524: error: java.io.IOException: File /usr/local/hadoop/tmp/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1

在此处输入图像描述

PS:我确实在寻找其他显示类似错误的帖子。 我试过了。 但没有成功

编辑:

namenode服务器在发出jps命令时不显示datanode和tasktracker。 datanode上的日志如下所示:(可能datanode没有建立连接)

2014-06-23 17:14:16,003 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: ubuntuhadoop/69.91.135.178:10001. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS) 2014-06-23 17:14:17,005 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: ubuntuhadoop/69.91.135.178:10001. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS) 2014-06-23 17:14:18,006 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: ubuntuhadoop/69.91.135.178:10001. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)


I have set-up hadoop framework in my mac OS X. Using virtualbox, I installed ubuntu server (one nameNode) and two more ubuntu server to act as datanodes. I have set up core-site.xml and other configurations correctly to my knowledge. when I start the framework using start-all.sh, everything seems fine. doing jps on NameNode and each datanodes shows that the process is active. but on the GUI url, I see that no nodes are live. see the attached image. Here is the error message from log file:

2014-06-23 18:00:01,167 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: Web-server up at: 0.0.0.0:50070
2014-06-23 18:00:01,174 INFO org.apache.hadoop.ipc.Server: IPC Server Responder: starting
2014-06-23 18:00:01,175 INFO org.apache.hadoop.ipc.Server: IPC Server listener on 10001: starting
2014-06-23 18:00:01,178 INFO org.apache.hadoop.ipc.Server: IPC Server handler 0 on 10001: starting
2014-06-23 18:00:01,186 INFO org.apache.hadoop.ipc.Server: IPC Server handler 1 on 10001: starting
2014-06-23 18:00:01,190 INFO org.apache.hadoop.ipc.Server: IPC Server handler 2 on 10001: starting
2014-06-23 18:00:01,195 INFO org.apache.hadoop.ipc.Server: IPC Server handler 3 on 10001: starting
2014-06-23 18:00:01,195 INFO org.apache.hadoop.ipc.Server: IPC Server handler 4 on 10001: starting
2014-06-23 18:00:01,196 INFO org.apache.hadoop.ipc.Server: IPC Server handler 5 on 10001: starting
2014-06-23 18:00:01,198 INFO org.apache.hadoop.ipc.Server: IPC Server handler 6 on 10001: starting
2014-06-23 18:00:01,201 INFO org.apache.hadoop.ipc.Server: IPC Server handler 7 on 10001: starting
2014-06-23 18:00:01,206 INFO org.apache.hadoop.ipc.Server: IPC Server handler 8 on 10001: starting
2014-06-23 18:00:01,213 INFO org.apache.hadoop.ipc.Server: IPC Server handler 9 on 10001: starting
2014-06-23 18:00:05,692 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:sridhar cause:java.io.IOException: File /usr/local/hadoop/tmp/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2014-06-23 18:00:05,692 INFO org.apache.hadoop.ipc.Server: IPC Server handler 4 on 10001, call addBlock(/usr/local/hadoop/tmp/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_1288778011_1, null) from 127.0.0.1:56524: error: java.io.IOException: File /usr/local/hadoop/tmp/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
java.io.IOException: File /usr/local/hadoop/tmp/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
        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.hadoop.ipc.RPC$Server.call(RPC.java:587)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
2014-06-23 18:00:06,716 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:sridhar cause:java.io.IOException: File /usr/local/hadoop/tmp/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2014-06-23 18:00:06,716 INFO org.apache.hadoop.ipc.Server: IPC Server handler 0 on 10001, call addBlock(/usr/local/hadoop/tmp/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_1288778011_1, null) from 127.0.0.1:56524: error: java.io.IOException: File /usr/local/hadoop/tmp/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1

enter image description here

PS: I did look for other posts that showed similar errors. I tried them. but not successful

EDIT:

The namenode server does not show datanodes and tasktracker on issuing jps command. The log on the datanode looks as follows: (probably datanode is not establishing connection)

2014-06-23 17:14:16,003 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: ubuntuhadoop/69.91.135.178:10001. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS) 2014-06-23 17:14:17,005 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: ubuntuhadoop/69.91.135.178:10001. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS) 2014-06-23 17:14:18,006 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: ubuntuhadoop/69.91.135.178:10001. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)


原文:
更新时间:2022-05-03 07:05

最满意答案

你在说什么是一个GUI。 最简单的示例使用matplotlib内置的小部件

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.mlab import bivariate_normal
from matplotlib.widgets import Slider, Button

#Setup figure and data
fig, ax = plt.subplots()
plt.subplots_adjust(bottom=0.25)
delta = 0.5
t = np.arange(0.0, 100.0, 0.1)
x = np.arange(-3.0, 4.001, delta)
y = np.arange(-4.0, 3.001, delta)
X, Y = np.meshgrid(x, y)
Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
Z = (Z1 - Z2) * 5.
cmap = plt.cm.rainbow
im = ax.pcolormesh(X, Y, Z, cmap=cmap)
fig.colorbar(im)
axcolor = 'lightgoldenrodyellow'
axtime = plt.axes([0.25, 0.1, 0.65, 0.03], axisbg=axcolor)
stime = Slider(axtime, 'Time', 0.0, 100.0, valinit=50.0)

#Routines to reset and update sliding bar
def reset(event):
    stime.reset()

def update(val):
    time = stime.val/10.
    Z = (Z1 - Z2) * time
    im.set_array(Z.ravel())
    fig.canvas.draw()

#Bind sliding bar and reset button  
stime.on_changed(update)
resetax = plt.axes([0.8, 0.025, 0.1, 0.04])
button = Button(resetax, 'Reset', color=axcolor, hovercolor='0.975')
button.on_clicked(reset)

plt.show()

这应该是一个开始。 如果您希望它看起来更好(并添加更多功能),那么您需要转到像wxpython这样的GUI框架,请查看示例。

更符合您数据结构的示例如下:

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.mlab import bivariate_normal
from matplotlib.widgets import Slider, Button

#Setup figure and data
fig, ax = plt.subplots()
plt.subplots_adjust(bottom=0.25)
delta = 0.5
t = np.linspace(0.0, 100.0, 256)
x = np.linspace(-4.0, 4.001, 512)
y = np.linspace(-4.0, 4.001, 512)
X, Y = np.meshgrid(x, y)
Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
XZslice = np.zeros((256,512,512))
for i in range(t.shape[0]):
    XZslice[i,:,:] = (Z1 - Z2) * t[i]/10.
cmap = plt.cm.rainbow
im = ax.pcolormesh(XZslice[128,:,:], cmap=cmap)
fig.colorbar(im)
axcolor = 'lightgoldenrodyellow'
axtime = plt.axes([0.25, 0.1, 0.65, 0.03], axisbg=axcolor)
stime = Slider(axtime, 'Time', 0.0, 100.0, valinit=50.0)

#Routines to reset and update sliding bar
def reset(event):
    stime.reset()

def update(val):
    time = int(stime.val/100.* 256)
    im.set_array(XZslice[time,:,:].ravel())
    fig.canvas.draw()

#Bind sliding bar and reset button  
stime.on_changed(update)
resetax = plt.axes([0.8, 0.025, 0.1, 0.04])
button = Button(resetax, 'Reset', color=axcolor, hovercolor='0.975')
button.on_clicked(reset)

plt.show()

What you are talking about is a GUI. The simplest example uses the matplotlib inbuilt widgets:

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.mlab import bivariate_normal
from matplotlib.widgets import Slider, Button

#Setup figure and data
fig, ax = plt.subplots()
plt.subplots_adjust(bottom=0.25)
delta = 0.5
t = np.arange(0.0, 100.0, 0.1)
x = np.arange(-3.0, 4.001, delta)
y = np.arange(-4.0, 3.001, delta)
X, Y = np.meshgrid(x, y)
Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
Z = (Z1 - Z2) * 5.
cmap = plt.cm.rainbow
im = ax.pcolormesh(X, Y, Z, cmap=cmap)
fig.colorbar(im)
axcolor = 'lightgoldenrodyellow'
axtime = plt.axes([0.25, 0.1, 0.65, 0.03], axisbg=axcolor)
stime = Slider(axtime, 'Time', 0.0, 100.0, valinit=50.0)

#Routines to reset and update sliding bar
def reset(event):
    stime.reset()

def update(val):
    time = stime.val/10.
    Z = (Z1 - Z2) * time
    im.set_array(Z.ravel())
    fig.canvas.draw()

#Bind sliding bar and reset button  
stime.on_changed(update)
resetax = plt.axes([0.8, 0.025, 0.1, 0.04])
button = Button(resetax, 'Reset', color=axcolor, hovercolor='0.975')
button.on_clicked(reset)

plt.show()

This should be a start. If you want it to look better (and add more functionality) then you need to go to a GUI framework like wxpython, check out this example.

An example which is more inline with your data-structure would go as follows:

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.mlab import bivariate_normal
from matplotlib.widgets import Slider, Button

#Setup figure and data
fig, ax = plt.subplots()
plt.subplots_adjust(bottom=0.25)
delta = 0.5
t = np.linspace(0.0, 100.0, 256)
x = np.linspace(-4.0, 4.001, 512)
y = np.linspace(-4.0, 4.001, 512)
X, Y = np.meshgrid(x, y)
Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
XZslice = np.zeros((256,512,512))
for i in range(t.shape[0]):
    XZslice[i,:,:] = (Z1 - Z2) * t[i]/10.
cmap = plt.cm.rainbow
im = ax.pcolormesh(XZslice[128,:,:], cmap=cmap)
fig.colorbar(im)
axcolor = 'lightgoldenrodyellow'
axtime = plt.axes([0.25, 0.1, 0.65, 0.03], axisbg=axcolor)
stime = Slider(axtime, 'Time', 0.0, 100.0, valinit=50.0)

#Routines to reset and update sliding bar
def reset(event):
    stime.reset()

def update(val):
    time = int(stime.val/100.* 256)
    im.set_array(XZslice[time,:,:].ravel())
    fig.canvas.draw()

#Bind sliding bar and reset button  
stime.on_changed(update)
resetax = plt.axes([0.8, 0.025, 0.1, 0.04])
button = Button(resetax, 'Reset', color=axcolor, hovercolor='0.975')
button.on_clicked(reset)

plt.show()

相关问答

更多

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。