Hadoopは「名前ノードはセーフモードです」を削除します



Hadoop Removesname Node Is Safe Mode



2019 Unicorn Enterprise Heavy Gold Recruitment Python Engineer Standard >>> hot3.png

hadoopプログラムを実行すると、次のエラーが報告されることがあります。



org.apache.hadoop.dfs.SafeModeException:/ user / hadoop / inputを削除できません。名前ノードはセーフモードです
このエラーは一般的なものでいっぱいになるはずです(少なくとも私が実行していたとき)

次に、このエラーを分析して、文字通り理解しましょう。
名前ノードはセーフモードです

HadoopのNameNodeがセーフモードであることを説明します。
では、Hadoopのセキュリティモデルは何ですか?
分散ファイルシステムを起動すると、最初はセキュリティモードになります。分散ファイルシステムがセキュアモードの場合、セキュリティモードが終了するまで、ファイルシステムの内容を変更または削除することはできません。セキュリティモードは、主に、システムの起動時に各DataNodeのデータブロックの有効性を確認し、ポリシーに従って一部のデータブロックをコピーまたは削除することです。セキュリティモードは、実行時にコマンドを使用して開始することもできます。練習プロセスでは、システムがファイルの変更と削除を開始すると、セキュリティモードで変更が許可されていないというエラープロンプトが表示されます。しばらく待つだけです。

この問題を解決する必要があることは明らかです。Hadoopをセーフモードにしないでください。待たずに直接解決できますか?
答えは「はい」です。Hadoopディレクトリに入力するだけです。
bin / hadoop dfsadmin -safemode Leave

つまり、Hadoopのセキュリティモードをオフにすることで、問題は解決します。

以前にhadoopの実行中に使用された「ctrl + c」操作
Hadoopを再度使用すると表示されます「名前ノードはセーフモードです」促す:
root @ xxxxx:〜/ hadoop / hadoop-0.20.2#bin / hadoop fs -put conf input
put:org.apache.hadoop.hdfs.server.namenode.SafeModeException:ディレクトリ/ user / root / input / confを作成できません。名前ノードはセーフモードです。



-----------------------------

最近hadoopをテストしていますが、reduceをクリックするとは思っていませんでした。
Ctrl + cを押す方法はありませんが、問題の後にXDが続きます。
Hadoopを開始した後、Hadoopを再度開始します。
次に、DFSのデータを削除する場合は、
ネームノードがセーフモードの場合、データを削除する方法はありません。
答えを見つけるのに長い時間がかかりました。

bin/hadoop dfsadmin -safemode leave You can lift the safemode and worry about this problem for a long time. Orz -----------------------------safemode mode NameNode first enters safe mode when starting, if the datanode lost block reaches a certain proportion (1-dfs.safemode.threshold.pct), the system will remain in the safe mode state, that is, read-only. Dfs.safemode.threshold.pct (default value 0.999f) indicates that when HDFS is started, if the number of blocks reported by the DataNode reaches 0.999 times the number of blocks of the metadata record, the security mode can be left. Otherwise, this is always the case. Read-only mode. If set to 1, HDFS is always in SafeMode. The following line is excerpted from the log when the NameNode starts (block reporting ratio 1 reached the threshold of 0.9990) The ratio of reported blocks 1.0000 has reached the threshold 0.9990. Safe mode will be turned off automatically in 18 seconds.hadoop dfsadmin -safemode leave has two ways to leave this safe mode 1. Modify dfs.safemode.threshold.pct to a small value. The default is 0.999. 2. hadoop dfsadmin -safemode leave command to force to leave http://bbs.hadoopor.com/viewthread.php?tid=61&extra=page%3D1 ----------------------------- Safe mode is exited when the minimal replication condition is reached, plus an extension time of 30 seconds. The minimal replication condition is when 99.9% of the blocks in the whole filesystem meet their minimum replication level (which defaults to one, and is set by dfs.replication.min). Safe mode exit prerequisite - Blocks of 99.9% (default 99.9%, can be set by dfs.safemode.threshold.pct) in the entire file system reach the minimum backup level (default is 1, can be set by dfs.replication.min) . dfs.safemode.threshold.pct float 0.999 The proportion of blocks in the system that must meet the minimum replication level defined by dfs.rep lication.min before the namenode will exit safe mode. Setting this value to 0 or less forces the name-node not to start in safe mode. Setting this value to more than 1 means the namenode never exits safe mode.----------------------------- The user can operate the safe mode with dfsadmin -safemode value. The parameter value is described as follows: Enter - enter safe mode Leave - forces the NameNode to leave safe mode Get - Returns information about whether security mode is enabled Wait - wait until the end of safe mode.

転載:https://my.oschina.net/sniperLi/blog/348397