Last active
December 29, 2017 20:10
-
-
Save elect000/6bd25fc28f7c38f684b28932567d14d5 to your computer and use it in GitHub Desktop.
Hadoop3.0.0 にブラウザからアクセスしようとして苦労した話(あとArchLinux) ref: https://qiita.com/elect/items/328c28c310b385de7d23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ls /sys/firmware/efi/efivars ;; 中身があることを確認 | |
#parted /dev/sda | |
() mklabel gpt | |
() mkpart ESP fat32 1MiB 513MiB | |
() set 1 boot on | |
() mkpart primary ext4 513MiB 100% | |
() quit | |
# lsblk /dev/sda ;; sda1 と sda2を確認 | |
# mkfs.vfat -F32 /dev/sda1 | |
# mkfs.ext4 /dev/sda2 | |
# mount /dev/sda2 /mnt | |
# mkdir /mnt/boot && mount /dev/sda1 /mnt/boot | |
# nano /etc/pacman.d/mirrorlist | |
;; Japanサーバを一番上に持ってくる | |
;; C-W Japan / Shift で範囲選択 / C-k でカット / C-u で貼り付け | |
# pacman -Syyu archlinux-keyring | |
# pacstrap /mnt base base-devel | |
# genfstab -U /mnt >> /mnt/etc/fstab | |
# arch-chroot /mnt | |
# ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime | |
# hwclock --systohc --utc | |
# nano /etc/locale.gen | |
en_US.UTF-8 UTF-8 | |
ja_JP.UTF-8 UTF-8 を追記 | |
# locale-gen | |
# echo LANG=en_US.UTF-8 > /etc/locale.conf | |
# echo localhost >> /etc/hostname ;; hadoopを試した時にこうした方が良かった | |
# nano /etc/hosts ;; ここ重要 | |
127.0.0.1 localhost.localdomain localhost | |
192.168.1.31 test.localdomain test に更新! | |
# mkinitcpio -p linux | |
# passwd | |
;; 好きなものに | |
# pacman -S grub efibootmgr | |
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck | |
# mkdir /boot/EFI/boot | |
# cp /boot/EFI/arch_grub/grubx64.efi /boot/EFI/boot/bootx64.efi | |
# grub-mkconfig -o /boot/grub/grub.cfg | |
# exit | |
# umount -R /mnt | |
;; virtualboxメニュー=>isoディスクを取り外す | |
# reboot | |
login : root | |
passwd : ;;さっき入れたもの | |
# systemctl enable dhcpcd & systemctl start dhcpcd | |
# systemctl status dhcpcd | |
;; ちゃんと動いているのを確認 | |
# useradd -m test ;; vagarnt ユーザならvagrant | |
# paddwd test | |
;; vagrant ユーザは vagrantにする必要がある...はず | |
# EDITOR=nano visudo | |
test ALL=(ALL) NOPASSWD: ALL を任意の箇所に追記 | |
# pacman -S openssh wget | |
# systemctl enable sshd.service | |
# systemctl start sshd.service | |
# systemctl status sshd.service | |
;; sshd サービスが有効になっていることを確認 | |
# pacman -S emacs git curl jre8-openjdk jdk8-openjdk | |
# su - test | |
$ sudo emacs /etc/pacman.conf | |
[archlinuxfr] | |
SigLevel = Never | |
Server = http://repo.archlinux.fr/$arch を追記 | |
[multilib] | |
Include = /etc/pacman.d/mirrorlist のコメントアウトを削除 | |
$ sudo pacman --sync --refresh yaourt | |
$ sudo pacman -Syu yaourt | |
$ sudo emacs /etc/yaourtrc | |
TMPDIR="/home/test/Downloads" を追記 | |
$ sudo pacman -S virtualbox-guest-modules-arch | |
$ sudo modprobe -a vboxguest vboxsf vboxvideo | |
$ sudo emacs /etc/modules-load.d/virtualbox.conf | |
vboxguest | |
vboxsf | |
vboxvideo を書き込む | |
$ sudo pacman -S virtualbox-guest-utils | |
$ sudo systemctl enable vboxservice | |
$ sudo systemctl start vboxservice | |
$ sudo systemctl status vboxservice | |
$ sudo reboot | |
login : test | |
password : ;;さっき入れたもの | |
$ ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa | |
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | |
$ sudo emacs /etc/ssh/sshd_config | |
# AuthorizedKeysFile .ssh/authorized_keys をコメントアウト | |
$ ssh localhost | |
$ exit | |
$ sudo pacman -S xorg xorg-server deepin | |
$ sudo pacman -S deepin-extra | |
$ sudo systemctl enable deepin-desktop | |
$ sudo emacs /etc/lightdm/lightdm.conf | |
greeter-session=lightdm-deepin-greeter に変更 | |
;; greeter-session= を検索して、その部分を書き換える(コメントされていればコメントを外す) | |
$ sudo systemctl start lightdm | |
;; ここでGUIが起動する、はず | |
;; 起動したら、デスクトップを右クリックして、terminalを開く | |
;; deepin desktop の使い方については、ここでは扱わない | |
$ sudo systemctl enable lightdm | |
$ sudo shutdown -h now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd ~/Downloads | |
$ wget <had-pass> ;; さっき取ってきたパス | |
$ tar zxfv hadoop-3.0.0.tar.gz | |
$ sudo cp -r ./hadoop-3.0.0 /usr/local/hadoop | |
$ sudo chown -R test /usr/local/hadoop | |
$ sudo mkdir /usr/local/hadoop_tmp | |
$ sudo chown -R test /usr/local/hadoop_tmp | |
$ cd /usr/local/hadoop | |
$ ls | |
;; 色々あることを確認(bin,etc,sbinなど) | |
$ sudo emacs ~/.bashrc | |
### HADOOP PATHES ### | |
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk | |
export HADOOP_HOME=/usr/local/hadoop | |
export PATH=$PATH:$HADOOP_HOME/bin | |
export PATH=$PATH:$HADOOP_HOME/sbin | |
export HADOOP_MAPRED_HOME=$HADOOP_HOME | |
export HADOOP_COMMON_HOME=$HADOOP_HOME | |
export HADOOP_HDFS_HOME=$HADOOP_HOME | |
export YARN_HOME=$HADOOP_HOME | |
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native | |
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib/native" | |
export PATH=$PATH:/usr/local/hadoop/bin/ | |
######################### を末尾に追記する | |
$ source ~/.bashrc | |
$ sudo emacs ./etc/hadoop/hadoop-env.sh | |
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk/ を追記 | |
$ sudo emacs ./etc/hadoop/core-site.xml | |
<configuration> | |
<property> | |
<name>fs.defaultFS</name> | |
<value>hdfs://localhost:9000</value> | |
</property> | |
</configuration> にする | |
$ sudo emcas ./etc/hadoop/hdfs-site.xml | |
<configuration> | |
<property> | |
<name>dfs.replication</name> | |
<value>1</value> | |
</property> | |
</configuration> | |
$ sudo emcas ./etc/hadoop/mapred-site.xml | |
<configuration> | |
<property> | |
<name>mapreduce.framework.name</name> | |
<value>yarn</value> | |
</property> | |
</configuration> | |
$ sudo emacs ./etc/hadoop/yarn-site.xml | |
<configuration> | |
<property> | |
<name>yarn.nodemanager.aux-services</name> | |
<value>mapreduce_shuffle</value> | |
</property> | |
</configuration> | |
$ cd ~ | |
$ hdfs namenode -format | |
;; なんやかんやして、 | |
;; SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1 と帰ってくるはず...(192.168.1.11と返ってくることもある...?) | |
;; INFO ではなく ERROR が帰ってきている部分があったら質問サイトやその手の場所を巡ったほうが良いです | |
$ start-all.sh | |
$ jps | |
XXXX SecondaryNameNode | |
XXXX NameNode | |
XXXX ResourceManager | |
XXXX NodeManager | |
XXXX Jps | |
XXXX DataNode となっていたら正しい |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ netstat -an | grep LISTEN ;; <==ここかなり重要 | |
tcp 0 0 0.0.0.0:22 ..... LISTEN | |
tcp 0 0 0.0.0.0:13562 ..... LISTEN | |
tcp 0 0 127.0.0.1:9000 .... LISTEN | |
tcp 0 0 ::::8088 .......... LISTEN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment