MapRをインストールしようとした
クイックインストーラを使っても全然うまくいかない。
ネットワークが悪いのか、yum installが何度も失敗してinstallだけで1時間以上かかった。
ハマったっぽいところ
http://blog.r-unit.co.jp/archives/1024
クイックインストーラを何度も実行したら、インストーラは成功したが後続のディスク初期化が失敗した。
MapR 5.0 Documentation : Setting Up Disks for MapR
↑これをやるが、ここ↓でエラー。
# /opt/mapr/server/disksetup -F /tmp/disks.txt
このエラーが出た。/opt/mapr/hostnameにホスト名を出力。
MapR Community
# hostname --fqdn > /opt/mapr/hostname
その後にconfigure.shを実行
MapR 5.0 Documentation : Installing MapR Software
ようやくインストールできた模様。ここまで3時間くらい…。
# /opt/mapr/server/configure.sh -C localhost -Z localhost
Configuring Hadoop-2.4.1 at /opt/mapr/hadoop/hadoop-2.4.1
Done configuring Hadoop
Not enough memory. System only has 3959 MB. Required memory is 4096 MB
Do you still wish to continue? [y/n] y
CLDB node list: localhost:7222
Zookeeper node list: localhost:5181
Node setup configuration: cldb fileserver jobtracker nfs webserver zookeeper
Log can be found at: /opt/mapr/logs/configure.log
Zookeeper found on this node, and it is not running. Starting Zookeeper
JMX enabled by default
Using config: /opt/mapr/zookeeper/zookeeper-3.4.5/conf/zoo.cfg
Starting zookeeper ... STARTED
Zookeeper respawn not found in inittab. Adding entry.
Creating zookeeper respawn in inittab with ID of "a1"
Warden is not running. Starting mapr-warden. Warden will then start all other configured services on this node
Starting WARDEN, logging to /opt/mapr/logs/warden.log.
.
For diagnostics look at /opt/mapr/logs/ for createsystemvolumes.log, warden.log and configured services log files
Warden respawn not found in inittab. Adding entry.
Creating warden respawn in inittab with ID of "a2"
... Starting cldb
... Starting fileserver
... Starting jobtracker
... Starting nfs
... Starting webserver
To further manage the system, use "maprcli", or connect browser to https://centos66.localdomain:8443/
To stop and start this node, use "service mapr-warden stop/start"
Hadoop1.2.1のサンプルを実行したらOutOfMemoryになった
Hadoop1.2.1をインストール。
マニュアルにしたがって
$cd
$cp -r /usr/share/hadoop/templates/conf/ ~/input
$hadoop jar /usr/share/hadoop/hadoop-examples-1.2.1.jar grep input output 'dfs[a-z.]+'
を実行するがOutOfMemoryで落ちた。
検索したところStackOverflowがヒットした。
java - out of Memory Error in Hadoop - Stack Overflow
この回答うち、2番目(Reputation)が高い方で解決した。
/etc/hadoop/conf/hadoop-env.sh に
を設定。2GB割り当てる余裕がなかったので1GBにしておいた。
これでエラーが出ずにサンプルが成功した。
サンプルの確認は、
hadoop dfs -cat output/*
再実行したいときは
hadoop dfs -rmr output/
しておくこと。
EclipseのProxy設定が上手く働かない
Eclipse LunaでProxyを設定しているのに繋がらない。
そもそもProxyを使っていないように見える。
Eclipse Community Forums: Newcomers » Luna: Cannot access marketplace through proxy (Kepler works)
Socksの設定を「Clear」する必要があるらしい。
muninを入れてみる
このページを参考に。
Muninによるサーバ監視システムを構築する(CentOS 6.5) | 情シスハック
$ sudo yum -y install munin
$ sudo service httpd restart
Stopping httpd: [FAILED]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using vagrant-centos65.vagrantup.com for ServerName
[ OK ]
apacheって入っているものなのね。
sudo htpasswd -b /etc/munin/munin-htpasswd munin admin
munin-nodeをスタートする。
$ sudo service munin-node start
Starting Munin Node: [ OK ]
5分ほど待ってアクセス
http://ホスト/munin/system-day.html
Elasticsearchをインストールする
この辺りを参考にしてインストールしてみる。
dstat + fluentd + Elasticsearch + kibana でサーバモニタリングする - blog.nomadscafe.jp
Fluentd + Elasticsearch +Kibanaを導入したので手順をメモ - まっしろけっけ
とりあえずdstatのインストール
$ sudo yum install dstat
rpmでElasticsearchをインストールして、起動。
$ sudo rpm -Uvh https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.noarch.rpm
Retrieving https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.noarch.rpm
Preparing... ########################################### [100%]
1:elasticsearch ########################################### [100%]
### NOT starting on installation, please execute the following statements to configure elasticsearch to start automatically using chkconfig
sudo /sbin/chkconfig --add elasticsearch
### You can start elasticsearch by executing
sudo service elasticsearch start
$ sudo service elasticsearch start
Starting elasticsearch: [ OK ]
Nginxをyumでインストールして、起動。
$ sudo yum -y install nginx
/** インストールのメッセージが色々 */
Installed:
nginx.x86_64 0:1.0.15-11.el6Dependency Installed:
GeoIP.x86_64 0:1.5.1-5.el6 gd.x86_64 0:2.0.35-11.el6 nginx-filesystem.noarch 0:1.0.15-11.el6Complete!
$ sudo service nginx start
Starting nginx: [ OK ]
この方法でインストールした時のNginxのドキュメントルート
$ ll /usr/share/nginx/html/
total 20
kibanaを入れる
$ cd
$ mkdir kibana
$ cd kibana
$ wget https://download.elasticsearch.org/kibana/kibana/kibana-3.1.2.tar.gz
$ tar xvzf kibana-3.1.2.tar.gz
$ mv kibana-3.1.2 /usr/share/nginx/html/kibana
mv: cannot move `kibana-3.1.2' to `/usr/share/nginx/html/kibana': Permission denied
お?
$ ll /usr/share/nginx/html/
total 20
Nginxの設定が分かっていないな。
デフォルトのドキュメントルートはroot権限になっている。
これは別のドキュメントルートディレクトリを作って管理してね、という意味なのか?
ここで時間切れ。
後で↓を読む。
http://henteco-labs.com/labs/2014/04/14/rails-nginx/
Hadoopのインストール
Hadoopを使うことになりそうなので、とりあえずインストールしてみた。
以下のリンクをまず読みながら写経。
分散処理に入門してみた(Hadoop + Spark) | キャスレーコンサルティング株式会社
Apache Hadoop 2.9.2 – Hadoop: Setting up a Single Node Cluster.
まずは、Vagrantで仮想環境のCentOS6.5を構築。この手順は省く。
epelは設定済み。
javaが入っていなかった。
前提パッケージとやらのインストール。これはAapacheのガイドには書いてなかった。
Hadoopをダウンロード
$mkdir hadoop
$cd hadoop
$wget http://ftp.riken.jp/net/apache/hadoop/common/hadoop-2.5.0/hadoop-2.5.0.tar.gz
Hadoopは/usr/localに入れるのが当然のようなので、mv
$sudo mv hadoop-2.5.2 /usr/local/
.bash_profileを修正
#Hadoop
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.71.x86_64
export HADOOP_HOME=/usr/local/hadoop-2.5.2
password無しでlocalhostに接続できるようにする(擬似分散実行のために必要らしい)
$ cd
$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/vagrant/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/vagrant/.ssh/id_dsa.
Your public key has been saved in /home/vagrant/.ssh/id_dsa.pub.
The key fingerprint is:$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys
hadoopのインストール確認
$ hadoop version
Hadoop 2.5.2
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r cc72e9b000545b86b75a61f4835eb86d57bfafc0
Compiled by jenkins on 2014-11-14T23:45Z
Compiled with protoc 2.5.0
From source with checksum df7537a4faa4658983d397abf4514320
This command was run using /usr/local/hadoop-2.5.2/share/hadoop/common/hadoop-common-2.5.2.jar
とりあえずSingleNodeでgrepのサンプルを実行する。
$ cd
$ cd hadoop
$ mkdir input
$ cp /usr/local/hadoop-2.5.2/etc/hadoop/*.xml input/
$ hadoop jar /usr/local/hadoop-2.5.2/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0.jar grep input output 'dfs[a-z.]+'
$ cat output/*
inputディレクトリに入っているファイルの中をGrepして出現件数を集計し、
集計結果をoutputディレクトリに出力する。っぽい。