{"id":1900,"date":"2018-03-25T15:28:54","date_gmt":"2018-03-25T18:28:54","guid":{"rendered":"https:\/\/zmsolution.laraclaud.com.br\/?p=1900"},"modified":"2018-03-25T15:28:54","modified_gmt":"2018-03-25T18:28:54","slug":"erro-ao-criar-um-dir-hadoop-hdfs-dfs","status":"publish","type":"post","link":"http:\/\/zmsolution.com\/erro-ao-criar-um-dir-hadoop-hdfs-dfs\/","title":{"rendered":"Erro ao criar um diretorio no hadoop"},"content":{"rendered":"

Umas das primeiras a\u00e7\u00f5es apos instalar o hadoop e verificar se todas as configura\u00e7\u00f5es\u00a0 foram feitas corretamente, umas das formas mais f\u00e1ceis e iniciar o haddop e apos criar um diret\u00f3rio com\u00a0hdfs dfs<\/strong>.<\/p>\n

Se a configura\u00e7\u00e3o do usu\u00e1rio n\u00e3o estiver ok , na hora de criar o diretorio ocorrerar o seguinte erro:<\/p>\n

.\/hdfs dfs -mkdir \/bigdata<\/strong><\/p>\n

mkdir: Call From hadoop.localdomain\/192.168.56.45 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http:\/\/wiki.apache.org\/hadoop\/ConnectionRefused<\/span><\/em><\/p>\n

para evitarmos esse erro, precisamos deixar o arquivo hosts\u00a0<\/strong>configurado corretamente e ap\u00f3s configurar a chave ssh<\/strong>.<\/p>\n

Configurando o hosts<\/strong><\/p>\n

vi \/etc\/hosts\r\n\r\n127.0.0.1 localhost\r\n192.168.56.45 hadoop.localdomain hadoop<\/pre>\n

Criando a chave ssh<\/strong><\/p>\n

No usu\u00e1rio onde ser\u00e1 instalado o hadoop<\/strong>, execute\u00a0os comandos abaixo:<\/p>\n

ssh-keygen -t rsa -P '' -f ~\/.ssh\/id_rsa\r\ncat ~\/.ssh\/id_rsa.pub >> ~\/.ssh\/authorized_keys\r\nchmod 0600 ~\/.ssh\/authorized_keys\r\n\r\n<\/pre>\n

Segue o exemplo abaixo:<\/strong><\/p>\n

[hadoop@hadoop ~]$ ssh-keygen -t rsa -P '' -f ~\/.ssh\/id_rsa\r\nGenerating public\/private rsa key pair.\r\n\/home\/hadoop\/.ssh\/id_rsa already exists.\r\nOverwrite (y\/n)? y\r\nYour identification has been saved in \/home\/hadoop\/.ssh\/id_rsa.\r\nYour public key has been saved in \/home\/hadoop\/.ssh\/id_rsa.pub.\r\nThe key fingerprint is:\r\nSHA256:FhDb08SzPktRSIZlFX65GNLtao4xPQ4TCbM4mNG1CzE hadoop@hadoop.localdomain\r\nThe key's randomart image is:\r\n+---[RSA 2048]----+\r\n| E..=*oo. |\r\n| . B.*+o.. . |\r\n| . + B o++ + |\r\n| + o Boo = . |\r\n| o o S.o.. o |\r\n| o +o . |\r\n| .=o= |\r\n| .X . |\r\n| . o |\r\n+----[SHA256]-----+\r\n[hadoop@hadoop ~]$ cat ~\/.ssh\/id_rsa.pub >> ~\/.ssh\/authorized_keys\r\n[hadoop@hadoop ~]$ chmod 0600 ~\/.ssh\/authorized_keys<\/pre>\n

Vamos executar o comando novamente<\/strong><\/p>\n

.\/hdfs dfs -mkdir \/bigdata<\/pre>\n

Agora verificar se o diretorio foi criado corretamente:<\/strong><\/p>\n

.\/hadoop fs -ls \/<\/pre>\n
[hadoop@hadoop bin]$ .\/hadoop fs -ls \/\r\nFound 1 items\r\ndrwxr-xr-x - hadoop supergroup 0 2018-03-23 15:58 \/bigdata\r\n\r\n<\/pre>\n

Espero ter ajudado . At\u00e9 logo!<\/strong><\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

Umas das primeiras a\u00e7\u00f5es apos instalar o hadoop e verificar se todas as configura\u00e7\u00f5es\u00a0 foram feitas corretamente, umas das formas mais f\u00e1ceis e iniciar o haddop e apos criar um diret\u00f3rio com\u00a0hdfs dfs. Se a configura\u00e7\u00e3o do usu\u00e1rio n\u00e3o estiver ok , na hora de criar o diretorio ocorrerar o seguinte erro: .\/hdfs dfs -mkdir \/bigdata mkdir: Call From hadoop.localdomain\/192.168.56.45 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http:\/\/wiki.apache.org\/hadoop\/ConnectionRefused para[…]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[41],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/zmsolution.com\/wp-json\/wp\/v2\/posts\/1900"}],"collection":[{"href":"http:\/\/zmsolution.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zmsolution.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zmsolution.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/zmsolution.com\/wp-json\/wp\/v2\/comments?post=1900"}],"version-history":[{"count":0,"href":"http:\/\/zmsolution.com\/wp-json\/wp\/v2\/posts\/1900\/revisions"}],"wp:attachment":[{"href":"http:\/\/zmsolution.com\/wp-json\/wp\/v2\/media?parent=1900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zmsolution.com\/wp-json\/wp\/v2\/categories?post=1900"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zmsolution.com\/wp-json\/wp\/v2\/tags?post=1900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}