Hadoop部署方式-高可用集群部署(High Availability)

                Hadoop部署方式-高可用集群部署(High Availability)

                                          作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

 

 

  本篇博客的高可用集群是建立在完全分布式基础之上的,详情请参考:https://www.cnblogs.com/yinzhengjie/p/9065191.html。并且需要新增一台Linux服务器,用于Namenode的备份节点。

 

 

一.实验环境准备
  需要准备五台Linux操作系统的服务器,配置参数最好一样,由于我的虚拟机是之前完全分布式部署而来的,因此我的环境都一致。

1>.NameNode服务器(s101)

2>.DataNode服务器(s102)

3>.DataNode服务器(s103)

4>.DataNode服务器(s104)

5>.DataNode服务器(s105)

 

二.在s101上修改配置文件并分发到其它节点

  关于配置hadoop高可用的参数,参考官网链接:http://hadoop.apache.org/docs/r2.7.3/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html

1>.在s101上拷贝配置目录并修改符号链接

[yinzhengjie@s101 ~]$ ll /soft/hadoop/etc/
total 12
drwxr-xr-x. 2 yinzhengjie yinzhengjie 4096 Jun  8 05:36 full
lrwxrwxrwx. 1 yinzhengjie yinzhengjie   21 Jun  8 05:54 hadoop -> /soft/hadoop/etc/full
drwxr-xr-x. 2 yinzhengjie yinzhengjie 4096 May 25 09:15 local
drwxr-xr-x. 2 yinzhengjie yinzhengjie 4096 May 25 20:51 pseudo
[yinzhengjie@s101 ~]$ cp -r /soft/hadoop/etc/full  /soft/hadoop/etc/ha
[yinzhengjie@s101 ~]$ ln -sfT  /soft/hadoop/etc/ha  /soft/hadoop/etc/hadoop
[yinzhengjie@s101 ~]$ ll /soft/hadoop/etc/
total 16
drwxr-xr-x. 2 yinzhengjie yinzhengjie 4096 Jun  8 05:36 full
drwxr-xr-x. 2 yinzhengjie yinzhengjie 4096 Jun  8 05:54 ha
lrwxrwxrwx. 1 yinzhengjie yinzhengjie   19 Jun  8 05:54 hadoop -> /soft/hadoop/etc/ha
drwxr-xr-x. 2 yinzhengjie yinzhengjie 4096 May 25 09:15 local
drwxr-xr-x. 2 yinzhengjie yinzhengjie 4096 May 25 20:51 pseudo
[yinzhengjie@s101 ~]$ 

2>.配置s105ssh免密登陆

[yinzhengjie@s101 ~]$ ssh-copy-id yinzhengjie@s105
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
yinzhengjie@s105's password: 

Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'yinzhengjie@s105'"
and check to make sure that only the key(s) you wanted were added.[yinzhengjie@s101 ~]$ who
yinzhengjie pts/0        2018-06-08 05:29 (172.16.30.1)
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ ssh s105
Last login: Fri Jun  8 05:37:20 2018 from 172.16.30.1
[yinzhengjie@s105 ~]$ 
[yinzhengjie@s105 ~]$ who
yinzhengjie pts/0        2018-06-08 05:37 (172.16.30.1)
yinzhengjie pts/1        2018-06-08 05:56 (s101)
[yinzhengjie@s105 ~]$ exit 
logout
Connection to s105 closed.
[yinzhengjie@s101 ~]$ 

3>.编辑core-site.xml配置文件

[yinzhengjie@s101 ~]$ more /soft/hadoop/etc/hadoop/core-site.xml 
<?xml version="1.0" encoding="UTF-8"?>
<configuration><property><name>fs.defaultFS</name><value>hdfs://mycluster</value></property><property><name>hadoop.tmp.dir</name><value>/home/yinzhengjie/ha</value></property><property><name>hadoop.http.staticuser.user</name><value>yinzhengjie</value></property>
</configuration><!--core-site.xml配置文件的作用:用于定义系统级别的参数,如HDFS URL、Hadoop的临时
目录以及用于rack-aware集群中的配置文件的配置等,此中的参
数定义会覆盖core-default.xml文件中的默认配置。fs.defaultFS 参数的作用:#fs.defaultFS 客户端连接HDFS时,默认的路径前缀。如果前面配置了nameservice ID的值是mycluster,那么这里可以配置为授权
信息的一部分hadoop.tmp.dir 参数的作用:#声明hadoop工作目录的地址。hadoop.http.staticuser.user 参数的作用:#在网页界面访问数据使用的用户名。-->
[yinzhengjie@s101 ~]$ 

4>.编辑hdfs-site.xml配置文件

[yinzhengjie@s101 ~]$ more /soft/hadoop/etc/hadoop/hdfs-site.xml 
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration><property><name>dfs.replication</name><value>3</value></property><property><name>dfs.namenode.name.dir</name><value>/home/yinzhengjie/ha/dfs/name1,/home/yinzhengjie/ha/dfs/name2</value></property><property><name>dfs.datanode.data.dir</name><value>/home/yinzhengjie/ha/dfs/data1,/home/yinzhengjie/ha/dfs/data2</value></property><!-- 高可用配置 -->
<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>s101:8020</value>
</property>
<property><name>dfs.namenode.rpc-address.mycluster.nn2</name><value>s105:8020</value>
</property><property><name>dfs.namenode.http-address.mycluster.nn1</name><value>s101:50070</value>
</property>
<property><name>dfs.namenode.http-address.mycluster.nn2</name><value>s105:50070</value>
</property><property><name>dfs.namenode.shared.edits.dir</name><value>qjournal://s102:8485;s103:8485;s104:8485/mycluster</value>
</property><property><name>dfs.client.failover.proxy.provider.mycluster</name><value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property><!--  在容灾发生时,保护活跃的namenode -->
<property><name>dfs.ha.fencing.methods</name><value>sshfence shell(/bin/true)</value>
</property><property><name>dfs.ha.fencing.ssh.private-key-files</name><value>/home/yinzhengjie/.ssh/id_rsa</value>
</property></configuration><!--
hdfs-site.xml 配置文件的作用:#HDFS的相关设定,如文件副本的个数、块大小及是否使用强制权限
等,此中的参数定义会覆盖hdfs-default.xml文件中的默认配置.dfs.replication 参数的作用:#为了数据可用性及冗余的目的,HDFS会在多个节点上保存同一个数据
块的多个副本,其默认为3个。而只有一个节点的伪分布式环境中其仅用
保存一个副本即可,这可以通过dfs.replication属性进行定义。它是一个
软件级备份。dfs.namenode.name.dir 参数的作用:#本地磁盘目录,NN存储fsimage文件的地方。可以是按逗号分隔的目录列表,
fsimage文件会存储在全部目录,冗余安全。这里多个目录设定,最好在多个磁盘,
另外,如果其中一个磁盘故障,不会导致系统故障,会跳过坏磁盘。由于使用了HA,
建议仅设置一个。如果特别在意安全,可以设置2个dfs.datanode.data.dir 参数的作用:#本地磁盘目录,HDFS数据应该存储Block的地方。可以是逗号分隔的目录列表
(典型的,每个目录在不同的磁盘)。这些目录被轮流使用,一个块存储在这个目录,
下一个块存储在下一个目录,依次循环。每个块在同一个机器上仅存储一份。不存在
的目录被忽略。必须创建文件夹,否则被视为不存在。dfs.nameservices 参数的作用:#nameservices列表。逗号分隔。dfs.ha.namenodes.mycluster 参数的作用:#dfs.ha.namenodes.[nameservice ID]   命名空间中所有NameNode的唯一标示名称。
可以配置多个,使用逗号分隔。该名称是可以让DataNode知道每个集群的所有NameNode。
当前,每个集群最多只能配置两个NameNode。dfs.namenode.rpc-address.mycluster.nn1 参数的作用:#dfs.namenode.rpc-address.[nameservice ID].[name node ID]   每个namenode监听的RPC地址。dfs.namenode.http-address.mycluster.nn1 参数的作用:#dfs.namenode.http-address.[nameservice ID].[name node ID]   每个namenode监听的http地址。dfs.namenode.shared.edits.dir  参数的作用:#这是NameNode读写JNs组的uri。通过这个uri,NameNodes可以读写edit log内容。URI的格式"qjournal://host1:port1;host2:port
2;host3:port3/journalId"。这里的host1、host2、host3指的是Journal Node的地址,这里必须是奇数个,至少3个;其中journalId是集群
的唯一标识符,对于多个联邦命名空间,也使用同一个journalId。dfs.client.failover.proxy.provider.mycluster 参数的作用:#这里配置HDFS客户端连接到Active NameNode的一个java类dfs.ha.fencing.methods 参数的作用:#dfs.ha.fencing.methods 配置active namenode出错时的处理类。当active namenode出错时,一般需要关闭该进程。处理方式可以
是ssh也可以是shell。dfs.ha.fencing.ssh.private-key-files 参数的作用:#使用sshfence时,SSH的私钥文件。 使用了sshfence,这个必须指定-->
[yinzhengjie@s101 ~]$ 

5>.分发配置文件

[yinzhengjie@s101 ~]$ more `which xrsync.sh`
#!/bin/bash
#@author :yinzhengjie
#blog:http://www.cnblogs.com/yinzhengjie
#EMAIL:y1053419035@qq.com#判断用户是否传参
if [ $# -lt 1 ];thenecho "请输入参数";exit
fi#获取文件路径
file=$@#获取子路径
filename=`basename $file`#获取父路径
dirpath=`dirname $file`#获取完整路径
cd $dirpath
fullpath=`pwd -P`#同步文件到DataNode
for (( i=102;i<=105;i++ ))
do#使终端变绿色 tput setaf 2echo =========== s$i %file ===========#使终端变回原来的颜色,即白灰色tput setaf 7#远程执行命令rsync -lr $filename `whoami`@s$i:$fullpath#判断命令是否执行成功if [ $? == 0 ];thenecho "命令执行成功"fi
done
[yinzhengjie@s101 ~]$ xrsync.sh /soft/hadoop/etc/
=========== s102 %file ===========
命令执行成功
=========== s103 %file ===========
命令执行成功
=========== s104 %file ===========
命令执行成功
=========== s105 %file ===========
命令执行成功
[yinzhengjie@s101 ~]$ 

 

三.启动HDFS分布式系统

1>.启动journalnode进程

[yinzhengjie@s101 ~]$ hadoop-daemons.sh start journalnode
s104: starting journalnode, logging to /soft/hadoop-2.7.3/logs/hadoop-yinzhengjie-journalnode-s104.out
s103: starting journalnode, logging to /soft/hadoop-2.7.3/logs/hadoop-yinzhengjie-journalnode-s103.out
s102: starting journalnode, logging to /soft/hadoop-2.7.3/logs/hadoop-yinzhengjie-journalnode-s102.out
[yinzhengjie@s101 ~]$ xcall.sh jps
============= s101 jps ============
2855 Jps
命令执行成功
============= s102 jps ============
2568 Jps
2490 JournalNode
命令执行成功
============= s103 jps ============
2617 Jps
2539 JournalNode
命令执行成功
============= s104 jps ============
2611 Jps
2532 JournalNode
命令执行成功
============= s105 jps ============
2798 Jps
命令执行成功
[yinzhengjie@s101 ~]$ more `which xcall.sh`
#!/bin/bash
#@author :yinzhengjie
#blog:http://www.cnblogs.com/yinzhengjie
#EMAIL:y1053419035@qq.com#判断用户是否传参
if [ $# -lt 1 ];thenecho "请输入参数"exit
fi#获取用户输入的命令
cmd=$@for (( i=101;i<=105;i++ ))
do#使终端变绿色 tput setaf 2echo ============= s$i $cmd ============#使终端变回原来的颜色,即白灰色tput setaf 7#远程执行命令ssh s$i $cmd#判断命令是否执行成功if [ $? == 0 ];thenecho "命令执行成功"fi
done
[yinzhengjie@s101 ~]$ 

2>.格式化名称节点

[yinzhengjie@s101 ~]$ hdfs namenode -format
18/06/08 10:39:42 INFO namenode.NameNode: STARTUP_MSG: 
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = s101/172.16.30.101
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 2.7.3
STARTUP_MSG:   classpath = /soft/hadoop-2.7.3/etc/hadoop:/soft/hadoop-2.7.3/share/hadoop/common/lib/jaxb-impl-2.2.3-1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jaxb-api-2.2.2.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/stax-api-1.0-2.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/activation-1.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jackson-core-asl-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jackson-mapper-asl-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jackson-jaxrs-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jackson-xc-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jersey-server-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/asm-3.2.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/log4j-1.2.17.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jets3t-0.9.0.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/httpclient-4.2.5.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/httpcore-4.2.5.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/java-xmlbuilder-0.4.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-lang-2.6.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-configuration-1.6.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-digester-1.8.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-beanutils-1.7.0.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-beanutils-core-1.8.0.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/slf4j-api-1.7.10.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/avro-1.7.4.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/paranamer-2.3.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/snappy-java-1.0.4.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-compress-1.4.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/xz-1.0.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/protobuf-java-2.5.0.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/gson-2.2.4.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/hadoop-auth-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/apacheds-kerberos-codec-2.0.0-M15.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/apacheds-i18n-2.0.0-M15.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/api-asn1-api-1.0.0-M20.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/api-util-1.0.0-M20.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/zookeeper-3.4.6.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/netty-3.6.2.Final.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/curator-framework-2.7.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/curator-client-2.7.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jsch-0.1.42.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/curator-recipes-2.7.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/htrace-core-3.1.0-incubating.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/junit-4.11.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/hamcrest-core-1.3.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/mockito-all-1.8.5.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/hadoop-annotations-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/guava-11.0.2.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jsr305-3.0.0.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-cli-1.2.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-math3-3.1.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/xmlenc-0.52.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-httpclient-3.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-logging-1.1.3.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-codec-1.4.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-io-2.4.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-net-3.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/commons-collections-3.2.2.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/servlet-api-2.5.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jetty-6.1.26.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jetty-util-6.1.26.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jsp-api-2.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jersey-core-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jersey-json-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/common/lib/jettison-1.1.jar:/soft/hadoop-2.7.3/share/hadoop/common/hadoop-common-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/common/hadoop-common-2.7.3-tests.jar:/soft/hadoop-2.7.3/share/hadoop/common/hadoop-nfs-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/commons-codec-1.4.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/log4j-1.2.17.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/commons-logging-1.1.3.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/netty-3.6.2.Final.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/guava-11.0.2.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/jsr305-3.0.0.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/commons-cli-1.2.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/xmlenc-0.52.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/commons-io-2.4.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/servlet-api-2.5.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/jetty-6.1.26.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/jetty-util-6.1.26.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/jersey-core-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/jackson-core-asl-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/jackson-mapper-asl-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/jersey-server-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/asm-3.2.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/commons-lang-2.6.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/protobuf-java-2.5.0.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/htrace-core-3.1.0-incubating.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/commons-daemon-1.0.13.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/netty-all-4.0.23.Final.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/xercesImpl-2.9.1.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/xml-apis-1.3.04.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/lib/leveldbjni-all-1.8.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/hadoop-hdfs-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/hadoop-hdfs-2.7.3-tests.jar:/soft/hadoop-2.7.3/share/hadoop/hdfs/hadoop-hdfs-nfs-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/zookeeper-3.4.6-tests.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/commons-lang-2.6.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/guava-11.0.2.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jsr305-3.0.0.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/commons-logging-1.1.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/protobuf-java-2.5.0.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/commons-cli-1.2.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/log4j-1.2.17.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jaxb-api-2.2.2.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/stax-api-1.0-2.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/activation-1.1.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/commons-compress-1.4.1.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/xz-1.0.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/servlet-api-2.5.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/commons-codec-1.4.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jetty-util-6.1.26.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jersey-core-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jersey-client-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jackson-core-asl-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jackson-mapper-asl-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jackson-jaxrs-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jackson-xc-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/guice-servlet-3.0.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/guice-3.0.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/javax.inject-1.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/aopalliance-1.0.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/commons-io-2.4.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jersey-server-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/asm-3.2.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jersey-json-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jettison-1.1.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jaxb-impl-2.2.3-1.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jersey-guice-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/zookeeper-3.4.6.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/netty-3.6.2.Final.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/leveldbjni-all-1.8.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/commons-collections-3.2.2.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/lib/jetty-6.1.26.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-api-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-common-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-server-common-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-server-nodemanager-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-server-web-proxy-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-server-applicationhistoryservice-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-server-resourcemanager-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-server-tests-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-client-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-server-sharedcachemanager-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-applications-unmanaged-am-launcher-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/yarn/hadoop-yarn-registry-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/protobuf-java-2.5.0.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/avro-1.7.4.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/jackson-core-asl-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/jackson-mapper-asl-1.9.13.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/paranamer-2.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/snappy-java-1.0.4.1.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/commons-compress-1.4.1.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/xz-1.0.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/hadoop-annotations-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/commons-io-2.4.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/jersey-core-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/jersey-server-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/asm-3.2.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/log4j-1.2.17.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/netty-3.6.2.Final.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/leveldbjni-all-1.8.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/guice-3.0.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/javax.inject-1.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/aopalliance-1.0.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/jersey-guice-1.9.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/guice-servlet-3.0.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/junit-4.11.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/lib/hamcrest-core-1.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar:/soft/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.7.3-tests.jar:/contrib/capacity-scheduler/*.jar
STARTUP_MSG:   build = https://git-wip-us.apache.org/repos/asf/hadoop.git -r baa91f7c6bc9cb92be5982de4719c1c8af91ccff; compiled by 'root' on 2016-08-18T01:41Z
STARTUP_MSG:   java = 1.8.0_131
************************************************************/
18/06/08 10:39:42 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
18/06/08 10:39:42 INFO namenode.NameNode: createNameNode [-format]
18/06/08 10:39:43 WARN common.Util: Path /home/yinzhengjie/ha/dfs/name1 should be specified as a URI in configuration files. Please update hdfs configuration.
18/06/08 10:39:43 WARN common.Util: Path /home/yinzhengjie/ha/dfs/name2 should be specified as a URI in configuration files. Please update hdfs configuration.
18/06/08 10:39:43 WARN common.Util: Path /home/yinzhengjie/ha/dfs/name1 should be specified as a URI in configuration files. Please update hdfs configuration.
18/06/08 10:39:43 WARN common.Util: Path /home/yinzhengjie/ha/dfs/name2 should be specified as a URI in configuration files. Please update hdfs configuration.
Formatting using clusterid: CID-d8db65bd-2f38-48df-bd5f-be7b8d9d362c
18/06/08 10:39:43 INFO namenode.FSNamesystem: No KeyProvider found.
18/06/08 10:39:43 INFO namenode.FSNamesystem: fsLock is fair:true
18/06/08 10:39:43 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit=1000
18/06/08 10:39:43 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true
18/06/08 10:39:43 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.000
18/06/08 10:39:43 INFO blockmanagement.BlockManager: The block deletion will start around 2018 Jun 08 10:39:43
18/06/08 10:39:43 INFO util.GSet: Computing capacity for map BlocksMap
18/06/08 10:39:43 INFO util.GSet: VM type       = 64-bit
18/06/08 10:39:43 INFO util.GSet: 2.0% max memory 889 MB = 17.8 MB
18/06/08 10:39:43 INFO util.GSet: capacity      = 2^21 = 2097152 entries
18/06/08 10:39:43 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false
18/06/08 10:39:43 INFO blockmanagement.BlockManager: defaultReplication         = 3
18/06/08 10:39:43 INFO blockmanagement.BlockManager: maxReplication             = 512
18/06/08 10:39:43 INFO blockmanagement.BlockManager: minReplication             = 1
18/06/08 10:39:43 INFO blockmanagement.BlockManager: maxReplicationStreams      = 2
18/06/08 10:39:43 INFO blockmanagement.BlockManager: replicationRecheckInterval = 3000
18/06/08 10:39:43 INFO blockmanagement.BlockManager: encryptDataTransfer        = false
18/06/08 10:39:43 INFO blockmanagement.BlockManager: maxNumBlocksToLog          = 1000
18/06/08 10:39:43 INFO namenode.FSNamesystem: fsOwner             = yinzhengjie (auth:SIMPLE)
18/06/08 10:39:43 INFO namenode.FSNamesystem: supergroup          = supergroup
18/06/08 10:39:43 INFO namenode.FSNamesystem: isPermissionEnabled = true
18/06/08 10:39:43 INFO namenode.FSNamesystem: Determined nameservice ID: mycluster
18/06/08 10:39:43 INFO namenode.FSNamesystem: HA Enabled: true
18/06/08 10:39:43 INFO namenode.FSNamesystem: Append Enabled: true
18/06/08 10:39:43 INFO util.GSet: Computing capacity for map INodeMap
18/06/08 10:39:43 INFO util.GSet: VM type       = 64-bit
18/06/08 10:39:43 INFO util.GSet: 1.0% max memory 889 MB = 8.9 MB
18/06/08 10:39:43 INFO util.GSet: capacity      = 2^20 = 1048576 entries
18/06/08 10:39:43 INFO namenode.FSDirectory: ACLs enabled? false
18/06/08 10:39:43 INFO namenode.FSDirectory: XAttrs enabled? true
18/06/08 10:39:43 INFO namenode.FSDirectory: Maximum size of an xattr: 16384
18/06/08 10:39:43 INFO namenode.NameNode: Caching file names occuring more than 10 times
18/06/08 10:39:43 INFO util.GSet: Computing capacity for map cachedBlocks
18/06/08 10:39:43 INFO util.GSet: VM type       = 64-bit
18/06/08 10:39:43 INFO util.GSet: 0.25% max memory 889 MB = 2.2 MB
18/06/08 10:39:43 INFO util.GSet: capacity      = 2^18 = 262144 entries
18/06/08 10:39:43 INFO namenode.FSNamesystem: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
18/06/08 10:39:43 INFO namenode.FSNamesystem: dfs.namenode.safemode.min.datanodes = 0
18/06/08 10:39:43 INFO namenode.FSNamesystem: dfs.namenode.safemode.extension     = 30000
18/06/08 10:39:43 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.window.num.buckets = 10
18/06/08 10:39:43 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.num.users = 10
18/06/08 10:39:43 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.windows.minutes = 1,5,25
18/06/08 10:39:43 INFO namenode.FSNamesystem: Retry cache on namenode is enabled
18/06/08 10:39:43 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis
18/06/08 10:39:43 INFO util.GSet: Computing capacity for map NameNodeRetryCache
18/06/08 10:39:43 INFO util.GSet: VM type       = 64-bit
18/06/08 10:39:43 INFO util.GSet: 0.029999999329447746% max memory 889 MB = 273.1 KB
18/06/08 10:39:43 INFO util.GSet: capacity      = 2^15 = 32768 entries
18/06/08 10:39:44 INFO namenode.FSImage: Allocated new BlockPoolId: BP-455103259-172.16.30.101-1528479584722
18/06/08 10:39:44 INFO common.Storage: Storage directory /home/yinzhengjie/ha/dfs/name1 has been successfully formatted.
18/06/08 10:39:44 INFO common.Storage: Storage directory /home/yinzhengjie/ha/dfs/name2 has been successfully formatted.
18/06/08 10:39:44 INFO namenode.FSImageFormatProtobuf: Saving image file /home/yinzhengjie/ha/dfs/name1/current/fsimage.ckpt_0000000000000000000 using no compression
18/06/08 10:39:44 INFO namenode.FSImageFormatProtobuf: Saving image file /home/yinzhengjie/ha/dfs/name2/current/fsimage.ckpt_0000000000000000000 using no compression
18/06/08 10:39:44 INFO namenode.FSImageFormatProtobuf: Image file /home/yinzhengjie/ha/dfs/name1/current/fsimage.ckpt_0000000000000000000 of size 358 bytes saved in 0 seconds.
18/06/08 10:39:44 INFO namenode.FSImageFormatProtobuf: Image file /home/yinzhengjie/ha/dfs/name2/current/fsimage.ckpt_0000000000000000000 of size 358 bytes saved in 0 seconds.
18/06/08 10:39:45 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
18/06/08 10:39:45 INFO util.ExitUtil: Exiting with status 0
18/06/08 10:39:45 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at s101/172.16.30.101
************************************************************/
[yinzhengjie@s101 ~]$ echo $?
0
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ hdfs namenode -format

3>.将s101中的工作目录同步到s105

 

[yinzhengjie@s101 ~]$ scp  -r /home/yinzhengjie/ha  yinzhengjie@s105:~
VERSION                                                                                   100%  205     0.2KB/s   00:00    
seen_txid                                                                                 100%    2     0.0KB/s   00:00    
fsimage_0000000000000000000.md5                                                           100%   62     0.1KB/s   00:00    
fsimage_0000000000000000000                                                               100%  358     0.4KB/s   00:00    
VERSION                                                                                   100%  205     0.2KB/s   00:00    
seen_txid                                                                                 100%    2     0.0KB/s   00:00    
fsimage_0000000000000000000.md5                                                           100%   62     0.1KB/s   00:00    
fsimage_0000000000000000000                                                               100%  358     0.4KB/s   00:00    
[yinzhengjie@s101 ~]$ 

4>.启动hdfs进程

[yinzhengjie@s101 ~]$ start-dfs.sh 
Starting namenodes on [s101 s105]
s105: starting namenode, logging to /soft/hadoop-2.7.3/logs/hadoop-yinzhengjie-namenode-s105.out
s101: starting namenode, logging to /soft/hadoop-2.7.3/logs/hadoop-yinzhengjie-namenode-s101.out
s104: starting datanode, logging to /soft/hadoop-2.7.3/logs/hadoop-yinzhengjie-datanode-s104.out
s103: starting datanode, logging to /soft/hadoop-2.7.3/logs/hadoop-yinzhengjie-datanode-s103.out
s102: starting datanode, logging to /soft/hadoop-2.7.3/logs/hadoop-yinzhengjie-datanode-s102.out
Starting journal nodes [s102 s103 s104]
s102: journalnode running as process 2490. Stop it first.
s104: journalnode running as process 2532. Stop it first.
s103: journalnode running as process 2539. Stop it first.
[yinzhengjie@s101 ~]$ xcall.sh jps
============= s101 jps ============
3377 Jps
3117 NameNode
命令执行成功
============= s102 jps ============
2649 DataNode
2490 JournalNode
2764 Jps
命令执行成功
============= s103 jps ============
2539 JournalNode
2700 DataNode
2815 Jps
命令执行成功
============= s104 jps ============
2532 JournalNode
2693 DataNode
2809 Jps
命令执行成功
============= s105 jps ============
3171 NameNode
3254 Jps
命令执行成功
[yinzhengjie@s101 ~]$ 

5>.手动将s101转换成激活状态

[yinzhengjie@s101 ~]$ hdfs haadmin -transitionToActive nn1        //手动将s101转换成激活状态
[yinzhengjie@s101 ~]$ 

  配置到这里基本上高可用就配置好了,但是美中不足的是需要字节手动切换NameNode模式,这就比较麻烦了。索性的是:Hadoop生态圈有专门维护的工具叫做zookeeper工具,我们可以用该工具对集群继续管理就相当方便啦!详情请参考:https://www.cnblogs.com/yinzhengjie/p/9154265.html

转载于:https://www.cnblogs.com/yinzhengjie/p/9070017.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/283179.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

sybase 连接mysql_如何连接到Sybase SQL Anywhere数据库

Sybase SQL Anywhere数据库具有许多非常有用的功能&#xff0c;与竞争对手相比&#xff0c;它具有很高的竞争力。首先&#xff0c;它允许您处理大量数据。其次&#xff0c;它具有很高的生产率&#xff0c;也就是说&#xff0c;可以快速提供大量数据。第三&#xff0c;它需要最少…

【汇编语言】DEBUG的使用

在masm for windows中&#xff0c;需要先生存exe文件&#xff0c;然后再点调试按钮。 常用的命令有&#xff1a; R命令&#xff1a;查看、改变CPU寄存器的内容&#xff1b;如果要修改某个寄存器的内容&#xff0c;可以在r的后面接上空格和寄存器名。如&#xff1a;-r ax&#x…

Leetcode 动态规划 Trapping Rain Water

本文为senlie原创。转载请保留此地址&#xff1a;http://blog.csdn.net/zhengsenlie Trapping Rain Water Total Accepted: 14568 Total Submissions: 50810My SubmissionsGiven n non-negative integers representing an elevation map where the width of each bar is 1, co…

白盒测试用例设计方法

一、白盒测试 根据软件产品的内部工作过程&#xff0c;在计算机上进行测试&#xff0c;以证实每种内部操作是否符合设计规格要求&#xff0c;所有内部成分是否已经过检查。这种测试方法就是白盒测试。白盒测试把测试对象看做一个打开的盒子&#xff0c;允许测试人员利用程序内部…

k8s 读书笔记 - 详解 Pod 调度(Ⅰ卷)

上一篇 《深入掌握 Pod》 文章我们介绍了 Pod 的知识点&#xff0c;接下来我们来继续学习 Pod 在 k8s 中的调度原理。在 k8s 平台上&#xff0c;通常情况下很少直接创建一个 Pod&#xff0c;大多情况下都是通过 Pod 的资源管理对象 来创建&#xff0c;例如&#xff1a;RC/RS、…

.NET MAUI实战 Navigation

1.概要用过WPF的小伙伴一般都用过Prism&#xff0c;Prism里面的导航概念在MAUI中也有类似的概念&#xff0c;在MAUI中是直接集成在框架中我们不需要安装任何其他的nuget包。直接使用Navigation对象即可,通常在移动平台中使用的更多&#xff0c;桌面程序中。我们先来看看微软官方…

python报错 scrolled: false_python 元组tuple - python基础入门(14)

文章首发微信公众号&#xff0c;微信搜索&#xff1a;猿说python在上一篇文章中我们讲解了关于python列表List的相关内容&#xff0c;今天给大家解释一下列表List的兄弟 – 元组&#xff0c;俗称: tuple.元组tuple和列表List类似&#xff0c;元组有如下特点&#xff1a;1.由一个…

开放原子开源峰会 - SmartIDE正式开源并发布v1.0版本丨IDCF

在上周刚刚结束的【2022开放原子全球开源峰会】上 SmartIDE作为正在进行开放原子基金会TOC审核的开源项目&#xff0c;在云原生论坛上向全球的开源开发者介绍了下一代云原生CloudIDE的全新使用体验&#xff0c;并且正式发布了 SmartIDE v1.0 版本。作者&#xff1a;徐磊文章首发…

修改docker的默认存储位置及镜像存储位置

2019独角兽企业重金招聘Python工程师标准>>> 方法一、软链接 默认情况下Docker的存放位置为&#xff1a;/var/lib/docker 可以通过下面命令查看具体位置&#xff1a; sudo docker info | grep "Docker Root Dir" 解决这个问题&#xff0c;最直接的方法当然…

微信小程序第三方服务公司有哪些

虽然微信小程序还没有正式推出&#xff0c;但围绕着微信小程序第三方服务公司之间的战争早已经开始。他们在小程序生成工具&#xff08;一键生成小程序&#xff0c;无需开发&#xff09;、微信小程序开发工具、小程序数据统计等领域展开激烈竞争&#xff0c;我们一起来看看微信…

Blazor University (49)依赖注入 —— 比较依赖范围

原文链接&#xff1a;https://blazor-university.com/dependency-injection/dependency-lifetimes-and-scopes/comparing-dependency-scopes/比较依赖范围源代码[1]在本节中&#xff0c;我们将创建一个 Blazor 应用程序来演示各种依赖注入作用域的不同生命周期。为此&#xff0…

设计模式概论

此文转载于 http://blog.csdn.net/hguisu/article/details/74968191. 设计模式设计模式&#xff08;Design pattern&#xff09;是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结。使用设计模式是为了可重用代码、让代码更容易被他人理解、保证代码可靠性…

只需要2个工具,百度云盘大文件就能用迅雷和IDM下载

不会代码&#xff0c;不懂脚本&#xff0c;没关系 &#xff0c;能找到一座通往它们的桥梁&#xff0c;照样能到达彼岸。 这里以360极速浏览器为例。 在浏览器地址框输入以下地址直接到达浏览器安装扩展插件的地方&#xff08;偷个懒&#xff0c;复制网址吧&#xff09;&#xf…

rsync服务器的配置

一、rsync 简介Rsync&#xff08;remote synchronize&#xff09;是一个远程数据同步工具&#xff0c;可通过LAN/WAN快速同步多台主机间的文件&#xff0c;也可以使用 Rsync 同步本地硬盘中的不同目录。 Rsync 是用于取代rcp的一个工具&#xff0c;Rsync使用所谓的 “Rsync 算法…

Vue学习笔记入门篇——数据及DOM

本文为转载&#xff0c;原文&#xff1a;Vue学习笔记入门篇——数据及DOM 数据 data 类型 Object | Function 详细 Vue 实例的数据对象。Vue 将会递归将 data 的属性转换为 getter/setter&#xff0c;从而让 data 的属性能够响应数据变化。对象必须是纯粹的对象(含有零个或多个…

BZOJ 3144 [Hnoi2013]切糕

3144: [Hnoi2013]切糕 Description Input 第一行是三个正整数P,Q,R&#xff0c;表示切糕的长P、 宽Q、高R。第二行有一个非负整数D&#xff0c;表示光滑性要求。接下来是R个P行Q列的矩阵&#xff0c;第z个 矩阵的第x行第y列是v(x,y,z) (1≤x≤P, 1≤y≤Q, 1≤z≤R)。 100%的数据…

《ASP.NET Core 6框架揭秘》实例演示[18]:HttpClient处理管道

在《《ASP.NET Core 6框架揭秘》实例演示[17]&#xff1a;利用IHttpClientFactory工厂来创建HttpClient》之后&#xff0c;我们将关注点放到HttpClient对象上。我们知道ASP.NET的核心就是由中间件组成的请求处理管道&#xff0c;HttpClient也采用了类似的设计。HttpClient管道由…

雅诗兰黛天猫超级品牌日:未央唇膏、红装小棕瓶“当红不让”

随着年末圣诞季的临近&#xff0c;各大美妆品牌陆续推出了圣诞套装&#xff0c;红红火火的超豪华套装&#xff0c;算是对用户最实在的回馈。高端美妆品牌的“领头羊”雅诗兰黛&#xff0c;当然也“当红不让”&#xff0c;趁着圣诞季&#xff0c;与天猫超级品牌日联手打造了一场…

JAVA常见算法题(三十一)---冒泡排序

package com.jege.spring.boot.hello.world;/*** java算法之冒泡排序<br>* 将数组按照从大到小的顺序排列<br>* * * author Administrator**/ public class BubbleSort{public static void main(String[] args){int score[] {67, 69, 75, 87, 89, 90, 99, 100};fo…

WPF实现物理效果 拉一个小球

原文:WPF实现物理效果 拉一个小球一直以来都对物理效果有神秘感,完全不知道怎么实现的.直到看到了周银辉在老早前写的一篇博客:http://www.cnblogs.com/zhouyinhui/archive/2007/06/23/793724.html 终于知道是怎么实现的了. CompositionTarget类的Rendering事件.在每一帧成功渲…