标签:native 保存 where 修改 code rar zed shu bsp
3)验证是否启动成功,两种方式:--jps方式验证 --浏览器访问验证
#查询版本 [hadoop@sf package]$ java -version java version "1.7.0_99" OpenJDK Runtime Environment (rhel-2.6.5.1.el6-x86_64 u99-b00) OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode) #查询文件全名 [hadoop@sf package]$ rpm -qa | grep java tzdata-java-2016c-1.el6.noarch java-1.7.0-openjdk-1.7.0.99-2.6.5.1.el6.x86_64 java-1.6.0-openjdk-1.6.0.38-1.13.10.4.el6.x86_64
1-2 卸载自带的jdk(使用root帐号)
[root@sf package]# rpm -e --nodeps tzdata-java-2016c-1.el6.noarch [root@sf package]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.99-2.6.5.1.el6.x86_64 [root@sf package]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.38-1.13.10.4.el6.x86_64 [root@sf package]# rpm -qa | grep java [root@sf package]#
1-3 解压缩jdk(root帐号)
##解压缩 [root@sf app]# tar -zxvf jdk-8u131-linux-x64.tar.gz ##移动到自己的应用路径下 [root@sf package]# mv jdk1.8.0_131 /home/hadoop/app/
1-4 配置环境变量
[root@sf jdk1.8.0_131]# pwd /home/hadoop/app/jdk1.8.0_131 [root@sf jdk1.8.0_131]# vim /etc/profile ## /etc/profile里面添加的内容 export JAVA_HOME=/home/hadoop/app/jdk1.8.0_131 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=$JAVA_HOME/lib/:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH #操作提示:光标处插入 i,保存退出 ctrl+c,:wq,退出 :q ,强制退出 !q #执行配置文件使生效 [root@sf jdk1.8.0_131]# source /etc/profile
1-5 检查jdk是否生效
[root@sf jdk1.8.0_131]# java -version java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) [root@sf jdk1.8.0_131]#
liunx中jdk安装结束。
#yum在线安装ssh [hadoop@sf app]$ sudo yum install ssh
2-3 验证ssh是否安装成功
[hadoop@sf app]$ ssh -version OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013 Bad escape character ‘rsion‘. [hadoop@sf app]$
2-4 生成公钥和私钥
[hadoop@sf app]$ ssh-keygen -t rsa
注意:1、ssh和-keygen之间不能有空格 2、使用的不是root帐号
[hadoop@sf ~]$ cd .ssh [hadoop@sf .ssh]$ ll 总用量 8 -rw-------. 1 hadoop hadoop 1675 5月 31 22:38 id_rsa -rw-r--r--. 1 hadoop hadoop 391 5月 31 22:38 id_rsa.pub [hadoop@sf .ssh]$ pwd /home/hadoop/.ssh [hadoop@sf .ssh]$ cp id_rsa.pub authorized_keys [hadoop@sf .ssh]$
[root@sf hadoop]# visudo
[hadoop@sf package]$ ll 总用量 507672 drwxr-xr-x. 14 1106 4001 4096 3月 24 2016 hadoop-2.6.0-cdh5.7.0 -rw-r--r--. 1 root root 311585484 5月 31 20:32 hadoop-2.6.0-cdh5.7.0.tar.gz -rw-r--r--. 1 root root 185540433 5月 31 20:34 jdk-8u131-linux-x64.tar.gz -rw-r--r--. 1 root root 22724574 5月 31 20:31 zookeeper-3.4.9.tar.gz [hadoop@sf package]$ pwd /home/hadoop/package [hadoop@sf package]$ [hadoop@sf package]$ sudo tar -zxvf hadoop-2.6.0-cdh5.7.0.tar.gz [hadoop@sf package]$ sudo mv hadoop-2.6.0-cdh5.7.0 /home/hadoop/app
[hadoop@sf hadoop]$ pwd /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/etc/hadoop [hadoop@sf hadoop]$ echo $JAVA_HOME /home/hadoop/app/jdk1.8.0_131 [hadoop@sf hadoop]$ sudo vim hadoop-env.sh
修改后:
#查看 [hadoop@sf ~]$ hostname sf [hadoop@sf ~]$ cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 [hadoop@sf ~]$
#vim /etc/hosts 127.0.0.1 sf localhost localhost.localdomain localhost4 localhost4.localdomain4 192.168.244.130 sf localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 sf
修改文件core-site.xml
[hadoop@sf hadoop]$ sudo vim core-site.xml #重启网络服务 [root@sf hadoop]# /etc/rc.d/init.d/network restart
目的:配置映射和临时存储文件目录
<configuration> <property> <name>fs.defaultFS</name> <value>hdfs://192.168.244.130:8020</value> </property> <property> <name>hadoop.tmp.dir</name> <value>/home/hadoop/app/tmp</value> </property> </configuration>
注意 /home/hadoop/app/tmp 这里tmp目录自己新建
[hadoop@sf hadoop]$ sudo vim hdfs-site.xml
[hadoop@sf bin]$ pwd /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/bin [hadoop@sf bin]$ sudo ./hdfs namenode -format
2) 启动文件系统
[hadoop@sf sbin]$ pwd /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/sbin [hadoop@sf sbin]$ sudo ./start-dfs.sh #停止 /home/hadoop/app/hadoop-2.6.0-cdh5.7.0/sbin sudo ./stop-dfs.sh
--jps验证 [root@sf sbin]# jps 33911 Jps 32856 SecondaryNameNode 32589 NameNode 32703 DataNode [root@sf sbin]#
[hadoop@sf ~]$ sudo vim /etc/selinux/config #SELINUX=enforcing 改成 SELINUX=disabled #权限问题? drwx------. 2 hadoop hadoop 4096 5月 31 22:44 .ssh -rw-r--r--. 1 hadoop hadoop 391 5月 31 22:43 authorized_keys /home/hadoop/.ssh [root@sf .ssh]# chmod 600 authorized_keys -rw-------. 1 hadoop hadoop 391 5月 31 22:43 authorized_keys
[root@sf test]# service iptables stop
标签:native 保存 where 修改 code rar zed shu bsp
原文地址:https://www.cnblogs.com/david227/p/10666216.html