Table of Contents
HDFS installation and configuration
Advanced configuration and optimization
Home Operation and Maintenance CentOS Tips for using HDFS file system on CentOS

Tips for using HDFS file system on CentOS

Apr 14, 2025 pm 07:30 PM
centos Browser red

Guide to Installation, Configuration and Optimization of HDFS File System under CentOS System

This article will guide you on how to install, configure, and optimize Hadoop Distributed File System (HDFS) on CentOS systems.

HDFS installation and configuration

  1. Java environment installation:

    First, make sure that the appropriate Java environment is installed. Edit the /etc/profile file, add the following, and replace /usr/lib/java-1.8.0/jdk1.8.0_144 with your actual Java installation path:

    1

    2

    3

    4

    export JAVA_HOME=/usr/lib/java-1.8.0/jdk1.8.0_144

    export PATH=$JAVA_HOME/bin:$PATH

    export CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar

    source /etc/profile

    Copy after login
  2. Hadoop environment variable configuration:

    Edit /etc/profile file and add Hadoop environment variables. Please replace /opt/hadoop/hadoop-2.8.1 with your Hadoop installation path:

    1

    2

    3

    4

    export HADOOP_HOME=/opt/hadoop/hadoop-2.8.1

    export PATH=$HADOOP_HOME/bin:$PATH

    export CLASSPATH=$HADOOP_HOME/lib/*

    source /etc/profile

    Copy after login
  3. SSH password-free login configuration:

    To facilitate communication between Hadoop nodes, configuring SSH password-free login is crucial. Execute the following command:

    1

    2

    ssh-keygen -t rsa

    ssh-copy-id localhost

    Copy after login
  4. NameNode formatting:

    When configuring HDFS for the first time, the NameNode must be formatted:

    1

    hdfs namenode -format

    Copy after login
  5. HDFS startup:

    Start HDFS service:

    1

    $HADOOP_HOME/sbin/start-dfs.sh

    Copy after login
  6. HDFS web interface access:

    Access NameNode's web interface through a browser (replace<namenode-ip></namenode-ip> Replace with NameNode's IP address):

    1

    <code>http://<namenode-ip> :50070</namenode-ip></code>

    Copy after login

Advanced configuration and optimization

  1. HDFS High Availability (HA):

    Configuring high availability requires two NameNodes (one active and one passive) and at least three JournalNodes. Edit the hdfs-site.xml file and add the following configuration (replace with your actual node information):

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    28

    <property>

      <name>dfs.nameservices</name>

      <value>mycluster</value>

    </property>

    <property>

      <name>dfs.ha.namenodes.mycluster</name>

      <value>nn1,nn2</value>

    </property>

    <property>

      <name>dfs.namenode.rpc-address.mycluster.nn1</name>

      <value>namenode1:8020</value>

    </property>

    <property>

      <name>dfs.namenode.rpc-address.mycluster.nn2</name>

      <value>namenode2:8020</value>

    </property>

    <property>

      <name>dfs.namenode.http-address.mycluster.nn1</name>

      <value>namenode1:50070</value>

    </property>

    <property>

      <name>dfs.namenode.http-address.mycluster.nn2</name>

      <value>namenode2:50070</value>

    </property>

    <property>

      <name>dfs.namenode.shared.edits.dir</name>

      <value>qjournal://journalnode1:8485;journalnode2:8485;journalnode3:8485/mycluster</value>

    </property>

    Copy after login
  2. Performance Tuning:

    • NameNode memory optimization: According to the Hadoop version, adjust hadoop-env.sh (Hadoop 2.x) or use the memory automatic allocation feature (Hadoop 3.x) to optimize NameNode memory. Use the jmap -heap command to monitor memory usage.
    • Heartbeat concurrency optimization: Edit hdfs-site.xml and increase the value of dfs.namenode.handler.count to improve concurrency processing capability.
    • Enable HDFS Recycle Bin: Modify fs.trash.interval and fs.trash.checkpoint.interval in core-site.xml to enable the Recycle Bin.
    • Multi-directory configuration: Modify dfs.namenode.name.dir and dfs.datanode.data.dir in hdfs-site.xml to configure multiple directories to improve data reliability and performance.

Through the above steps, you can effectively install, configure and optimize the HDFS file system on your CentOS system. Please remember to adjust the path and IP address according to your actual environment.

The above is the detailed content of Tips for using HDFS file system on CentOS. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What to do if the USDT transfer address is incorrect? Guide for beginners What to do if the USDT transfer address is incorrect? Guide for beginners Apr 21, 2025 pm 12:12 PM

After the USDT transfer address is incorrect, first confirm that the transfer has occurred, and then take measures according to the error type. 1. Confirm the transfer: view the transaction history, obtain and query the transaction hash value on the blockchain browser. 2. Take measures: If the address does not exist, wait for the funds to be returned or contact customer service; if it is an invalid address, contact customer service and seek professional help; if it is transferred to someone else, try to contact the payee or seek legal help.

CentOS: What Led to the Decision to End Support CentOS: What Led to the Decision to End Support Apr 23, 2025 am 12:10 AM

RedHatendedsupportforCentOStoshifttowardsacommerciallyfocusedmodelwithCentOSStream.1)CentOStransitionedtoCentOSStreamforRHELdevelopment.2)ThisencourageduserstomovetoRHEL.3)AlternativeslikeAlmaLinux,RockyLinux,andOracleLinuxemergedasreplacements.

How to register an account on Ouyi Exchange Ouyi Exchange Registration Tutorial How to register an account on Ouyi Exchange Ouyi Exchange Registration Tutorial Apr 24, 2025 pm 02:06 PM

The steps to register an Ouyi account are as follows: 1. Prepare a valid email or mobile phone number and stabilize the network. 2. Visit Ouyi’s official website. 3. Enter the registration page. 4. Select email or mobile phone number to register and fill in the information. 5. Obtain and fill in the verification code. 6. Agree to the user agreement. 7. Complete registration and log in, carry out KYC and set up security measures.

Can two exchanges convert coins to each other? Can two exchanges convert coins to each other? Can two exchanges convert coins to each other? Can two exchanges convert coins to each other? Apr 22, 2025 am 08:57 AM

Can. The two exchanges can transfer coins to each other as long as they support the same currency and network. The steps include: 1. Obtain the collection address, 2. Initiate a withdrawal request, 3. Wait for confirmation. Notes: 1. Select the correct transfer network, 2. Check the address carefully, 3. Understand the handling fee, 4. Pay attention to the account time, 5. Confirm that the exchange supports this currency, 6. Pay attention to the minimum withdrawal amount.

CentOS: Security, Stability, and Performance CentOS: Security, Stability, and Performance Apr 21, 2025 am 12:11 AM

CentOS is the first choice for server and enterprise environments for its superior security, stability and performance. 1) Security provides forced access control through SELinux to improve system security. 2) Stability is supported by the LTS version for up to 10 years to ensure the stability of the system. 3) Performance significantly improves system response speed and resource utilization by optimizing kernel and system configuration.

Web3 trading platform ranking_Web3 global exchanges top ten summary Web3 trading platform ranking_Web3 global exchanges top ten summary Apr 21, 2025 am 10:45 AM

Binance is the overlord of the global digital asset trading ecosystem, and its characteristics include: 1. The average daily trading volume exceeds $150 billion, supports 500 trading pairs, covering 98% of mainstream currencies; 2. The innovation matrix covers the derivatives market, Web3 layout and education system; 3. The technical advantages are millisecond matching engines, with peak processing volumes of 1.4 million transactions per second; 4. Compliance progress holds 15-country licenses and establishes compliant entities in Europe and the United States.

What is on-chain transaction? What are the global transactions? What is on-chain transaction? What are the global transactions? Apr 22, 2025 am 10:06 AM

EU MiCA compliance certification, covering 50 fiat currency channels, cold storage ratio 95%, and zero security incident records. The US SEC licensed platform has convenient direct purchase of fiat currency, a ratio of 98% cold storage, institutional-level liquidity, supports large-scale OTC and custom orders, and multi-level clearing protection.

Tips and recommendations for the top ten market websites in the currency circle 2025 Tips and recommendations for the top ten market websites in the currency circle 2025 Apr 22, 2025 am 08:03 AM

Domestic user adaptation solutions include compliance channels and localization tools. 1. Compliance channels: Franchise currency exchange through OTC platforms such as Circle Trade, domestically, they need to go through Hong Kong or overseas platforms. 2. Localization tools: Use the currency circle network to obtain Chinese information, and Huobi Global Station provides a meta-universe trading terminal.

See all articles