¼­¹ö°£ ÀÎÅͳΠµð½ºÅ© ¾ÅÅ© ¹®ÀÇ µå¸³´Ï´Ù.

   Á¶È¸ 3223   Ãßõ 0    

 NAS나 SAN 없이

2대의 리눅스 서버에 인터널 디스크를 레이드로 묶어서 큐브리드 DB를 올렸습니다.

2대를 액티브-스탭바이로 묶어놓고 있는데

두서버간 DB를 싱크 할 수 있는지요 






ªÀº±Û Àϼö·Ï ½ÅÁßÇÏ°Ô.
³× ÇÒ ¼ö ÀÖ½À´Ï´Ù...

Âü°íÇϼ¼¿ä..
¾ÈÀü¸µÅ©
https://www.cubrid.org/manual/en/10.0/ha.html
¾ÆÁÖ ¸ÚÁø ±â¼úÀ̳׿ä..
<±¸±Û ¹ø¿ª>


CUBRID HA
HA (°í °¡¿ë¼º)´Â Çϵå¿þ¾î, ¼ÒÇÁÆ®¿þ¾î ¶Ç´Â ³×Æ®¿öÅ© Àå¾Ö½Ã Áߴܾø´Â ¼­ºñ½º¸¦ Á¦°øÇÏ´Â ±â´ÉÀ» ¸»ÇÕ´Ï´Ù. ÀÌ ±â´ÉÀº ¼­ºñ½º¸¦ 24 ½Ã°£ Á¦°øÇؾßÇÏ´Â ³×Æ®¿öÅ© ÄÄÇ»Æà ¿µ¿ª¿¡¼­ Áß¿äÇÑ ¿ä¼ÒÀÔ´Ï´Ù. HA ½Ã½ºÅÛÀº µÑ ÀÌ»óÀÇ ¼­¹ö ½Ã½ºÅÛÀ¸·Î ±¸¼ºµÇ¸ç °¢ ½Ã½ºÅÛÀº Àå¾Ö°¡ ¹ß»ýÇÏ´õ¶óµµ Áߴܾø´Â ¼­ºñ½º¸¦ Á¦°øÇÕ´Ï´Ù.

CUBRID HA´Â °í °¡¿ë¼º ±¸ÇöÀÔ´Ï´Ù. CUBRID HA´Â ¼­ºñ½º Á¦°ø½Ã ¿©·¯ ¼­¹ö °£ÀÇ µ¥ÀÌÅͺ£À̽º µ¿±âÈ­¸¦ º¸ÀåÇÕ´Ï´Ù. ¼­ºñ½º¸¦ ¿î¿µÇÏ´Â ½Ã½ºÅÛ¿¡¼­ ¿¹±âÄ¡ ¾ÊÀº Àå¾Ö°¡ ¹ß»ýÇϸéÀÌ ±â´ÉÀº ´Ù¸¥ ½Ã½ºÅÛÀÌ ¼­ºñ½º¸¦ ÀÚµ¿À¸·Î ¼öÇà ÇÒ ¼ö ÀÖµµ·ÏÇÏ¿© ¼­ºñ½º Áß´Ü ½Ã°£À» ÃÖ¼ÒÈ­ÇÕ´Ï´Ù.

CUBRID HA´Â ºñ°øÀ¯ ±¸Á¶ÀÔ´Ï´Ù. CUBRID HA´Â È°¼º ¼­¹ö¿¡¼­ ´ë±â ¼­¹ö·Î µ¥ÀÌÅ͸¦ µ¿±âÈ­Çϱâ À§ÇØ ´ÙÀ½ µÎ ´Ü°è¸¦ ¼öÇàÇÑ´Ù.

Æ®·£Àè¼Ç ·Î±× ¸ÖƼÇ÷º½Ì : È°¼º ¼­¹ö¿¡¼­ ¸¸µç Æ®·£Àè¼Ç ·Î±×¸¦ ´Ù¸¥ ³ëµå·Î ½Ç½Ã°£ º¹Á¦ÇÕ´Ï´Ù.
Æ®·£Àè¼Ç ·Î±× ¹Ý¿µ : º¹Á¦ µÈ Æ®·£Àè¼Ç ·Î±×¸¦ ½Ç½Ã°£À¸·Î ºÐ¼®ÇÏ°í µ¥ÀÌÅ͸¦ ´ë±â ¼­¹ö¿¡ ¹Ý¿µÇÕ´Ï´Ù.
CUBRID HA´Â È°¼º ¼­¹ö¿Í ´ë±â ¼­¹ö °£ÀÇ µ¥ÀÌÅÍ µ¿±âÈ­¸¦ Ç×»ó À¯ÁöÇϱâ À§ÇØ À§¿¡¼­ ¼³¸íÇÑ ´Ü°è¸¦ ¼öÇàÇÑ´Ù. ÀÌ·¯ÇÑ ÀÌÀ¯·Î, ¼­ºñ½º¸¦ Á¦°ø ÇÑ ¸¶½ºÅÍ ³ëµå¿¡¼­ Àå¾Ö°¡ ¹ß»ýÇÏ¿© È°¼º ¼­¹ö°¡ Á¦´ë·Î ÀÛµ¿ÇÏÁö ¾ÊÀ¸¸é ½½·¹ÀÌºê ³ëµåÀÇ ´ë±â ¼­¹ö´Â Àå¾Ö°¡ ¹ß»ýÇÑ ¼­¹ö ´ë½Å ¼­ºñ½º¸¦ Á¦°øÇÕ´Ï´Ù. CUBRID HA´Â ½Ã½ºÅÛ ¹× CUBRIDÀÇ »óŸ¦ ½Ç½Ã°£À¸·Î ¸ð´ÏÅ͸µÇÕ´Ï´Ù. Àå¾Ö ¹ß»ý½Ã ÇÏÆ® ºñÆ® ¸Þ½ÃÁö¸¦ »ç¿ëÇÏ¿© ÀÚµ¿ Àå¾Ö Á¶Ä¡¸¦ ½ÇÇàÇÕ´Ï´Ù.

_images / image13.png
CUBRID HA °³³ä
³ëµå¿Í ±×·ì
³ëµå´Â CUBRID HA¸¦ ±¸¼ºÇÏ´Â ³í¸®Àû ´ÜÀ§ÀÔ´Ï´Ù. »óÅ¿¡ µû¶ó ¸¶½ºÅÍ ³ëµå, ½½·¹ÀÌºê ³ëµå ¶Ç´Â º¹Á¦º» ³ëµå Áß Çϳª°¡ µÉ ¼ö ÀÖ½À´Ï´Ù.

¸¶½ºÅÍ ³ëµå : º¹Á¦ ÇÒ ³ëµå. È°¼º ¼­¹ö¸¦ »ç¿ëÇÏ¿© ÀÐ°í ¾²´Â µîÀÇ ¸ðµç ¼­ºñ½º¸¦ Á¦°øÇÕ´Ï´Ù.
½½·¹ÀÌºê ³ëµå : ¸¶½ºÅÍ ³ëµå¿Í µ¿ÀÏÇÑ Á¤º¸¸¦ °®´Â ³ëµå. ¸¶½ºÅÍ ³ëµå¿¡¼­ º¯°æ ÇÑ ³»¿ëÀº ½½·¹ÀÌºê ³ëµå¿¡ ÀÚµ¿À¸·Î ¹Ý¿µµË´Ï´Ù. ´ë±â ¼­¹ö¸¦ »ç¿ëÇÏ¿© Àб⠼­ºñ½º¸¦ Á¦°øÇÏ¸ç ¸¶½ºÅÍ ³ëµå°¡ ½ÇÆÐÇϸé Àå¾Ö Á¶Ä¡°¡ ¹ß»ýÇÕ´Ï´Ù.
Replica node : ¸¶½ºÅÍ ³ëµå¿Í µ¿ÀÏÇÑ Á¤º¸¸¦ °®´Â ³ëµå. ¸¶½ºÅÍ ³ëµå¿¡¼­ º¯°æ ÇÑ ³»¿ëÀº ÀÚµ¿À¸·Î º¹Á¦º» ³ëµå¿¡ ¹Ý¿µµË´Ï´Ù. ´ë±â ¼­¹ö¸¦ »ç¿ëÇÏ¿© Àб⠼­ºñ½º¸¦ Á¦°øÇÏ¸ç ¸¶½ºÅÍ ³ëµå°¡ ½ÇÆÐÇصµ Àå¾Ö Á¶Ä¡°¡ ¹ß»ýÇÏÁö ¾Ê½À´Ï´Ù.
CUBRID HA ±×·ìÀº À§¿¡¼­ ¼³¸íÇÑ ³ëµåµé·Î ±¸¼ºµÈ´Ù. cubrid_ha.conf ÆÄÀÏ¿¡¼­ ha_node_list ¹× ha_replica_list¸¦ »ç¿ëÇÏ¿©ÀÌ ±×·ìÀÇ ±¸¼º¿øÀ» ±¸¼º ÇÒ ¼ö ÀÖ½À´Ï´Ù. ±×·ìÀÇ ³ëµå´Â µ¿ÀÏÇÑ Á¤º¸¸¦ °®½À´Ï´Ù. »óÅ Á¡°Ë ¸Þ½ÃÁö¸¦ ÁÖ±âÀûÀ¸·Î ±³È¯ÇÏ¸ç ¸¶½ºÅÍ ³ëµå°¡ ½ÇÆÐÇϸé Àå¾Ö Á¶Ä¡°¡ ¹ß»ýÇÕ´Ï´Ù.

³ëµå¿¡´Â ¸¶½ºÅÍ ÇÁ·Î¼¼½º (cub_master), µ¥ÀÌÅͺ£À̽º ¼­¹ö ÇÁ·Î¼¼½º (cub_server), º¹Á¦ ·Î±× º¹»ç ÇÁ·Î¼¼½º (copylogdb), º¹Á¦ ·Î±× ¹Ý¿µ ÇÁ·Î¼¼½º (applylogdb) µîÀÌ Æ÷ÇԵ˴ϴÙ.

_images / image14.png
ÇÁ·Î¼¼½º
CUBRID HA ³ëµå´Â ÇϳªÀÇ ¸¶½ºÅÍ ÇÁ·Î¼¼½º (cub_master), Çϳª ÀÌ»óÀÇ µ¥ÀÌÅͺ£À̽º ¼­¹ö ÇÁ·Î¼¼½º (cub_server), Çϳª ÀÌ»óÀÇ º¹Á¦ ·Î±× º¹»ç ÇÁ·Î¼¼½º (copylogdb) ¹× Çϳª ÀÌ»óÀÇ º¹Á¦ ·Î±× ¹Ý¿µ ÇÁ·Î¼¼½º (applylogdb)·Î ±¸¼ºµË´Ï´Ù. µ¥ÀÌÅͺ£À̽º°¡ ±¸¼ºµÇ¸é µ¥ÀÌÅͺ£À̽º ¼­¹ö ÇÁ·Î¼¼½º, º¹Á¦ ·Î±× º¹»ç ÇÁ·Î¼¼½º ¹× º¹Á¦ ·Î±× ¹Ý¿µ ÇÁ·Î¼¼½º°¡ ½ÃÀ۵˴ϴÙ. º¹Á¦ ·Î±×ÀÇ º¹»ç ¹× ¹Ý¿µÀº ´Ù¸¥ ÇÁ·Î¼¼½º¿¡ ÀÇÇØ ½ÇÇàµÇ¹Ç·Î ¹Ý¿µ º¹Á¦ Áö¿¬Àº ½ÇÇàÁßÀÎ Æ®·£Àè¼Ç¿¡ ¿µÇâÀ» ¹ÌÄ¡Áö ¾Ê½À´Ï´Ù.

¸¶½ºÅÍ ÇÁ·Î¼¼½º (cub_master) : ÇÏÆ® ºñÆ® ¸Þ½ÃÁö¸¦ ±³È¯ÇÏ¿© CUBRID HAÀÇ ³»ºÎ °ü¸® ÇÁ·Î¼¼½º¸¦ Á¦¾îÇÑ´Ù.
µ¥ÀÌÅͺ£À̽º ¼­¹ö ÇÁ·Î¼¼½º (cub_server) : »ç¿ëÀÚ¿¡°Ô Àб⠶Ǵ ¾²±â¿Í °°Àº ¼­ºñ½º¸¦ Á¦°øÇÕ´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº ¼­¹ö¸¦ ÂüÁ¶ÇϽʽÿÀ.
º¹Á¦ ·Î±× º¹»ç ÇÁ·Î¼¼½º (copylogdb) : ±×·ìÀÇ ¸ðµç Æ®·£Àè¼Ç ·Î±×¸¦ º¹»çÇÕ´Ï´Ù. º¹Á¦ ·Î±× º¹»ç ÇÁ·Î¼¼½º°¡ ´ë»ó ³ëµåÀÇ µ¥ÀÌÅͺ£À̽º ¼­¹ö ÇÁ·Î¼¼½º¿¡¼­ Æ®·£Àè¼Ç ·Î±×¸¦ ¿äûÇÏ¸é µ¥ÀÌÅͺ£À̽º ¼­¹ö ÇÁ·Î¼¼½º´Â ÇØ´ç ·Î±×¸¦ ¸®ÅÏÇÕ´Ï´Ù. º¹»ç µÈ Æ®·£Àè¼Ç ·Î±×ÀÇ À§Ä¡´Â cubrid_ha.confÀÇ ha_copy_log_base¿¡¼­ ±¸¼º ÇÒ ¼ö ÀÖ½À´Ï´Ù. applyinfo À¯Æ¿¸®Æ¼¸¦ »ç¿ëÇÏ¿© º¹»ç µÈ º¹Á¦ ·Î±× Á¤º¸¸¦ È®ÀÎÇϽʽÿÀ. º¹Á¦ ·Î±× º¹»ç ÇÁ·Î¼¼½º¿¡´Â SYNC ¹× ASYNCÀÇ µÎ °¡Áö ¸ðµå°¡ ÀÖ½À´Ï´Ù. cubrid_ha.confÀÇ ha_copy_sync_mode¸¦ »ç¿ëÇÏ¿© ±¸¼º ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ·¯ÇÑ ¸ðµå¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ ³»¿ëÀº ·Î±× ¸ÖƼÇ÷º½ÌÀ» ÂüÁ¶ÇϽʽÿÀ.
_images / image15.png
º¹Á¦ ·Î±× ¹Ý¿µ ÇÁ·Î¼¼½º (applylogdb) : º¹Á¦ ·Î±× º¹»ç ÇÁ·Î¼¼½º¿¡¼­ º¹»ç ÇÑ ·Î±×¸¦ ³ëµå¿¡ ¹Ý¿µÇÕ´Ï´Ù. ¹Ý¿µµÈ º¹Á¦ Á¤º¸´Â ³»ºÎ Ä«Å»·Î±× (db_ha_apply_info)¿¡ ÀúÀåµË´Ï´Ù. applyinfo À¯Æ¿¸®Æ¼¸¦ »ç¿ëÇÏ¿©ÀÌ Á¤º¸¸¦ È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.
_images / image16.png
¼­¹ö
¿©±â¼­ "¼­¹ö"¶ó´Â ´Ü¾î´Â µ¥ÀÌÅͺ£À̽º ¼­¹ö ÇÁ·Î¼¼½ºÀÇ ³í¸®Àû Ç¥ÇöÀÔ´Ï´Ù. »óÅ¿¡ µû¶ó ¼­¹ö´Â È°¼º ¼­¹ö ¶Ç´Â ´ë±â ¼­¹ö ÀÏ ¼ö ÀÖ½À´Ï´Ù.


CUBRID HA is in a shared-nothing structure. To synchronize data from an active server to a standby server, CUBRID HA executes the following two steps.

Transaction log multiplexing: Replicates the transaction logs created by an active server to another node in real time.
Transaction log reflection: Analyzes replicated transaction logs in real time and reflects the data to a standby server.
CUBRID HA executes the steps described above in order to always maintain data synchronization between an active server and a standby server. For this reason, if an active server is not working properly because of a failure occurring in the master node that had been providing service, the standby server of the slave node provides service instead of the failed server. CUBRID HA monitors the status of the system and CUBRID in real time. It uses heartbeat messages to execute an automatic failover when a failure occurs.

_images/image13.png
CUBRID HA Concept
Nodes and Groups
A node is a logical unit that makes up CUBRID HA. It can become one of the following nodes according to its status: master node, slave node, or replica node.

Master node : A node to be replicated. It provides all services which are read, write, etc. using an active server.
Slave node : A node that has the same information as a master node. Changes made in the master node are automatically reflected to the slave node. It provides the read service using a standby server, and a failover will occur when the master node fails.
Replica node : A node that has the same information as a master node. Changes made in the master node are automatically reflected to the replica node. It provides the read service using a standby server, and no failover will occur when the master node fails.
The CUBRID HA group consists of the nodes described above. You can configure the members of this group by using the ha_node_list and ha_replica_list in the cubrid_ha.conf file. Nodes in a group have the same information. They exchange status checking messages periodically and a failover will occurs when the master node fails.

A node includes the master process (cub_master), the database server process (cub_server), the replication log copy process (copylogdb), the replication log reflection process (applylogdb), etc.

_images/image14.png
Processes
A CUBRID HA node consists of one master process (cub_master), one or more database server processes (cub_server), one or more replication log copy processes (copylogdb), and one or more replication log reflection processes (applylogdb). When a database is configured, database server processes, replication log copy processes, and replication log reflection processes will start. Because copy and reflection of a replication log are executed by different processes, the delay in replicating reflections does not affect the transaction that is being executed.

Master process (cub_master) : Exchanges heartbeat messages to control the internal management processes of CUBRID HA.
Database server process (cub_server) : Provides services such as read or write to the user. For details, see Servers.
Replication log copy process (copylogdb) : Copies all transaction logs in a group. When the replication log copy process requests a transaction log from the database server process of the target node, the database server process returns the corresponding log. The location of copied transaction logs can be configured in the ha_copy_log_base of cubrid_ha.conf. Use applyinfo utility to verify the information of copied replication logs. The replication log copy process has following two modes: SYNC and ASYNC. You can configure it with the ha_copy_sync_mode of cubrid_ha.conf. For details on these modes, see Log Multiplexing.
_images/image15.png
Replication log reflection process (applylogdb) : Reflects the log that has been copied by the replication log copy process to a node. The information of reflected replications is stored in the internal catalog (db_ha_apply_info). You can use the applyinfo utility to verify this information.
_images/image16.png
Servers
Here, the word "server" is a logical representation of database server processes. Depending on its status, a server can be either an active server or a standby server.

Active server : A server that belongs to a master node; the status is active. An active server provides all services, including read, write, etc. to the user.
Standby server : A standby server that belongs to a non-master node; the status is standby. A standby server provides only the read service to the user.
The server status changes based on the status of the node. You can use the cubrid changemode utility to verify server status. The maintenance mode exists for operational convenience and you can change it by using the cubrid changemode utility.

_images/image17.png
active : The status of servers that run on a master node is usually active. In this status, all services including read, write, etc. are provided.
standby : The status of servers that run on a slave node or a replica node is standby. In this status, only the read service is provided.
maintenance : The status of servers can be manually changed for operational convenience is maintenance. In this status, only a csql can access and no service is provided to the user.
to-be-active : The status in which a standby server will become active for reasons such as failover, etc. is to-be-active. In this status, servers prepare to become active by reflecting transaction logs from the existing master node to its own server. The node in this status can accept only SELECT query.
Other : This status is internally used.
When the node status is changed, on cub_master process log and cub_server process log, following error messages are saved. But, they are saved only when the value of error_log_level in cubrid.conf is error or less.

The following log information of cub_master process is saved on $CUBRID/log/<hostname>_master.err file.

HA generic: Send changemode request to the server. (state:1[active], args:[cub_server demodb ], pid:25728).
HA generic: Receive changemode response from the server. (state:1[active], args:[cub_server demodb ], pid:25728).
The following log information of cub_server is saved on $CUBRID/log/server/<db_name>_<date>_<time>.err file.

Server HA mode is changed from 'to-be-active' to 'active'.
¾Æ °¨»çÇÕ´Ï´Ù.
ÀÌ°Ô ÇÊ¿äÇß½À´Ï´Ù.
it»ýÃʺ¸ 2020-03
ÁÁÀº Âü°íÀÚ·á°¡ µÉ°Í °°¾Æ ´ñ±Û ³²±â°í°©´Ï´Ù.


QnA
Á¦¸ñPage 1133/5683
2015-12   1492297   ¹é¸Þ°¡
2014-05   4955823   Á¤ÀºÁØ1
2021-01   3222   VSPress
2017-07   3223   »ßµ¹À̽½ÇÄÀÌ
2020-06   3223   fprrmsl
2020-10   3223   Psychophysi¡¦
2017-10   3223   ¿­¾¾¹Ì
2019-09   3223   Ãë¹ÌÄÄ
2019-12   3223   »¡°£¸Á¶Ç
2015-05   3223   ¹Ì¼ö¸Ç
2019-10   3223   ¸Þ¶Ñ±â°¡¸é¸Ç
2015-07   3223   Â÷³ÝÄÄÇ»ÅÍ
2017-11   3223   LINKINPARK
2017-05   3223   ³ªºñz
2018-09   3223   ½É¹ÙÆ®
2019-10   3223   °¡ºü·Î±¸³ª
2018-08   3223   ¸á¶û²Ã¸µ
2017-05   3223   ǪÇÏÈ÷
2018-04   3223   ½½·çÇÁ
2017-06   3223   Á¤ÀǼ®
2018-02   3224   Ãֽÿµ
2014-04   3224   comduck