1. 程式人生 > 其它 >hadoop報錯ERROR: Cannot set priority of namenode process

hadoop報錯ERROR: Cannot set priority of namenode process

hadoop在啟動時報錯如下:

Starting namenodes on [733ec62951d5]
733ec62951d5: ERROR: Cannot set priority of namenode process 868
Starting datanodes
localhost: ERROR: Cannot set priority of datanode process 974
2022-01-15 13:56:41,689 ERROR conf.Configuration: error parsing conf core-site.xml

注意到是因為core-site.xml配置檔案錯誤而引起的。經過修改後,正確的core-site.xml配置檔案如下:

?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
--> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://172.17.0.3:9000</value> </property> </configuration>

正確的hdfs-site.xml配置檔案如下:

<?xml version="1.0" encoding="UTF-8"
?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration>