Hadoop 安装LZO

1.在pom.xml引入lzo依赖

<?xml version="1.0" encoding="UTF-8"?>
		<project xmlns="http://maven.apache.org/POM/4.0.0"
				 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
				 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
			<modelVersion>4.0.0</modelVersion>
			<groupId>com.it18zhang</groupId>
			<artifactId>HdfsDemo</artifactId>
			<version>1.0-SNAPSHOT</version>
			<packaging>jar</packaging>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins
						</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
						<configuration>
							<source>1.8</source>
							<target>1.8</target>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.8</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<echo>---------开始复制jar包到共享目录下----------</echo>
										<delete file="D:\downloads\bigdata\data\HdfsDemo-1.0-SNAPSHOT.jar"></delete>
										<copy file="target/HdfsDemo-1.0-SNAPSHOT.jar" toFile="D:\downloads\bigdata\data\HdfsDemo.jar">
										</copy>
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
			<dependencies>
				<dependency>
					<groupId>org.apache.hadoop</groupId>
					<artifactId>hadoop-client</artifactId>
					<version>2.7.3</version>
				</dependency>
				<dependency>
					<groupId>org.apache.hadoop</groupId>
					<artifactId>hadoop-yarn-common</artifactId>
					<version>2.7.3</version>
				</dependency>
				<dependency>
					<groupId>org.apache.hadoop</groupId>
					<artifactId>hadoop-yarn-client</artifactId>
					<version>2.7.3</version>
				</dependency>
				<dependency>
					<groupId>org.apache.hadoop</groupId>
					<artifactId>hadoop-yarn-server-resourcemanager</artifactId>
					<version>2.7.3</version>
				</dependency>
				<dependency>
					<groupId>org.anarres.lzo</groupId>
					<artifactId>lzo-hadoop</artifactId>
					<version>1.0.0</version>
					<scope>compile</scope>
				</dependency>

				<dependency>
					<groupId>junit</groupId>
					<artifactId>junit</artifactId>
					<version>4.11</version>
				</dependency>

			</dependencies>
		</project>

2.在centos上安装lzo库
        $>sudo yum -y install lzo

    3.使用mvn命令下载工件中的所有依赖
        进入pom.xml所在目录,运行cmd:
        mvn -DoutputDirectory=./lib -DgroupId=com.it18zhang -DartifactId=HdfsDemo -Dversion=1.0-SNAPSHOT dependency:copy-dependencies
    
    4.在lib下存放依赖所有的第三方jar
        
    5.找出lzo-hadoop.jar + lzo-core.jar复制到hadoop的响应目录下。
        $>cp lzo-hadoop.jar lzo-core.jar /soft/hadoop/shared/hadoop/common/lib
    
    6.执行远程程序即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值