This article uses the hadoop Source Code. For details about how to import the hadoop source code to eclipse, refer to the first phase.
I. background of HDFS
As the amount of data increases, the data cannot be stored within the jurisdiction of an operating system, so it is allocated to more disks managed by the operating system, but it is not convenient to manage and maintain, A distributed file management system is urgently needed to manage files on
It took some time to read the source code of HDFS. Yes.However, there have been a lot of parsing hadoop source code on the Internet, so we call it "edge material", that is, some scattered experiences and ideas.
In short, HDFS is divided into three parts:Namenode maintains the distribution of data on datanode and is also responsible for some scheduling tasks;Datanode, where real data is stored;Dfsclient, a
Sqoop
Flume
Hdfs
Sqoop is used to import data from a structured data source, such as an RDBMS
Flume for moving bulk stream data to HDFs
HDFs Distributed File system for storing data using the Hadoop ecosystem
The Sqoop has a connector architecture. The connector knows how to connect to the appropriate data source
Configuration file
m103 Replace with the HDFs service address.To use the Java client to access the file on the HDFs, have to say is the configuration file Hadoop-0.20.2/conf/core-site.xml, originally I was here to eat a big loss, so I am not even hdfs, file can not be created, read.
Configuration item: Hadoop.tmp.dir represents the directory locati
Continue the previous chapter to organize the HDFs related configuration items
Name
Value
Description
Dfs.default.chunk.view.size
32768
The content display size for each file in the HTTP access page of Namenode, usually without setting.
Dfs.datanode.du.reserved
1073741824
The amount of space reserved for each disk needs to be set up, mainly for non-HDFS
Tags: 3.0 end TCA Second Direct too tool OTA run1. Distributing HDFs Compressed Files (-cachearchive)Requirement: WordCount (only the specified word "The,and,had ..." is counted), but the file is stored in a compressed file on HDFs, there may be multiple files in the compressed file, distributed through-cachearchive;-cacheArchive hdfs://host:port/path/to/file.tar
Hadoop FS: Use the widest range of surfaces to manipulate any file system.Hadoop DFS and HDFs DFS: can only operate on HDFs file system-related (including operations with local FS), which is already deprecated, typically using the latter.The following reference is from StackOverflowFollowing is the three commands which appears same but has minute differences
Hadoop fs {args}
Hadoop dfs {args}
The shell operation of HDFs is simple, you can view the document directly, and similar to the Linux instructions, the following is a brief summary of HDFs Java client writing.Build the project where the client is placed under the HDFs package:A guide package is required, and a different jar package will be found under the Share folder in Hadoop. I put my stickers
Hadoop 2.3.0 has been released, and the biggest bright spot is centralized caching management (HDFS centralized cache management). This feature is useful for improving the efficiency and timeliness of the implementation of Hadoop and upper tier applications, and this article explores this from three perspectives: principle, architecture and Code analysis.
What are the main issues that have been solved
Users can specify some data that is often used o
Transferred from: http://blog.csdn.net/wzy0623/article/details/73650053First, why to use Flume in the past to build HAWQ Data Warehouse experimental environment, I use Sqoop extract from the MySQL database incrementally extract data to HDFs, and then use the HAWQ external table for access. This method requires only a small amount of configuration to complete the data Extraction task, but the disadvantage is also obvious, that is the real-time nature.
object.classInodefileunderconstructionextendsinodefile {String clientName; //Lease holder Lease Holder Private FinalString clientmachine;//The host on which the client residesPrivate FinalDatanodedescriptor Clientnode;//If client is a cluster node too. If clients are running on machines in a cluster, they represent data node information Private intPrimarynodeindex =-1;//The node working on lease recovery PrivateDatanodedescriptor[] Targets =NULL;//locations for last block Data Flow pipeline
$handler.run (Server.java:1754)At this point, you can see the directory that holds the synchronization files/hadop-cdh-data/jddfs/nn/journalhdfs1 not found, SSH remote connection to the node to see that there is no such directory. Here, basically can be fixed to the problem, there are 2 ways to solve: one is to initialize the directory through the relevant command (I think this method is the correct way to solve the problem), and the second is to directly copy the normal Journalnode files over.
.hdfs.rollCount = 0#--file format: Default sequencefile, optional DataStream \ CompressedstreamA1.sinks.k1.hdfs.fileType = DataStream #DataStream可以直接读出来#--format for sequence file records. "Text" or "writable" A1.sinks.k1.hdfs.writeFormat = Text#--Use local time to replace the transfer character (instead of using the timestamp of the event header)A1.sinks.k1.hdfs.useLocalTimeStamp = True# Use a channel which buffers events in memoryA1.channels.c1.type = Memorya1.channels.c1.capacity = 1000a1.cha
client6, the client begins to upload the first block to a (the first to read data from the disk into a local memory cache), in packet (a packet of 64KB), of course, when writing Datanode data validation, It is not a packet through a single check, but in chunk units for the check (512byte), the first Datanode received a packet will be passed to the second, the second to the third; the first one each packet will be put into a reply queue waiting to be answered7. When a block transfer is complete,
Label:The first is to install the MySQL database. Installation is complete using the sudo apt-get install mysql-server command. The table is then created and the data is inserted:Then download the Sqoop and the jar package that connects to the MySQL database. The next step is to install Sqoop. The first is to configure the sqoop-env.sh file:Then comment out the Config-sqoop file that does not need to be checked:The next step is to copy the Sqoop-1.4.4.jar package and the jar that connects MySQL
Not much to say, directly on the dry goods! 1, start each machine zookeeper (bigdata-pro01.kfk.com, bigdata-pro02.kfk.com, bigdata-pro03.kfk.com)2, start the ZKFC (bigdata-pro01.kfk.com)[Email protected] hadoop-2.6.0]$ pwd/opt/modules/hadoop-2.6.0[Email protected] hadoop-2.6.0]$ sbin/hadoop-daemon.sh start ZKFC Then, see "authored" Https://www.cnblogs.com/zlslch
Flume write HDFs operation in the Hdfseventsink.process method, the path creation is done by BucketpathAnalyze its source code (ref.: http://caiguangguang.blog.51cto.com/1652935/1619539)Can be implemented using%{} variable substitution, only need to get the time field in the event (the Nginx log of the local times) incoming Hdfs.path can beThe specific implementation is as follows:1. In the Kafkasource process method, add:DT = Kafkasourceutil.getdatem
1. HDFs definitionHDFS is the primary distributed storage used by Hadoop applications. A HDFS cluster primarily consists of a NameNode that manages the file system metadata and datanodes that store the actual Data.2. HDFs Architecture3. HDFs instanceAs a file system, the reading and writing of files is the core:/*** Li
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.