”温故知新” なことなど

コメントは、タイトル下の"without comments"を押下して記入ください

Archive for the ‘ゼミ’ Category

sshにパスワードなしでログインする方法

without comments

sshにパスワードなしでログインする設定をこちらを参考にして作成してみたが、環境のせいか、
いろいろつまずいたところを振り返る。

環境:CentOS5.4

[root@hdp_master ~]# ssh-keygen -t rsa -P ""
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
74:80:71:18:90:0d:20:c8:e7:72:6d:c6:f2:9d:30:e4 root@hdp_master
[root@hdp_master ~]# cat id_rsa.pub >> $HOME/.ssh/authorized_keys
cat: id_rsa.pub: そのようなファイルやディレクトリはありません

ここでrootユーザーで作業をしていたことが原因では回帰したのでuser権限で作業することに。

$HOME/.sshの$HOMEもsshでログインしたときのディレクトリをさしているので、
デフォルトで、/home/adminが$HOMEとなる。したがって.sshへのパスは/home/admin/.sshとなる。

でもここまで何回も同じ事をやっていて、他になにか簡易的な方法がないか検索、
すると下記のコマンドで自動で作ってくれそうなのでこちらを試すことにした。
こちらのサイトを参考にさせて頂いた。

名前を、no-ssh-password.sh にして/home/adminディレクトリに作成。

[admin@hdp_master ~]$ touch no-ssh-password.sh
[admin@hdp_master ~]$ vi no-ssh-password.sh
#!/bin/sh

#------------------
# set param
hosts="hdp_master hdp_sub1"
user=admin
 #user=`who -m |awk {'print $1'}`
#------------------

ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*

for host in ${hosts}
do
  ssh ${user}@${host} 'ssh-keygen -t rsa'
  ssh ${user}@${host} 'cat ~/.ssh/id_rsa.pub' | cat ->> ~/.ssh/authorized_keys
done

for host in ${hosts}
do
  scp ~/.ssh/authorized_keys ${host}:~/.ssh
  ssh ${user}@${host} 'chmod 700 ~/.ssh ; chmod 600 ~/.ssh/*'
done

exit

中略

パラメータ設定のhosts=”hdp_master hdp_sub1″ のホストネーム hdp_sub1で設定できず、
hdp_sub1側のネットワーク設定のホスト名はこのようにしておいたがエラーでダメだったので、
IPアドレス(192.168.3.6)にして再実行したらなんとか設定ができた。

めでたしめでたし

Written by nextschool

4月 18th, 2010 at 1:55 pm

Posted in Hacks,ゼミ,設定

Tagged with ,

Hadoop機の作業記録

without comments

[Atom箱の作成]から、ネットに接続されているか確認したところ、デフォルトではNIC(eth0)が認識されていなかった。
そこで[参考]を元に設定したらNIC(eth0)が認識されました。
クライアントPCからsshでログインできたのを確認後、モニターとキーボード、マウスを外します。
その後、localhostとデフォルトの名前をhdp_masterと変更しました。

[root@localhost admin]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
192.168.3.8 hdp_master //←ここを追加
[root@localhost admin]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=hdp_master //←ここを追加
GATEWAY=192.168.3.8  //←ここを追加

その後、[javaのアップデート]を行うため、USBでmountコマンドを使用して、usbの中身にインストールしてあった最新のJava SDKを/usr/local上で解凍、展開を行います。[USBフラッシュメモリを使うには]

しかしmountしても、/mnt/usbfmには空っぽだったので、
# dmesg
をみると
SCSI device sdb: 512000 512-byte hdwr sectors (262 MB)
とか書いてあったのでsdaではなくsdbに変えたところ、
# mount -t vfat /dev/sdb1 /mnt/usbfm/ でなんなく認識されました。

[root@hdp_master home]# ls /mnt/usbfm
hadoop-0.20.1.tar.gz  jdk-6u17-linux-i586-rpm.bin  r8168-8.015.00.tar.bz2

中身のなかのこれを先に解凍
[root@hdp_master usbfm]# tar zxf hadoop-0.20.1.tar.gz
[root@hdp_master usbfm]# mv hadoop-0.20.1 /home/hadoop

Javaをアップデートしたかったけど、hadoopの解凍を先に行いました。(/home直下へ)

[root@hdp_master usbfm]# ./jdk-6u17-linux-i586-rpm.bin
次にJavaの最新Verをusbfm上で、解凍展開を行おうとしたら、
Please free up the required Disk Space and try again とメモリ領域が足りないということで、ディレクトリをlocalへ移動して

[root@hdp_master usbfm]# cd /usr/local
[root@hdp_master local]# ./jdk-6u17-linux-i586-rpm.bin
Do you agree to the above license terms? [yes or no]
yes
Unpacking…
Checksumming…
Extracting…

中略

For more information on what data Registration collects and
how it is managed and used, see:

http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html

Press Enter to continue…..

Done. →解凍完了!

次に環境設定を行う。

参考 http://d.hatena.ne.jp/hkano/20081014

Written by nextschool

1月 15th, 2010 at 2:39 am

Posted in ゼミ,設定

Tagged with ,

Hadoop Based Data Mining

without comments

Hw09 Hadoop Based Data Mining Platform For The Telecom Industry
感嘆のため息が漏れました・・・
中国語で読めないところがあったので院生に聞いてみたい。

Written by nextschool

1月 2nd, 2010 at 5:30 am

Posted in eスクール,ゼミ,情報系

Tagged with ,

日本ソフトウェア学会講座一日目

without comments

2009 年 9 月 4 日 10:30 AMto2009 年 9 月 5 日 5:00 PM

慶應大学日吉キャンパスにて、日本ソフトウェア学会主催の大学基調講座が開催された。
8月に募集がかけられた時に速効で申し込みをした。この講座はゼミに入ってから半期間学習していた内容だったため、春学期のまとめという意味で参加したかったのだ。今日はセッション3本と明日1本と実習1本で内容盛りだくさんだった。と全て過去形で記載しました、

Written by nextschool

9月 4th, 2009 at 6:42 pm

The AWS Toolkit for Eclipse

without comments

Amazonのクラウドを利用する際のツールの紹介ページ

http://aws.amazon.com/eclipse/

eclipse_ec2_management

http://qurl.com/vmwmd

eclipse_simpleDB

http://qurl.com/yvz51

まず自宅環境で大きなデータを操作できるようになったら、
クラウド上にて実験してみたいと思う。それまで自宅環境でスイスイ操作できるよう繰り返し練習すべきである。

Written by nextschool

7月 31st, 2009 at 2:21 am

Posted in ゼミ,情報

Tagged with , ,