Recently, I used WSL2 with ubuntu version 20.0.4 to installed hadoop which version is 3.2.1, and I want to share some experiences about what I met some troubles.
First, I went to the offical webiste, look for a guide, as a single node, I opend the Single Node Setup, for the first step, I type some commands like it said.
1 | $ sudo apt-get install ssh |
It must to use Java enviroment, so I installed openjdk-8-jdk.
1 | $ sudo apt install openjdk-8-jdk |
Then, I wen to the other link, and download the release package.
1 | wget https://downloads.apache.org/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz |
Before run hadoop, we should modify configuration, use this command
1 | vim ~/hadoop-3.2.1/etc/hadoop/core-site.xml |
1 | vim ~/hadoop-3.2.1/etc/hadoop/hdfs-site.xml: |
Then append enviroment variable to hadoop-env.sh
1 | vim ~/hadoop-3.2.1/etc/hadoop/hadoop-env.sh |
If you cannot ssh to localhost without a passphrase, execute the following commands:
1 | $ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa |
After that, as offcial doument, we will done, But some troubles will start, first I can’t start hadoop, it told me localhost: rcmd: socket: Permission denied, then I try to ssh localhost, it refused on port 22, so by it describe, I think ssh-server not run, so I search how to run the ssh-server on wsl2, and as it said, I modify the ssh configration
1 | $ sudo vim /etc/ssh/sshd_config |
After config, try use
1 | $ ssh localhost |
if you can login, it will done, that’s all.