A virtual machine was started on Shanda cloud. The default user is root. An error occurred while running hadoop:
[Error description]
Root @ snda:/data/soft/hadoop-0.20.203.0 # bin/hadoop FS-put conf Input
11/08/03 09:58:33 warn HDFS. dfsclient: datastreamer exception: Org. apache. hadoop. IPC. remoteException: Java. io. ioexception: File/user/root/input/slaves cocould only be replicated to 0 nodes, instead of 1
[Cause]
This error occurs when hadoop datanode is started.
Root @ snda:/data/soft/hadoop-0.20.203.0 #./bin/hadoop-daemon.sh start datanode
Starting datanode, logging to/data/soft/hadoop-0.20.203.0/bin/../logs/hadoop-root-datanode-snda.out
Unrecognized option:-JVM
Cocould not create the Java Virtual Machine.
[Solution]
Take a closer look.-The JVM parameter is displayed in Bin/hadoop.
Class = 'org. Apache. hadoop. HDFS. server. datanode. datanode'
If [[$ EUID-EQ 0]; then
Hadoop_opts = "$ hadoop_opts-JVM server $ hadoop_datanode_opts"
Else
Hadoop_opts = "$ hadoop_opts-server $ hadoop_datanode_opts"
Fi
In the script, if it is EUID
= 0, that is to say, run the statement with-JVM as the root user; otherwise, the statement with-server is executed.
As to why-the JVM will say it is not recognized, it is not clear, but it can solve the problem:
1) modify the script and change the-JVM parameter to-server.
2) run it with a non-root account.
It's okay to use a non-root account for confirmation. The method for modifying the script is not sure if it will cause other problems.