Windows: windows server2003
I am not familiar with cygwin. Fortunately, I just need to make a very simple application. With the help of my colleagues, I have finished this job. Here we will give you a general idea.
1. Install JDK and configure environment variables. Note that the installation path should not contain spaces or be installed in a directory similar to program files. Otherwise, cygwin may have problems.
2. Deploy hadoop. Directly pull a hadoop deployed on liux and deploy it locally. I put it in the root directory of drive D.
3. Install cygwin. There are several main components. I installed it in the root directory of drive D.
4. Create a windows user cloud. The user created here must be the same as the user running hadoop in linux. Otherwise, the system prompts that the user has no permission when uploading files.
5. Create a bat file for cloud users to call, write: D: \ cygwin \ bin \ bash -- login-I D: \ hadoop-0.20.2-CDH3B4 \ bin \ hadoop-ls \
The purpose of the above script is to test whether the hadoop command is successfully called through cygwin using a windows Script. After running this script as a cloud user, cygwin will create a cloud user directory under the home file under the installation directory!
6. After the above test is passed, create an sh file in the cloud user directory of cygwin, for example, upload. sh file, write: D:/hadoop-0.20.2-CDH3B4/bin/hadoop fs-put $ DIR/$ FILES $ HDFS.
Then, edit the bat file and change the following command to sh Script Name: D: \ cygwin \ bin \ bash -- login-I \ home \ cloud \ upload. sh.
7. other modifications are mainly made to hadoop configuration files. Generally, You Need To comment out the JAVA environment variables or change the slashes of some parts to windows.
Author "cool"