跳過Java server在ARMv6不支援VM問題

2000px-hadoop_logo-svg

最近花了幾天將自己的三個電腦叢架上Hadoop(什麼是Hadoop) , 其中一個datanode是一代的raspberry pi

而在啟動start-dfs.sh時,遇到了

Server VM is only supported on ARMv7+ VFP

經過谷歌後,發現是因為java server版本上使用VM, 但不支援ARMv6 因此那晚只好早點睡覺。

隔天上課發現了一個繞道方式解決VM不支援的問題

在raspberry pi 上

pi@raspberry:~$  java -version

java version “1.8.0_111”
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)

ks@raspberry:~ $ java -server -version

Error occurred during initialization of VM
Server VM is only supported on ARMv7+ VFP

因此經過谷歌發現一個work around的方法。那就是先到$HADOOP_HOME/etc/hadoop 中更改

hadoop-env.sh (我的$HADOOP_HOME 為/opt/hadoop/hadoop/, 安裝hadoop的地址)

中更愛HADOOP_DATANODE_OPTS 在最後加上-client

 export HADOOP_DATANODE_OPTS="-Dcom.sun.management.jmxremote $HADOOP_DATANODE_OPTS -client"

這樣便可以避開使用java -server 的指令。

 

圖源:https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Hadoop_logo.svg/2000px-Hadoop_logo.svg.png

Advertisements

Ansible Introduction

Recently I got my hands on a brand new orange pi. However, I found myself stuck in typing the same boring command across all sessions. Hence, I believe this serves as a good opportunity to anisible for better automation across all servers. 
Simple walkthrough the steps to install anisible in master server:
First add anisible repository: 
       sudo apt-add-repository ppa:ansible/ansible -y
Install anisible:
        sudo apt-get update && sudo apt-get install ansible -y
        ansible –version
 ansible-version
Create ssh key and copy it across all web-servers:
 [ Note: username must be same as login username and same across all nodes ]
      ssh-copy-id ks@[ first node local ip ]
      ssh-copy-id ks@[ second node local ip ]
  
Then you should be able to ssh into all servers using the master ssh public key
If all commands works out well, you can start editing /etc/ansible/hosts file and create your swarm name and local ip.
       sudo vim /etc/ansible/hosts
      [web-servers]
      192.168.0.102 [ first node local ip ]
      192.168.0.100 [ second node local ip ]
One of many possible command in ansible 
      anisible -m command -a ” your-unix-command” [your-serves-group-name] 
this command send the same command to all servers 
Some Command Example:
      ansible -m ping web-servers
      ansible -m command -a “uptime” web-servers
uptime
      ansible -m command -a “tmux new -s foo -d” web-servers
      anisible -m command -a “tmux ls” web-servers
tmux-ls
Here’s a great proper introduction to ansible by Jeff Geeriling