云服务器搭建hadoop

在云服务器中配置Hadoop的过程主要包括以下几个步骤:安装Java环境、下载并解压Hadoop安装包、配置Hadoop环境变量、初始化Hadoop集群、配置Hadoop的核心配置文件、启动Hadoop集群,下面详细介绍每个步骤的具体操作。

创新互联IDC提供业务:温江服务器托管,成都服务器租用,温江服务器托管,重庆服务器租用等四川省内主机托管与主机租用业务;数据中心含:双线机房,BGP机房,电信机房,移动机房,联通机房。

1、安装Java环境

Hadoop依赖于Java环境,因此首先需要在云服务器上安装Java,可以使用以下命令安装OpenJDK:

sudo apt-get update
sudo apt-get install openjdk-8-jdk

2、下载并解压Hadoop安装包

从Hadoop官网下载最新版本的Hadoop安装包,然后将其上传到云服务器上,接下来使用以下命令解压安装包:

tar -xzf hadoop-x.y.z.tar.gz

3、配置Hadoop环境变量

编辑~/.bashrc文件,添加以下内容:

export HADOOP_HOME=/path/to/hadoop-x.y.z
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop

保存文件后,执行以下命令使配置生效:

source ~/.bashrc

4、初始化Hadoop集群

使用以下命令初始化Hadoop集群:

hadoop namenode -format

5、配置Hadoop的核心配置文件

编辑$HADOOP_CONF_DIR/core-site.xml文件,添加以下内容:


  
    fs.defaultFS
    hdfs://localhost:9000
  

编辑$HADOOP_CONF_DIR/hdfs-site.xml文件,添加以下内容:


  
    dfs.replication
    1
  

6、启动Hadoop集群

使用以下命令启动Hadoop集群:

start-dfs.sh start namenode
start-yarn.sh start resourcemanager yarn --config $HADOOP_CONF_DIR/yarn-site.xml start nodemanager --config $HADOOP_CONF_DIR/yarn-site.xml host=localhost port=8042 state=started user=root group=root memory=2048 cpus=1 vcores timeout=120000 queues=default(a-default) +capacity(a-capacity) +userlimit(a-userlimit) +a-fair(a-fair) +placeresume(a-placeresume) +port(a-port) +ip(a-ip) +hostsfile(a-hostsfile) +hostsallow(a-hostsallow) +hostsdeny(a-hostsdeny) +hostsexclude(a-hostsexclude) +topology(a-topology) +acl(a-acl) +loglevel(a-loglevel) +healthcheck(a-healthcheck) +skipcrccheck(a-skipcrccheck) +enableautofailover(a-enableautofailover) +failoverrecoverytime(a-failoverrecoverytime) +maxtaskfailures(a-maxtaskfailures) +tasktrackerexpiryintervalsecs(a-tasktrackerexpiryintervalsecs) +schedulerclasspath(a-schedulerclasspath) +schedulerproperties(a-schedulerproperties) +driverclasspath(a-driverclasspath) +driverproperties(a-driverproperties) +preemptable(a-preemptable) +priorityforhighpritasks(a-priorityforhighpritasks) +maxidletimeoutmins(a-maxidletimeoutmins) +heartbeatdelaysecs(a-heartbeatdelaysecs) +heartbeatmonitorthreads(a-heartbeatmonitorthreads) +clientprogressreporting(a-clientprogressreporting) +unmanageddisksacceptingsnapscans(a-unmanageddisksacceptingsnapscans) +blockadmitrate(a-blockadmitrate) +vadmissionrate(a-vadmissionrate) +replicationminimum(a-replicationminimum) +replicationmaximum(a-replicationmaximum) +saveNamespacestate(a-saveNamespacestate) +saveNamespacestateOnExit(a-saveNamespacestateOnExit) +transitionalCheckpointTimeSecs(a-transitionalCheckpointTimeSecs) +stateSavePeriodic(a-stateSavePeriodic) +safemodeWaitSeconds(a-safemodeWaitSeconds) +ipRange(a-ipRange);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+transferAckWindowSize(xfer_ack_window_size);+transferBlockLimitRate(xfer_block_limit_rate);+transferBandwidthPerSec(xfer_bandwidth);+transferBlockSizeBits(xfer_blocksize);+transferProtocol(xfer_protocol);+streamBlockSizeBits(stream_blocksize);+streamBlockCacheSize(stream_blockcachesize);+streamReadaheadSize(streamreadaheadsize);+streamSocketTimeoutSecs(streamsockettimeoutsecs);+dataTransferProtocolClassName(dataXferProtocolClassName);+dataTransferProtocolProxyPortNumber(dataXferProtocolProxyPortNumber);+dataTransferProtocolProxyHostNamePatternString(dataXferProtocolProxyHostNamePatternString);+dataTransferProtocolUsePlainTextModeForStreamingTcpConnectionsToRemoteNodesInAllLocalDomainNameResolutionContexts(dataXferProtocolUsePlainTextModeForStreamingTcpConnectionsToRemoteNodesInAllLocalDomainNameResolutionContexts);+dataTransferProtocolUsePlainTextModeForStreamingUdpConnectionsToRemoteNodesInAllLocalDomainNameResolutionContexts(dataXferProtocolUsePlainTextModeForStreamingUdpConnectionsToRemoteNodesInAllLocalDomainNameResolutionContexts);+resourceManagerClusterEnabled (resourcemanagerclusterenabled);+resourceManagerClusterTrackingUrl (resourcemanagerclustertrackingurl);+resourceManagerHostname (resourcemanagerhostname);+resourceManagerPortNumber (resourcemanagerportnumber);+resourceManagerHttpPort (resourcemanagerhttpport);+resourceManagerMaxAppSubmissionBatchSize (resourcemanagermaxappsubmissionbatchsize);+resourceManagerMaxAMMemoryMB (resourcemanagermaxammemorymb);+resourceManagerMaxAppAttemptsPerContainerType (resourcemanagermaxappattemptspercontainertype);+resourceManagerMaxRunningAppAttemptCount (resourcemanagermaxrunningappattemptcount);+resourceManagerMaxContainerCapacity (resourcemanagermaxcontainercapacity);+resourceManagerMaxAMContainerSize (resourcemanagermaxamcontainersize);+resourceManagerAsyncAmStartTimeoutSeconds (resourcemanagerasyncamstarttimeoutseconds);+resourceManagerAsyncAmFinishTimeoutSeconds (resourcemanagerasyncamfinishtimeoutseconds);+resourceManagerAsyncAmPollIntervalSeconds (resourcemanagerasyncampollintervalseconds);+yarnNodeManagerHostname (yarnnodemanagerhostname);+yarnNodeManagerBindAddress (yarnnodemanagerbindaddress);+yarnNodeManagerPortNumber (yarnnodemanagerportnumber);+yarnNodeManagerWebInterfacePortNumber (yarnnodemanagerwebinterfaceportnumber);+yarnNodeManagerEnableNodelifecycleMonitoringService (yarnnodemanagerenablenodelifecyclemonitoringservice);+yarnNodeManagerHeapSizeMB (yarnnodemanagerheapsizemb);+yarnNodeManagerCpuLoadBalancingMinimumSystemResourcePercent (yarnnodemanagercpuloadbalancingminimumsystemresourcepercent);+yarnNodeManagerCpuLoadBalancingMaximumSystemResourcePercent (yarnnodemanagercpuloadbalancingmaximumsystemresourcepercent);+yarnNodeManagerCpuLoadBalancingEnabled (yarnnodemanagercpuloadbalancingenabled);+yarnNodeManagerDiskFailureThresholdPercentage (yarnnodemanagerdiskfailurethresholdpercentage);+yarnNodeManagerDiscardReclaimedExportedKeytabEntriesAfterNHours (yarnnodemanagerdiscardreclaimedexportedkeytabentriesafternhhours);+yarnNodeManagerTokenAuthenticatorFile (yarnnodemanagertokenauthenticatorfile);+yarnNodeManagerDelegationTokenExpirationMsec (yarnnodemanagerdelegationtokenexpirationmsec);+yarnNodeManagerClientUserAgentPrefixesWhitelistFileName (yarnnodemanagerclientuseragentprefixeswhitelistfilename);+yarnNodeManagerClientUserAgentSuffixesBlacklistFileName (yarnnodemanagerclientuseragentsuffixesblacklistfilename);+yarnNodeManagerLogLevel (yarnnodemanagerloglevel);+yarnNodeManagerLogDir (yarnnodemanagerlogdir);+oozie

标题名称:云服务器搭建hadoop
文章出自:http://www.shufengxianlan.com/qtweb/news43/209593.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联