我正在学习hadoop并且对默认端口和位置感到困惑.
当我点击URL:localhost:50070给出了hdfs信息的结果.在hadoop文档中,以下是一些提到的端口.
HDFS-default.xml中
dfs.datanode.http.address 0.0.0.0:50075
dfs.datanode.address 0.0.0.0:50010
dfs.namenode.http-address 0.0.0.0:50070
dfs.namenode.backup.http-address 0.0.0.0:50105
Run Code Online (Sandbox Code Playgroud)
mapred-default.xml中
mapreduce.jobtracker.http.address 0.0.0.0:50030
mapreduce.tasktracker.http.address 0.0.0.0:50060
Run Code Online (Sandbox Code Playgroud)
纱default.xml中
yarn.resourcemanager.address ${yarn.resourcemanager.hostname}:8032
yarn.resourcemanager.webapp.address ${yarn.resourcemanager.hostname}:8088
Run Code Online (Sandbox Code Playgroud)
现在,在我的机器中配置Hadoop 2时,我做了:$ cd/usr/local/hadoop/etc/hadoop $ vi core-site.xml
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
Run Code Online (Sandbox Code Playgroud)
问题:默认情况下提到了很多端口,文档中有其他xml ....
1)localhost:50070只返回一些含义完整数据(hdfs health)的其他端口怎么样.其他人只是不回信息?
2)在yarn-default.xml中都是资源管理器端口,区别在于一个是webapp端口.只有当我点击localhost:8088时,它才会给出集群(本例中是单节点)信息.那么端口8083是什么?在示例代码中,我看到8083是RM端口.我不清楚.有人可以解释一下
3)我将hdfs端口更改为9000是那个标准吗?
4)如何查看appmaster,jobtracker,tasktracker端口
5)我认为在纱线hadoop 2中没有jobtracker和tasktracker那么这些端口的目的是什么?
我正在做这些基本问题的噩梦......
谢谢,阿米特
我找不到最新mrunit(1.1.0)的Cloudera存储库.可用的是0.8.0-incubating.以下是我的pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ma.hadoop</groupId>
<artifactId>MapReduce</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<hadoop.version>2.3.0-cdh5.1.2</hadoop.version>
<hive.version>0.12.0-cdh5.1.2</hive.version>
<mrunit.version>0.8.0-incubating</mrunit.version>
</properties>
<dependencies>
<!-- For unit testing -->
<dependency>
<groupId>org.apache.mrunit</groupId>
<artifactId>mrunit</artifactId>
<version>${mrunit.version}</version>
</dependency>
<!-- This is sufficient for all -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>${hadoop.version}</version>
</dependency>
</dependencies>
<build>
<finalName>Mapred</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<outputDirectory>${basedir}</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository> …Run Code Online (Sandbox Code Playgroud) 任何人都可以请我指向Apache Hadoop Yarn示例的源代码.2.2.0发行版附带一个jar名称hadoop-mapreduce-examples-2.2.0.jar.我试图找到示例的源代码.任何指针都会有所帮助......
谢谢,阿米特
我有一个加密的字符串。加密是使用 java 代码完成的。我使用以下java代码解密加密的字符串
InputStream fileInputStream = getClass().getResourceAsStream(
"/private.txt");
byte[] bytes = IOUtils.toByteArray(fileInputStream);
private String decrypt(String inputString, byte[] keyBytes) {
String resultStr = null;
PrivateKey privateKey = null;
try {
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(keyBytes);
privateKey = keyFactory.generatePrivate(privateKeySpec);
} catch (Exception e) {
System.out.println("Exception privateKey::::::::::::::::: "
+ e.getMessage());
e.printStackTrace();
}
byte[] decodedBytes = null;
try {
Cipher c = Cipher.getInstance("RSA/ECB/NoPadding");
c.init(Cipher.DECRYPT_MODE, privateKey);
decodedBytes = c.doFinal(Base64.decodeBase64(inputString));
} catch (Exception e) {
System.out
.println("Exception while using the cypher::::::::::::::::: " …Run Code Online (Sandbox Code Playgroud) 我有一个 csv 文件,4000 条记录中只有 4 条包含一些非 ASCII 字符。例如
['com.manager', '2016012300', '16.1.23', 'en', 'kinzie', '2015-04-11T17:36:23Z', '1428773783781', '2016-03-11T09:53:45Z', 'df', '5', "\xa5\x06`'", '\xc0\x03"', '\xa2{\xac ===]\xa9}\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7>', '', '', '', 'https://play.google.com/apps/publish?account=sd#ReviewDetailsPlace:p=com.manager&reviewid=gp:AOqpTOEcQQGmjFcd-bFfU372DTrxh']
Run Code Online (Sandbox Code Playgroud)
我正在使用以下 python 代码来读取 csv
with open('/Users/duttaam/Downloads/test1.csv', 'rU') as csvfile:
reader_obj = csv.reader(x.replace('\0', '') for x in csvfile)
rownum=0
for row in reader_obj:
rownum += 1
if len(row) != 16:
print rownum
print row
Run Code Online (Sandbox Code Playgroud)
对于四行,阅读器显示不一致的列号。但是当我计算这些行中的分隔符(,)时,它显示得很好。我能看到的唯一问题是非 ascii 字符,如上行所示的示例行。我猜这些是一些表情符号转换成一些字符。
我想出了一个从字符串中删除不可打印字符的函数,如何将其应用于整个 csv?(感谢以下帖子:Stripping non printable characters from a string in python)
def removeSpecialcahr(s):
printable = set(string.printable)
return …Run Code Online (Sandbox Code Playgroud) mapreduce ×3
hadoop ×2
hadoop-yarn ×2
python ×2
cloudera-cdh ×1
cryptography ×1
csv ×1
mrunit ×1
repository ×1