Table of Contents
1. 启动ZooKeeper
2. 修改Hadoop配置
3. 启动NameNode HA
参考
Home Database Mysql Tutorial NameNode HA配置详解

NameNode HA配置详解

Jun 07, 2016 pm 04:39 PM
hdfs Detailed explanation Configuration cluster

HDFS 集群中NameNode 存在单点故障(SPOF )。对于只有一个NameNode 的集群,如果NameNode 机器出现意外downtime,那么整个集群将无法使用,直到NameNode 重新启动。HDFS 的HA 功能通过配置Active/Standby 两个NameNodes 实现在集群中对NameNode 的热备来解

HDFS 集群中NameNode 存在单点故障(SPOF )。对于只有一个NameNode 的集群,如果NameNode 机器出现意外downtime,那么整个集群将无法使用,直到NameNode 重新启动。HDFS 的HA 功能通过配置Active/Standby 两个NameNodes 实现在集群中对NameNode 的热备来解决上述问题。如果出现Active NN的downtime,就会切换到Standby使得NN服务不间断。HDFS HA依赖zookeeper,下面是测试的过程。

环境如下
主机:debugo0[1-3],CentOS 6.5
Hadoop 2.4.1
ZooKeeper 3.4.6

HDFS ZooKeeper
debugo01 NN,ZKFC,JournalNode,DN Server
debugo02 NN,ZKFC,JournalNode,DN Server
debugo03 NN,JournalNode,DN Server

1. 启动ZooKeeper

编辑zookeeper配置文件

$ mkdir -p /home/hadoop/zooKeeper /home/hadoop/log/zoolog
$ cd $ZOOKEEPER_HOME/conf
$ cp zoo_sample.cnf zoo.cnf
$ vim zoo.cnf
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/home/hadoop/zookeeper
dataLogDir=/home/hadoop/log/zoolog
clientPort=2181
Copy after login

将配置文件拷贝到另外两个节点,分别建立myid并启动zookeeper

$ echo  "1" > /home/hadoop/zookeeper/myid
$ zkServer start
...
$ zkServer status
zkServer.sh status
JMX enabled by default
Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Mode: leader
Copy after login

2. 修改Hadoop配置

core-site中需要使用ha.zookeeper.quorum设置ZooKeeper服务器节点。另外fs.defaultFS需要设置成HDFS的逻辑服务名(需与hdfs-site.xml中的dfs.nameservices一致)。

$ core-site.xml
  fs.defaultFS
  hdfs://myhdfs
        hadoop.tmp.dir
        /home/hadoop/tmp
        hadoop.logfile.size
        104857600
        hadoop.logfile.count
        10
        io.file.buffer.size
        131072
        ha.zookeeper.quorum
        debugo01,debugo02,debugo03
Copy after login

hdfs-site.xml中需要添加的设置较多:
dfs.nameservices —– HDFS NN的逻辑名称,使用上面设置的myhdfs
dfs.ha.namenodes.myhdfs —– 给定服务逻辑名称myhdfs的节点列表
dfs.namenode.rpc-address.myhdfs.nn1 —– myhdfs中nn1节点对外服务的RPC地址
dfs.namenode.http-address.myhdfs.nn1 —– myhdfs中nn1节点对外服务的http地址
dfs.namenode.shared.edits.dir —– 设置一组 journalNode 的 URI 地址,active NN 将 edit log 写入这些JournalNode,而 standby NameNode 读取这些 edit log,并作用在内存中的目录树中。如果journalNode有多个节点则使用分号分割。该属性值应符合以下格式qjournal://host1:port1;host2:port2;host3:port3/journalId
dfs.journalnode.edits.dir —– JournalNode 所在节点上的一个目录,用于存放 editlog 和其他状态信息。
dfs.ha.automatic-failover.enabled —– 启动自动failover。自动failover依赖于zookeeper集群和ZKFailoverController(ZKFC),后者是一个zookeeper客户端,用来监控NN的状态信息。每个运行NN的节点必须要运行一个zkfc。zkfs提供了下面的功能:
Health monitoring zkfc定期对本地的NN发起health-check的命令,如果NN正确返回,那么这个NN被认为是OK的。否则被认为是失效节点。
ZooKeeper session management 当本地NN是健康的时候,zkfc将会在zk中持有一个session。如果本地NN又正好是active的,那么zkfc还有持有一个”ephemeral”的节点作为锁,一旦本 地NN失效了,那么这个节点将会被自动删除。
ZooKeeper-based election 如果本地NN是健康的,并且zkfc发现没有其他的NN持有那个独占锁。那么他将试图去获取该锁,一旦成功,那么它就需要执行Failover,然后成为active的NN节点。Failover的过程是:第一步,对之前的NN执行fence,如果需要的话。第二步,将本地NN转换到active状态。
启动zkfc的方法如下:hadoop-daemon.sh start zkfc。通过start-dfs.sh会自动启动该进程,一般无需手动起停。
dfs.client.failover.proxy.provider.myhadoop —– 客户端与 active NameNode 进行交互的 Java 实现类,DFS 客户端通过该类寻找当前的active NN。
dfs.ha.fencing.methods —– 解决HA集群脑裂问题(即出现两个 master 同时对外提供服务,导致系统处于不一致状态)。在 HDFS HA中,JournalNode 只允许一个 NameNode 写数据,不会出现两个 active NameNode 的问题,
但是,当主备切换时,之前的 active NameNode 可能仍在处理客户端的 RPC 请求,为此,需要增加隔离机制(fencing)将之前的 active NameNode 杀死。常用的fence方法是sshfence,要指定ssh通讯使用的密钥dfs.ha.fencing.ssh.private-key-files和连接超时时间。

$ hdfs-site.xml
  dfs.nameservices
  myhdfs
  dfs.ha.namenodes.myhdfs
  nn1,nn2
  dfs.namenode.rpc-address.myhdfs.nn1
  debugo01:8020
  dfs.namenode.rpc-address.myhdfs.nn2
  debugo02:8020
  dfs.namenode.http-address.myhdfs.nn1
  debugo01:50070
  dfs.namenode.http-address.myhdfs.nn2
  debugo02:50070
  dfs.namenode.shared.edits.dir
  qjournal://debugo01:8485;debugo02:8485;debugo03:8485/hadoop-journal
  dfs.ha.automatic-failover.enabled
  true
  dfs.journalnode.edits.dir
  /home/hadoop/journal
  dfs.client.failover.proxy.provider.myhadoop                        
  org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider
  dfs.ha.fencing.methods      
  sshfence  
  how to communicate in the switch process
  dfs.ha.fencing.ssh.private-key-files      
  /home/hadoop/.ssh/id_rsa
  the location stored ssh key
  dfs.ha.fencing.ssh.connect-timeout  
  5000  
  dfs.datanode.data.dir
  /home/hadoop/data
  dfs.namenode.name.dir
  /home/hadoop/namenode
  dfs.namenode.handler.count  
  8  
	dfs.replication
	2
Copy after login

3. 启动NameNode HA

初始化zkfc

mkdir /home/hadoop/journal /home/hadoop/data /home/hadoop/namenode
hdfs zkfc -formatZK
14/09/13 21:17:03 INFO zookeeper.ClientCnxn: Opening socket connection to server debugo02/192.168.46.202:2181. Will not attempt to authenticate using SASL (unknown error)
14/09/13 21:17:03 INFO zookeeper.ClientCnxn: Socket connection established to debugo02/192.168.46.202:2181, initiating session
14/09/13 21:17:03 INFO zookeeper.ClientCnxn: Session establishment complete on server debugo02/192.168.46.202:2181, sessionid = 0x2487208163e0000, negotiated timeout = 5000
14/09/13 21:17:03 INFO ha.ActiveStandbyElector: Successfully created /hadoop-ha/myhdfs in ZK.
Copy after login

第一次启动格式化HDFS。 格式化HDFS的过程中,HA会journalnode通讯,所以需要先把三个节点的journalnode启动。
hdfs journalnode
hdfs namenode -format
通过start-dfs.sh 直接启动所有服务

$ start-dfs.sh 
Starting namenodes on [debugo01 debugo02]
debugo01: starting namenode, logging to /opt/hadoop/logs/hadoop-hadoop-namenode-debugo01.out
debugo02: starting namenode, logging to /opt/hadoop/logs/hadoop-hadoop-namenode-debugo02.out
debugo01: starting datanode, logging to /opt/hadoop/logs/hadoop-hadoop-datanode-debugo01.out
debugo02: starting datanode, logging to /opt/hadoop/logs/hadoop-hadoop-datanode-debugo02.out
debugo03: starting datanode, logging to /opt/hadoop/logs/hadoop-hadoop-datanode-debugo03.out
Starting journal nodes [debugo01 debugo02 debugo03]
debugo01: starting journalnode, logging to /opt/hadoop/logs/hadoop-hadoop-journalnode-debugo01.out
debugo03: starting journalnode, logging to /opt/hadoop/logs/hadoop-hadoop-journalnode-debugo03.out
debugo02: starting journalnode, logging to /opt/hadoop/logs/hadoop-hadoop-journalnode-debugo02.out
Starting ZK Failover Controllers on NN hosts [debugo01 debugo02]
debugo01: starting zkfc, logging to /opt/hadoop/logs/hadoop-hadoop-zkfc-debugo01.out
debugo02: starting zkfc, logging to /opt/hadoop/logs/hadoop-hadoop-zkfc-debugo02.out
$ jps
11562 Jps
11031 NameNode
11494 DFSZKFailoverController
11324 JournalNode
11136 DataNode
7657 QuorumPeerMain
Copy after login

使用浏览器访问debugo01:50070会看到该节点已经成为active
1
先启动的namenode会成为active,在standby的日志中可以看到定期replication

2014-09-13 21:25:46,132 INFO org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: Starting CacheReplication
Monitor with interval 30000 milliseconds
2014-09-13 21:25:46,132 INFO org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: Rescanning because of pen
ding operations
2014-09-13 21:25:46,132 INFO org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: Scanned 0 directive(s) an
d 0 block(s) in 1 millisecond(s).
....
Copy after login

下面需要同步一次元数据:

$ hdfs namenode -bootstrapStandby
......
About to bootstrap Standby ID nn1 from:
           Nameservice ID: myhdfs
        Other Namenode ID: nn2
  Other NN's HTTP address: http://debugo02:50070
  Other NN's IPC  address: debugo02/192.168.46.202:8020
             Namespace ID: 863538584
            Block pool ID: BP-351445905-192.168.46.202-1410670136650
               Cluster ID: CID-c98eb846-66b5-4663-9a35-a091eb1718d1
           Layout version: -56
=====================================================
Re-format filesystem in Storage Directory /home/hadoop/namenode ? (Y or N) Y
Copy after login

这时候访问
2
然后kill掉debugo01上的active NN进程,standby NN会成为active。

注意:手动切换时,会提示下面警告。所以一般在启动zkfc的情况下也无需进行切换。

$ hdfs haadmin -transitionToActive nn1
Automatic failover is enabled for NameNode at debugo01/192.168.46.201:8020. Refusing to manually manage HA state, since it may cause a split-brain scenario or other incorrect state.
If you are very sure you know what you are doing, please  specify the forcemanual flag.
Copy after login

参考

http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-High-Availability-Guide/cdh4hag_topic_2_3.html

http://blog.csdn.net/u010967382/article/details/30976935

http://blog.csdn.net/chenpingbupt/article/details/7922089

HDFS 集群中NameNode 存在单点故障(SPOF )。对于只有一个NameNode 的集群,如果NameNode 机器出现意外downtime,那么整个集群将无法使用,直到NameNode 重新启动。HDFS 的HA 功能通过配置Active/Standby 两个NameNodes 实现在集群中对NameNode 的热备来解决上述问题。如果出现Active NN的downtime,就会切换到Standby使得NN服务不间断。HDFS HA依赖zookeeper,下面是测试的过程。

环境如下
主机:debugo0[1-3],CentOS 6.5
Hadoop 2.4.1
ZooKeeper 3.4.6

1. 启动ZooKeeper
$ mkdir -p /home/hadoop/zooKeeper /home/hadoop/log/zoolog
$ cd $ZOOKEEPER_HOME/conf
$ cp zoo_sample.cnf zoo.cnf
$ vim zoo.cnf
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/home/hadoop/zookeeper
dataLogDir=/home/hadoop/log/zoolog
clientPort=2181
将配置文件拷贝到另外两个节点,分别建立myid并启动zookeeper
$ echo “1” > /home/hadoop/zookeeper/myid
$ zkServer start

$ zkServer status
zkServer.sh status
JMX enabled by default
Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Mode: leader

2. 修改Hadoop配置
core-site中需要使用ha.zookeeper.quorum设置ZooKeeper服务器节点。另外fs.defaultFS需要设置成HDFS的逻辑服务名(需与hdfs-site.xml中的dfs.nameservices一致)。
$ core-site.xml

fs.defaultFS
hdfs://myhdfs
hadoop.tmp.dir
/home/hadoop/tmp
hadoop.logfile.size
104857600
hadoop.logfile.count
10
io.file.buffer.size
131072
ha.zookeeper.quorum
debugo01,debugo02,debugo03

hdfs-site.xml中需要添加的设置较多:
dfs.nameservices —– HDFS NN的逻辑名称,使用上面设置的myhdfs
dfs.ha.namenodes.myhdfs —– 给定服务逻辑名称myhdfs的节点列表
dfs.namenode.rpc-address.myhdfs.nn1 —– myhdfs中nn1节点对外服务的RPC地址
dfs.namenode.http-address.myhdfs.nn1 —– myhdfs中nn1节点对外服务的http地址
dfs.namenode.shared.edits.dir —– 设置一组 journalNode 的 URI 地址,active NN 将 edit log 写入这些JournalNode,而 standby NameNode 读取这些 edit log,并作用在内存中的目录树中。如果journalNode有多个节点则使用分号分割。该属性值应符合以下格式qjournal://host1:port1;host2:port2;host3:port3/journalId
dfs.journalnode.edits.dir —– JournalNode 所在节点上的一个目录,用于存放 editlog 和其他状态信息。
dfs.ha.automatic-failover.enabled —– 启动自动failover。自动failover依赖于zookeeper集群和ZKFailoverController(ZKFC),后者是一个zookeeper客户端,用来监控NN的状态信息。每个运行NN的节点必须要运行一个zkfc。zkfs提供了下面的功能:

Health monitoring
zkfc定期对本地的NN发起health-check的命令,如果NN正确返回,那么这个NN被认为是OK的。否则被认为是失效节点。
ZooKeeper session management
当本地NN是健康的时候,zkfc将会在zk中持有一个session。如果本地NN又正好是active的,那么zkfc还有持有一个”ephemeral”的节点作为锁,一旦本 地NN失效了,那么这个节点将会被自动删除。
ZooKeeper-based election
如果本地NN是健康的,并且zkfc发现没有其他的NN持有那个独占锁。那么他将试图去获取该锁,一旦成功,那么它就需要执行Failover,然后成为active的NN节点。Failover的过程是:第一步,对之前的NN执行fence,如果需要的话。第二步,将本地NN转换到active状态。
启动zkfc的方法如下:hadoop-daemon.sh start zkfc。通过start-dfs.sh会自动启动该进程,一般无需手动起停。
dfs.client.failover.proxy.provider.myhadoop —– 客户端与 active NameNode 进行交互的 Java 实现类,DFS 客户端通过该类寻找当前的active NN。
dfs.ha.fencing.methods —– 解决HA集群脑裂问题(即出现两个 master 同时对外提供服务,导致系统处于不一致状态)。在 HDFS HA中,JournalNode 只允许一个 NameNode 写数据,不会出现两个 active NameNode 的问题,
但是,当主备切换时,之前的 active NameNode 可能仍在处理客户端的 RPC 请求,为此,需要增加隔离机制(fencing)将之前的 active NameNode 杀死。常用的fence方法是sshfence,要指定ssh通讯使用的密钥dfs.ha.fencing.ssh.private-key-files和连接超时时间。
$ hdfs-site.xml

dfs.nameservices
myhdfs
dfs.ha.namenodes.myhdfs
nn1,nn2
dfs.namenode.rpc-address.myhdfs.nn1
debugo01:8020
dfs.namenode.rpc-address.myhdfs.nn2
debugo02:8020
dfs.namenode.http-address.myhdfs.nn1
debugo01:50070
dfs.namenode.http-address.myhdfs.nn2
debugo02:50070
dfs.namenode.shared.edits.dir
qjournal://debugo01:8485;debugo02:8485;debugo03:8485/hadoop-journal
dfs.ha.automatic-failover.enabled
true
dfs.journalnode.edits.dir
/home/hadoop/journal
dfs.client.failover.proxy.provider.myhadoop
org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider
dfs.ha.fencing.methods
sshfence
how to communicate in the switch process
dfs.ha.fencing.ssh.private-key-files
/home/hadoop/.ssh/id_rsa
the location stored ssh key
dfs.ha.fencing.ssh.connect-timeout
5000
dfs.datanode.data.dir
/home/hadoop/data
dfs.namenode.name.dir
/home/hadoop/namenode
dfs.namenode.handler.count
8
dfs.replication
2

mkdir /home/hadoop/journal /home/hadoop/data /home/hadoop/namenode

hdfs zkfc -formatZK
14/09/13 21:17:03 INFO zookeeper.ClientCnxn: Opening socket connection to server debugo02/192.168.46.202:2181. Will not attempt to authenticate using SASL (unknown error)
14/09/13 21:17:03 INFO zookeeper.ClientCnxn: Socket connection established to debugo02/192.168.46.202:2181, initiating session
14/09/13 21:17:03 INFO zookeeper.ClientCnxn: Session establishment complete on server debugo02/192.168.46.202:2181, sessionid = 0x2487208163e0000, negotiated timeout = 5000
14/09/13 21:17:03 INFO ha.ActiveStandbyElector: Successfully created /hadoop-ha/myhdfs in ZK.

第一次启动格式化HDFS。 格式化HDFS的过程中,HA会journalnode通讯,所以需要先把三个节点的journalnode启动。
hdfs journalnode
hdfs namenode -format
通过start-dfs.sh 直接启动所有服务
$ start-dfs.sh
Starting namenodes on [debugo01 debugo02]
debugo01: starting namenode, logging to /opt/hadoop/logs/hadoop-hadoop-namenode-debugo01.out
debugo02: starting namenode, logging to /opt/hadoop/logs/hadoop-hadoop-namenode-debugo02.out
debugo01: starting datanode, logging to /opt/hadoop/logs/hadoop-hadoop-datanode-debugo01.out
debugo02: starting datanode, logging to /opt/hadoop/logs/hadoop-hadoop-datanode-debugo02.out
debugo03: starting datanode, logging to /opt/hadoop/logs/hadoop-hadoop-datanode-debugo03.out
Starting journal nodes [debugo01 debugo02 debugo03]
debugo01: starting journalnode, logging to /opt/hadoop/logs/hadoop-hadoop-journalnode-debugo01.out
debugo03: starting journalnode, logging to /opt/hadoop/logs/hadoop-hadoop-journalnode-debugo03.out
debugo02: starting journalnode, logging to /opt/hadoop/logs/hadoop-hadoop-journalnode-debugo02.out
Starting ZK Failover Controllers on NN hosts [debugo01 debugo02]
debugo01: starting zkfc, logging to /opt/hadoop/logs/hadoop-hadoop-zkfc-debugo01.out
debugo02: starting zkfc, logging to /opt/hadoop/logs/hadoop-hadoop-zkfc-debugo02.out
$ jps
11562 Jps
11031 NameNode
11494 DFSZKFailoverController
11324 JournalNode
11136 DataNode
7657 QuorumPeerMain
使用浏览器访问debugo01:50070会看到该节点已经成为active

先启动的namenode会成为active,在standby的日志中可以看到定期replication
2014-09-13 21:25:46,132 INFO org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: Starting CacheReplication
Monitor with interval 30000 milliseconds
2014-09-13 21:25:46,132 INFO org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: Rescanning because of pen
ding operations
2014-09-13 21:25:46,132 INFO org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: Scanned 0 directive(s) an
d 0 block(s) in 1 millisecond(s).
….

下面需要同步一次元数据:
hdfs namenode -bootstrapStandby
……
About to bootstrap Standby ID nn1 from:
Nameservice ID: myhdfs
Other Namenode ID: nn2
Other NN’s HTTP address: http://debugo02:50070
Other NN’s IPC address: debugo02/192.168.46.202:8020
Namespace ID: 863538584
Block pool ID: BP-351445905-192.168.46.202-1410670136650
Cluster ID: CID-c98eb846-66b5-4663-9a35-a091eb1718d1
Layout version: -56
=====================================================
Re-format filesystem in Storage Directory /home/hadoop/namenode ? (Y or N) Y
这时候访问

然后kill掉debugo01上的active NN进程,standby NN会成为active。

注意:手动切换时,会提示下面警告。所以一般在启动zkfc的情况下也无需进行切换。
hdfs haadmin -transitionToActive nn1
Automatic failover is enabled for NameNode at debugo01/192.168.46.201:8020. Refusing to manually manage HA state, since it may cause a split-brain scenario or other incorrect state.
If you are very sure you know what you are doing, please specify the forcemanual flag.

参考

http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-High-Availability-Guide/cdh4hag_topic_2_3.html

http://blog.csdn.net/u010967382/article/details/30976935

http://blog.csdn.net/chenpingbupt/article/details/7922089

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)

The working principle and configuration method of GDM in Linux system The working principle and configuration method of GDM in Linux system Mar 01, 2024 pm 06:36 PM

Title: The working principle and configuration method of GDM in Linux systems In Linux operating systems, GDM (GNOMEDisplayManager) is a common display manager used to control graphical user interface (GUI) login and user session management. This article will introduce the working principle and configuration method of GDM, as well as provide specific code examples. 1. Working principle of GDM GDM is the display manager in the GNOME desktop environment. It is responsible for starting the X server and providing the login interface. The user enters

Detailed explanation of obtaining administrator rights in Win11 Detailed explanation of obtaining administrator rights in Win11 Mar 08, 2024 pm 03:06 PM

Windows operating system is one of the most popular operating systems in the world, and its new version Win11 has attracted much attention. In the Win11 system, obtaining administrator rights is an important operation. Administrator rights allow users to perform more operations and settings on the system. This article will introduce in detail how to obtain administrator permissions in Win11 system and how to effectively manage permissions. In the Win11 system, administrator rights are divided into two types: local administrator and domain administrator. A local administrator has full administrative rights to the local computer

Understand Linux Bashrc: functions, configuration and usage Understand Linux Bashrc: functions, configuration and usage Mar 20, 2024 pm 03:30 PM

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

Detailed explanation of division operation in Oracle SQL Detailed explanation of division operation in Oracle SQL Mar 10, 2024 am 09:51 AM

Detailed explanation of division operation in OracleSQL In OracleSQL, division operation is a common and important mathematical operation, used to calculate the result of dividing two numbers. Division is often used in database queries, so understanding the division operation and its usage in OracleSQL is one of the essential skills for database developers. This article will discuss the relevant knowledge of division operations in OracleSQL in detail and provide specific code examples for readers' reference. 1. Division operation in OracleSQL

How to configure and install FTPS in Linux system How to configure and install FTPS in Linux system Mar 20, 2024 pm 02:03 PM

Title: How to configure and install FTPS in Linux system, specific code examples are required. In Linux system, FTPS is a secure file transfer protocol. Compared with FTP, FTPS encrypts the transmitted data through TLS/SSL protocol, which improves Security of data transmission. In this article, we will introduce how to configure and install FTPS in a Linux system and provide specific code examples. Step 1: Install vsftpd Open the terminal and enter the following command to install vsftpd: sudo

Detailed explanation of the role and usage of PHP modulo operator Detailed explanation of the role and usage of PHP modulo operator Mar 19, 2024 pm 04:33 PM

The modulo operator (%) in PHP is used to obtain the remainder of the division of two numbers. In this article, we will discuss the role and usage of the modulo operator in detail, and provide specific code examples to help readers better understand. 1. The role of the modulo operator In mathematics, when we divide an integer by another integer, we get a quotient and a remainder. For example, when we divide 10 by 3, the quotient is 3 and the remainder is 1. The modulo operator is used to obtain this remainder. 2. Usage of the modulo operator In PHP, use the % symbol to represent the modulus

MyBatis Generator configuration parameter interpretation and best practices MyBatis Generator configuration parameter interpretation and best practices Feb 23, 2024 am 09:51 AM

MyBatisGenerator is a code generation tool officially provided by MyBatis, which can help developers quickly generate JavaBeans, Mapper interfaces and XML mapping files that conform to the database table structure. In the process of using MyBatisGenerator for code generation, the setting of configuration parameters is crucial. This article will start from the perspective of configuration parameters and deeply explore the functions of MyBatisGenerator.

Where can I check the configuration of my win11 computer? How to find the configuration information of win11 computer Where can I check the configuration of my win11 computer? How to find the configuration information of win11 computer Mar 06, 2024 am 10:10 AM

When we use win11 system, we sometimes need to check the configuration of our computer, but many users are also asking where to check the configuration of win11 computer? In fact, the method is very simple. Users can directly open the system information under settings, and then view the computer configuration information. Let this site carefully introduce to users how to find win11 computer configuration information. How to find win11 computer configuration information. Method 1: 1. Click Start and open Computer Settings. 3. You can view computer configuration information on this page. 2. In the command prompt window, enter systeminfo and press Enter to view the computer configuration.

See all articles