ERROR
未读12月后Centos 6 系统无法使用yum出现错误(文章底部看)
相信已经有一部分朋友今天连接到CentOS 6的服务器后执行yum后发现报错,那么发生了什么?
CentOS 6已经随着2020年11月的结束进入了EOL(Reaches End of Life),不过有一些老设备依然需要支持,CentOS官方也给这些还不想把CentOS 6扔进垃圾堆的用户保留了最后一个版本的镜像,只是这个镜像不会再有更新了
官方便在12月2日正式将CentOS 6相关的软件源移出了官方源,随之而来逐级镜像也会陆续将其删除。
不过有一些老设备依然需要维持在当前系统,CentOS官方也给这些还不想把CentOS 6扔进垃圾堆的用户保留了各个版本软件源的镜像,只是这个软件源不会再有更新了。
一键修复
12345sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.confmv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.r ...
Hive基本操作(1)启动hivebin/hive
(2)查看数据库hive> show databases;
(3)打开默认数据库hive> use default;
(4)显示default数据库中的表hive> show tables;
(5)创建一张表hive> create table student(id int, name string);
(6)显示数据库中有几张表hive> show tables;
(7)查看表的结构hive> desc student;
(8)向表中插入数据hive> insert into student values(1000,"ss");
(9)查询表中数据hive> select * from student;
(10)退出hivehive> quit;
Hive实际操作(1)启动hivebin/hive
(2)显示数据库hive> show databases;
(3)使用default数据库hive> use default;
(4)显示default ...
完美解决:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x如题:
原因:没有配置resolv.conf
解决方法:
到/etc目录下配置resolv.conf加入nameserver IP,如:
nameserver 8.8.8.8nameserver 8.8.4.4search localdomain
FilterMapper12345678910111213141516package outputformat;import org.apache.hadoop.io.LongWritable;import org.apache.hadoop.io.NullWritable;import org.apache.hadoop.io.Text;import org.apache.hadoop.mapreduce.Mapper;import java.io.IOException;public class FilterMapper extends Mapper<LongWritable, Text,Text, NullWritable> { @Override protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { context.write(value,NullWritab ...
自定义InputFormat案例实操无论HDFS还是MapReduce,在处理小文件时效率都非常低,但又难免面临处理大量小文件的场景,此时,就需要有相应解决方案。可以自定义InputFormat实现小文件的合并。
需求将多个小文件合并成一个SequenceFile文件(SequenceFile文件是Hadoop用来存储二进制形式的key-value对的文件格式),SequenceFile里面存储着多个文件,存储的形式为文件路径+名称为key,文件内容为value。
自定义InputFromat1234567891011121314151617181920package inputformat;import org.apache.hadoop.io.BytesWritable;import org.apache.hadoop.io.Text;import org.apache.hadoop.mapreduce.InputSplit;import org.apache.hadoop.mapreduce.RecordReader;import org.apache.hadoop.mapred ...
此案例是在MapReduce序列化案例 基础上完成
FlowBean123456789101112public class FlowBean implements WritableComparable<FlowBean> { ······ @Override public int compareTo(FlowBean o) { if(this.sumFlow!=o.getSumFlow()) { return this.sumFlow > o.getSumFlow() ? -1 : 1; }else { return 0; } } ······}
FlowSortMapper1234567891011121314151617181920212223242526package flowsum3;import org.apache.hadoop.io.LongWrita ...
此案例是在 WritableComparable全排序案例 基础上完成
FlowBean123456789101112public class FlowBean implements WritableComparable<FlowBean> { ······ @Override public int compareTo(FlowBean o) { if(this.sumFlow!=o.getSumFlow()) { return this.sumFlow > o.getSumFlow() ? -1 : 1; }else { return 0; } } ······}
CustomPartition1234567891011121314151617181920212223package flowsum2;import org.apache.hadoop.io.Text ...
输入数据1001 01 11002 02 21003 03 31004 01 41005 02 51006 03 6
01 魅族02 华为03 小米
TableJoin12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091package table;import org.apache.hadoop.io.Writable;import java.io.DataInput;import java.io.DataOutput;import java.io.IOException;public class TableBean implements Writable { private String id; private String pid; private int amou ...
此案例是在MapReduce序列化案例 基础上完成
CustomPartition1234567891011121314151617181920212223package flowsum2;import org.apache.hadoop.io.Text;import org.apache.hadoop.mapreduce.Partitioner;public class CustomPartition extends Partitioner<Text,FlowBean> { @Override public int getPartition(Text text, FlowBean flowBean, int i) { String line=text.toString(); if(line.startsWith("13")){ return 0; }else if(line.startsWith("14")){ ...
输入数据123456789101112131415hadoop hello hadoopmapreduce hellospark hello scalahdfs java hadoopyarn hello javahadoop hello hadoopmapreduce hellospark2 hello scalahdfs java hadoopyarn2 hello javahadoop2 hello hadoopmapreduce hellospark4 hello scalahdfs java hadoopyarn hello java
NLMapper1234567891011121314151617181920package NLInputFormat;import org.apache.hadoop.io.IntWritable;import org.apache.hadoop.io.LongWritable;import org.apache.hadoop.io.Text;import org.apache.hadoop.mapreduce.Mapper;import ...