apachehadoop2.4.064bit在windows8.1下直接安装指南(无需虚拟机
工作需要,要开始搞hadoop了,又是大数据,自己感觉大数据、云,只是ERP、SOAP风潮之后与智能地球一起诞生的概念炒作。不过Apache是个神奇的组织,Java如果没有它也不会现在如火中天。言归正传: 首先需要下载Apache hadoop 2.4.0的tar.gz包,到本地解压缩到
工作需要,要开始搞hadoop了,又是大数据,自己感觉大数据、云,只是ERP、SOAP风潮之后与智能地球一起诞生的概念炒作。不过Apache是个神奇的组织,Java如果没有它也不会现在如火中天。言归正传:
首先需要下载Apache hadoop 2.4.0的tar.gz包,到本地解压缩到某个盘下,注意路径里不要带空格。否则你配置文件里需要用windows 8.3格式的路径!
第二确保操作系统是64bit,已安装.netframework4.0以上版本,这个你懂的,微软的天下,没有这个怎么混!
第三确保安装了64 bit 版本的JDK1.7,笔者使用的就是JDK1.7.
第四请到github下载hadoop-commin-2.2.zip,官方下载的Apache hadoop 2.4.0的压缩包里,缺少windows下运行的链接库(hadoop.dll,winutils.exe,libwinutils.lib等),这个github的是大佬们编译好的64bit版的链接库包。下载直接解压缩,覆盖掉官方hadoop目录下的bin目录即可。
如果你想在windows下编译安装hadoop,则请直接参考官方原版文档:Hadoop2.X Windows安装指南
接下来进行配置(大部分摘抄自官方文档):
我的Hadoop解压缩目录是D:\Hadoop_2_4_0,以下简称h_home
首先,修改%h_home%\etc\hadoop的hadoop-env.cmd脚本文件,在文件末尾增加环境变量定义。注意找到文件最初的JAVA_HOME设置,改成你的64位JDK路径,这一点一定要注意!比如我的:“set JAVA_HOME=D:\OLD_JDK\jdk1.7.0_51”
set HADOOP_PREFIX=c:\deploy set HADOOP_CONF_DIR=%HADOOP_PREFIX%\etc\hadoop set YARN_CONF_DIR=%HADOOP_CONF_DIR% set PATH=%PATH%;%HADOOP_PREFIX%\bin
之后在该路径下找到或创建core-site.xml文件,修改内容如下:
<configuration> <property> <name>fs.default.name</name> <value>hdfs://0.0.0.0:19000</value> </property> </configuration>
<configuration> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration>
接下来我们配置一个YARN示例:
还是在该配置文件路径下,修改或者创建一个mapred-site.xml文件,路径下有个同名的模板文件,可以直接复制,然后修改其中的内容。注意替换配置文件中%USERNAME% 为你windows的用户名。
<configuration> <property> <name>mapreduce.job.user.name</name> <value>%USERNAME%</value> </property> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> <property> <name>yarn.apps.stagingDir</name> <value>/user/%USERNAME%/staging</value> </property> <property> <name>mapreduce.jobtracker.address</name> <value>local</value> </property> </configuration>
最后,创建yarn-site.xml文件,变更内容如下:
<configuration> <property> <name>yarn.server.resourcemanager.address</name> <value>0.0.0.0:8020</value> </property> <property> <name>yarn.server.resourcemanager.application.expiry.interval</name> <value>60000</value> </property> <property> <name>yarn.server.nodemanager.address</name> <value>0.0.0.0:45454</value> </property> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> <property> <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name> <value>org.apache.hadoop.mapred.ShuffleHandler</value> </property> <property> <name>yarn.server.nodemanager.remote-app-log-dir</name> <value>/app-logs</value> </property> <property> <name>yarn.nodemanager.log-dirs</name> <value>/dep/logs/userlogs</value> </property> <property> <name>yarn.server.mapreduce-appmanager.attempt-listener.bindAddress</name> <value>0.0.0.0</value> </property> <property> <name>yarn.server.mapreduce-appmanager.client-service.bindAddress</name> <value>0.0.0.0</value> </property> <property> <name>yarn.log-aggregation-enable</name> <value>true</value> </property> <property> <name>yarn.log-aggregation.retain-seconds</name> <value>-1</value> </property> <property> <name>yarn.application.classpath</name> <value>%HADOOP_CONF_DIR%,%HADOOP_COMMON_HOME%/share/hadoop/common/*,%HADOOP_COMMON_HOME%/share/hadoop/common/lib/*,%HADOOP_HDFS_HOME%/share/hadoop/hdfs/*,%HADOOP_HDFS_HOME%/share/hadoop/hdfs/lib/*,%HADOOP_MAPRED_HOME%/share/hadoop/mapreduce/*,%HADOOP_MAPRED_HOME%/share/hadoop/mapreduce/lib/*,%HADOOP_YARN_HOME%/share/hadoop/yarn/*,%HADOOP_YARN_HOME%/share/hadoop/yarn/lib/*</value> </property> </configuration>
1、切换到etc/hadoop目录,运行hadoop-env.cmd脚本,设置当前命令窗口执行环境变量。
2、格式化HDFS文件系统(建议切换到bin目录然后执行命令):
%HADOOP_PREFIX%\bin\hdfs namenode -format
3、运行HDFS示例:
%HADOOP_PREFIX%\sbin\start-dfs.cmd

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

The MySQL connection may be due to the following reasons: MySQL service is not started, the firewall intercepts the connection, the port number is incorrect, the user name or password is incorrect, the listening address in my.cnf is improperly configured, etc. The troubleshooting steps include: 1. Check whether the MySQL service is running; 2. Adjust the firewall settings to allow MySQL to listen to port 3306; 3. Confirm that the port number is consistent with the actual port number; 4. Check whether the user name and password are correct; 5. Make sure the bind-address settings in my.cnf are correct.

The main reasons for MySQL installation failure are: 1. Permission issues, you need to run as an administrator or use the sudo command; 2. Dependencies are missing, and you need to install relevant development packages; 3. Port conflicts, you need to close the program that occupies port 3306 or modify the configuration file; 4. The installation package is corrupt, you need to download and verify the integrity; 5. The environment variable is incorrectly configured, and the environment variables must be correctly configured according to the operating system. Solve these problems and carefully check each step to successfully install MySQL.

The solution to MySQL installation error is: 1. Carefully check the system environment to ensure that the MySQL dependency library requirements are met. Different operating systems and version requirements are different; 2. Carefully read the error message and take corresponding measures according to prompts (such as missing library files or insufficient permissions), such as installing dependencies or using sudo commands; 3. If necessary, try to install the source code and carefully check the compilation log, but this requires a certain amount of Linux knowledge and experience. The key to ultimately solving the problem is to carefully check the system environment and error information, and refer to the official documents.

Unable to access MySQL from the terminal may be due to: MySQL service not running; connection command error; insufficient permissions; firewall blocks connection; MySQL configuration file error.

Copy and paste in MySQL includes the following steps: select the data, copy with Ctrl C (Windows) or Cmd C (Mac); right-click at the target location, select Paste or use Ctrl V (Windows) or Cmd V (Mac); the copied data is inserted into the target location, or replace existing data (depending on whether the data already exists at the target location).

VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

Running MySQL on Windows is feasible, but challenges such as port conflicts, permission issues, and environment variable settings need to be considered. Installation issues can be solved by customizing configuration files, adjusting user permissions, and setting environment variables correctly. Additionally, the appropriate storage engine should be selected, tweaked configuration files, and SSDs should be used to optimize performance.
