In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to understand Oracle's "HA" and "LB" and how to test Load Balancer with scripts. The content is concise and easy to understand. It will definitely make your eyes shine. I hope you can learn something from the detailed introduction of this article.
overview
Today, we mainly introduce the concept of "HA" and "LB" of ORACLE RAC, and share a script to test whether RAC has an average load of two nodes.
1. Related concepts
HA:High Availability LB:Load balance Load Balancer distributes the Load Balancer to each node in the cluster to provide overall throughput.
Availability is the ratio of time a system is available.
Mean Time Between Failures (MTTF) and Mean Time To Repair (MTTR) are commonly used to evaluate available metrics.
Formula:
Availability =MTTF/(MTTF+MTTR)
If a server runs continuously for 6 months and fails once, and the repair takes 20 minutes, the availability is:
6 months/(6 months +20 minutes)*100=99.92%
2、Rac(Real application cluster)
2.1, Failover
Rac's high availability technology is based on Failover, which means that the failure of any node in the cluster will not affect the user's use, and the failure of a single node can be resolved to the greatest extent. The user who receives the failed node will be automatically transferred to the healthy node, and the user will not be aware of this failover.
2.2、SCAN(single client access name)
SCAN-VIP is a very important feature introduced by oracle 11gR2. It can realize the connection of Load Balancer to database instance. Scan provides a unified name to access the cluster. It does not need to configure multiple vip addresses on each client accessing the database to realize Load Balancer like 10g.
Load Balancer for all nodes can be achieved without any configuration modifications to the client when adding and deleting nodes.
PS: SCAN can only achieve Load Balancer, automatic Fail, need to use service service.
3. Monitoring and TAF
3.1 monitoring
Local listening: Public IP and VIPSCAN listening: SCAN VIP
3.2 TAF(Transparent Application Faiover) Transparent application failover
Most applications (such as Tomcat) make several long connections to the database at startup and reuse these links throughout the application tuning lifecycle. Uncommitted transactions roll back.
After the link is established, if an instance fails during the operation of the application system, the users linked to this instance will be automatically migrated to other healthy instances.
JDBC does not support TAF.
Divided into:
client-side TAF (10g used more) server-sid TAF (11g used more)
4. Test TAF of server
Connect using TAF service name/scan_ip
See which instance is currently connected (e.g. rtbrac1)
query select instance_name from v$instance
direct shutdown -h now rtbrac1 server
sqlplus does not need to execute exit, execute select instance_name from v$instance again, if there is a return later, it means that failover can be automatically performed.
See which node the current scanip is on (should drift to healthy node)
5. Script Test TAF Server Load Balancer
1. Shell Execution Script (taf_load.sh)
#!/ bin/sh count=0 while [ $count -lt $1 ] do count=`expr $count + 1` sqlplus -s glogowner/Q5$gEGy4@172.16.10.30:1521/otmdb @/home/oracle/scripts/test.sql done
2. SQL Execution Script (test.sql)
col instance_name format a20 select instance_name from v$instance / exit;
3. Execute taf_load.sh(./ taf_load.sh 1000 >> taf_load.log)
View log comparing the connection loads of the two strengths
[oracle@RFDB1 scripts]$ ./ taf_load.sh 1000 >> taf_load.log [oracle@RFDB1 scripts]$ cat taf_load.log |grep "RFDB1" |wc -l 634 [oracle@RFDB1 scripts]$ cat taf_load.log |grep "RFDB2" |wc -l366 The above is how to understand Oracle's "HA" and "LB" and how to test Load Balancer with scripts. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.