拷贝hadoop1.2.1.tar.gz安装包到其他的节点上
scp -r ~/hadoop-1.2.1.tar.gz [email protected]:~/
tar -zxvf hadoop-1.2.1.tar.gz 解压tar包
ln -sf /root/hadoop-1.2.1 /home/hadoop-1.2 创建快捷方式
scp ./* [email protected]:/home/hadoop-1.2/conf/ 拷贝当前目录下的所有文件到指定的主机的指定目录下
[[email protected] hadoop-1.2]# cd /home/hadoop-1.2/conf/
>>>>>>>>>>>>>>>>>>>[[email protected] conf]# vi core-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://node1:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/opt/hadoop-1.2</value> //自己在root根目录下的opt目录下简历/hadoop1.2目录
</property>
</configuration>
~
>>>>>>>>>>>>>>>>>>>>>>[[email protected] conf]# vi hdfs-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.replication</name>
<value>2</value>
</property>
</configuration>
cd /home/hadoop-1.2/bin/
>>>>>>>>>>>>>>>>>>>>>[email protected] bin]# ./hadoop namenode -format
>>>>>>>>>>>>>>>>>>> ./start-dfs.sh
>>>>>>>>>>>>>>>>>>>>>>j
在CentOS-6.3中安装与配置JDK-7,有需要的朋友可以参考下
安装说明
系统环境:centos-6.3
安装方式:rpm安装
软件:jdk-7-linux-x64.rpm
下载地址:http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html
检验系统原版本
[[email protected] ~]# java -version
java version
"1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1)
(rhel-1.45.1.11.1.el6-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed
mode)
进一步查看JDK信息:
[[email protected] ~]# rpm -qa | grep
java
tzdata-java-2012c-1.el6.noarch
java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64
卸载OpenJDK,执行以下操作:
[[email protected] ~]# rpm -e --nodeps
tzdata-java-2012c-1.el6.noarch
[[email protected] ~]# rpm -e --nodeps
java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64
安装JDK
上传新的jdk-7-linux-x64.rpm软件到/usr/local/执行以下操作:
[[email protected] local]# rpm -ivh
jdk-7-linux-x64.rpm
JDK默认安装在/usr/java中。
验证安装
执行以下操作,查看信息是否正常:
[[email protected] bin]# java
[[email protected] bin]#
javac
[[email protected] bin]# java -version
java version "1.7.0"
Java(TM) SE
Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM
(build 21.0-b17, mixed mode)
配置环境变量
我的机器安装完jdk-7-linux-x64.rpm后不用配置环境变量也可以正常执行javac、java
–version操作,因此我没有进行JDK环境变量的配置。但是为了以后的不适之需,这里还是记录一下怎么进行配置,操作如下:
修改系统环境变量文件
vi
+ /etc/profile
向文件里面追加以下内容:
JAVA_HOME=/usr/java/jdk1.7.0
JRE_HOME=/usr/java/jdk1.7.0/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export
JAVA_HOME JRE_HOME PATH CLASSPATH
使修改生效
[[email protected] local]# source /etc/profile
//使修改立即生效
[[email protected] local]# echo $PATH //查看PATH值
查看系统环境状态
[[email protected] ~]# echo
$PATH
/usr/local/cmake/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.7.0/bin:/usr/java/jdk1.7.0/jre/bin:/root/bin
来源: <在CentOS 6.3中安装与配置JDK-7_RedHat/Centos_操作系统_脚本之家>
免秘钥登陆:
CentOS配置SSH无密码登录需要3步:
- 生成公钥和私钥
- 导入公钥到认证文件,更改权限
- 测试
1.生成公钥和私钥
ssh-keygen -t dsa -P ‘‘ -f ~/.ssh/id_dsa
默认在 ~/.ssh目录生成两个文件:
id_rsa :私钥
id_rsa.pub :公钥
2.导入公钥到认证文件
2.1 导入本机
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
2.2 导入要免密码登录的服务器
首先将认证文件复制到服务器
scp ~/.ssh/authorized_keys [email protected]主机名:/home/xxx/.ssh/
一般以上几步就ok了,但我的仍要输入密码,
用root用户登陆查看系统的日志文件:$tail /var/log/secure -n 20
…………
Oct 7 10:26:43 MasterServer sshd[2734]: Authentication refused: bad ownership or modes for file /home/Hadooper/.ssh/authorized_keys
Oct 7 10:26:48 MasterServer sshd[2734]: Accepted password for hadooper from ::1 port 37456 ssh2
Oct 7 10:26:48 MasterServer sshd[2734]: pam_unix(sshd:session): session opened for user hadooper by (uid=0)
Oct 7 10:36:30 MasterServer sshd[2809]: Accepted password for hadooper from 192.168.1.241 port 36257 ssh2
Oct 7 10:36:30 MasterServer sshd[2809]: pam_unix(sshd:session): session opened for user hadooper by (uid=0)
Oct 7 10:38:28 MasterServer sshd[2857]: Authentication refused: bad ownership or modes for directory /home/hadooper/.ssh
…………
提示/home/hadooper/.ssh和 /home/hadooper/.ssh/authorized_keys权限不对,修改如下:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
3.测试
ssh host,第一次登录可能需要yes确认,之后就可以直接登录了。
来源: <http://www.linuxidc.com/Linux/2014-10/107762.htm>
rpm -ivh jdk-7u60-linux-x64.rpm
JAVA_HOME=/usr/java/jdk1.7.0_60
JRE_HOME=/usr/java/jdk1.7.0_60/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH