2018年12月4日 下午3:54
注:安装环境为mac
参考文章:
『 Hadoop 』Mac下Hadoop的安装与使用 | codingXiaxw’s blog
注:在~/.bash_profile中添加了hadoop环境变量之后,会报错,不知道为啥
WARNING: log4j.properties is not found. HADOOP_CONF_DIR may be incomplete. ERROR: Invalid HADOOP_COM
安装过程:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| #检查ssh localhost:.ssh czh$ ssh localhost ssh: connect to host localhost port 22: Connection refused #解决ssh报错 localhost:.ssh czh$ sudo systemsetup -f -setremotelogin on Password: localhost:.ssh czh$ ssh localhost The authenticity of host 'localhost (::1)' can't be established. ECDSA key fingerprint is SHA256:aMXtT+wLOOzuTURVzgY2xkHFEsOeFke0gz8i1spYTNM. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts. Password: Last login: Mon Dec 3 18:45:03 2018 #免密码 localhost:~ czh$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys localhost:~ czh$ cd .ssh localhost:.ssh czh$ ls authorized_keys id_rsa id_rsa.pub known_hosts #查找hadoop localhost:.ssh czh$ brew search hadoop ==> Formulae hadoop #安装hadoop localhost:.ssh czh$ brew install hadoop Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> Updated Formulae composer ✔ flume libgphoto2 shellcheck apache-arrow-glib fx libswiften tomcat@7 circleci gphoto2 nng tomcat@8 embulk haskell-stack phpunit
==> Downloading https://www.apache.org/dyn/closer.cgi?path=hadoop/common/hadoop- ==> Downloading from http://mirrors.hust.edu.cn/apache/hadoop/common/hadoop-3.1. ######################################################################## 100.0% 🍺 /usr/local/Cellar/hadoop/3.1.1: 21,637 files, 770.8MB, built in 9 minutes 57 seconds #此处省略对hadoop的配置,去按照网上的要求去配置就可以了 #格式化hdfs localhost:hadoop czh$ hdfs namenode -format 2018-12-03 19:41:31,993 INFO namenode.NameNode: STARTUP_MSG: /************************************************************ SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1 ************************************************************/ localhost:hadoop czh$
|
启动命令
1 2 3
| cd /usr/local/Cellar/hadoop/3.1.1/sbin ./start-all.sh ./stop-all.sh
|


