分享

Ubuntu Server 14安装jdk1.8,scala2.10.4,ssh【原创】

本帖最后由 breaking 于 2016-3-3 22:29 编辑
问题导读:
1.Java和scala怎么安装?
2.ssh怎么配置?




第一部分:java和scala安装

查看本机上是否还有java可选。这里用到以下命令
$ sudo update-alternatives --list java
如果出现显示图中错误,系统中没有java可选,我们可以进行以下步骤

1.png

2.png
3.png

root@master:/tools#mkdir-p  /usr/local/jdk
root@master:/tools# tar -zxf jdk-8u60-linux-x64.tar.gz -C /usr/local/jdk
root@master:/tools# tar -zxf scala-2.10.4.tgz -C /usr/local/

update-alternatives--list java

export JAVA_HOME= /usr/local/jdk/jdk1.8.0_60/
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export SCALA_HOME=/usr/local/scala-2.10.4

export  PATH=${JAVA_HOME}/bin:$PATH
export PATH=$PATH:$SCALA_HOME/bin

root@master:/tools# source ~/.bashrc
root@master:/tools# java -version
root@master:/tools# scala -version
file:///C:/Users/hadoop/AppData/Local/Temp/msohtmlclip1/01/clip_image004.png
4.png

部署好一台  我们把 /usr/local/jdk/jdk1.8.0_60/和/usr/local/scala-2.10.4 /root/.bashrcscp到Worker1 -4

写个小脚本
root@master:~# vim fenfa.sh
#!/bin/sh
for i in 1 2 3 4
do
scp -rq /usr/local/jdk1.8.0_60/ root@Worker$i:/usr/local/
scp -rq /usr/local/scala-2.10.4/ root@Worker$i:/usr/local/
scp -rq /root/.bashrc root@Worker$i:~
done

5.png
file:///C:/Users/hadoop/AppData/Local/Temp/msohtmlclip1/01/clip_image005.png
在台机子上执行
source ~/.bashrc

6.png

第二部分:ssh安装
file:///C:/Users/hadoop/AppData/Local/Temp/msohtmlclip1/01/clip_image006.png
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
78:67:46:83:82:4d:6d:1a:0c:47:46:d4:6a:bd:0e:22 root@master
The key's randomart image is:
+--[ DSA 1024]----+
|    .*Bo         |
|     *o +.       |
|    . o*. o      |
|      +o.. .     |
|     .. S.+      |
|  E . ...+       |
|   . . o         |
|        .        |
|                 |
+-----------------+

root@master:~# ssh-copy-id -i .ssh/id_dsa.pub root@Master//分发秘钥给本机
The authenticity of host 'master (10.0.0.170)' can't be established.
ECDSA key fingerprint is d0:63:09:8e:7c:32:2e:b5:68:26:b4:7e:11:11:b0:f0.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@master's password:   //root 密码

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'root@master'"
and check to make sure that only the key(s) you wanted were added.

同理

root@Master:~# ssh-copy-id -i .ssh/id_dsa.pub root@Worker1
root@Master:~# ssh-copy-id -i .ssh/id_dsa.pub root@Worker2
root@Master:~# ssh-copy-id -i .ssh/id_dsa.pub root@Worker3
root@Master:~# ssh-copy-id -i .ssh/id_dsa.pub root@Worker4

验证ssh免秘钥登陆
root@Master:~# ssh Worker1
7.png
root@Master:~# ssh Worker2
8.png

以上部分为介绍Ubuntu Server 14的一些基础配置,为大数据平台搭建做一些前期准备,今天就写到这里,下次将介绍有关大数据 hadoop2.6.0+spark1.6.0 HA 分布式集群搭建。

已有(2)人评论

跳转到指定楼层
pig 发表于 2016-3-4 08:49:59
应该有什么可以学的
回复

使用道具 举报

瓦力 发表于 2016-3-4 10:15:56
imf  加油。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条