Hadoop namenode高可用性(Hadoop namenode High Availability)
我有一个关于名称节点高可用性的问题。 名称节点非常重要,因为它存储了所有元数据,如果它已关闭,整个Hadoop集群也将关闭。 那么有没有什么好的方法来接近名称节点High Availability,例如,当主名称节点失败时,可以接管备份名称节点? (现在我使用Hadoop 1.1.2)
I have a question about the name node High Availability. Name node is so important because it stores all the metadata, if it is down, the whole Hadoop Cluster will be down as well. So is there any good way to approach the name node High Availability, for example there is backup name node that can take over when the primary name node fails? (now I use Hadoop 1.1.2)
原文:https://stackoverflow.com/questions/18194675
最满意答案
您将需要使用
INSERT INTO...SELECT FROM
而不是INSERT INTO..VALUES
:INSERT INTO customer_entity_int (attribute_id, entity_type_id, entity_id, `value`) SELECT 14, entity_type_id, entity_id, `value` FROM customer_entity_int WHERE attribute_id = 13 AND entity_id NOT IN (SELECT entity_id FROM customer_entity_int WHERE attribute_id = 14)
您可以在
attribute_id
列表的SELECT
列表中包含静态值You will want to use
INSERT INTO...SELECT FROM
instead of theINSERT INTO..VALUES
:INSERT INTO customer_entity_int (attribute_id, entity_type_id, entity_id, `value`) SELECT 14, entity_type_id, entity_id, `value` FROM customer_entity_int WHERE attribute_id = 13 AND entity_id NOT IN (SELECT entity_id FROM customer_entity_int WHERE attribute_id = 14)
You can include a static value in your
SELECT
list for yourattribute_id
相关问答
更多-
尝试这个 INSERT INTO g8_list_exec (g8_task_id,g8_tmpl_id,g8_chk_id) SELECT g8_rec_id,g8_tmpl_uid,'ik_862' FROM g8_list_add_task WHERE g8_tmpl_uid = 'oe_507'; Try this INSERT INTO g8_list_exec (g8_task_id,g8_tmpl_id,g8_chk_id) SELECT g8_rec_id,g8_tmpl_uid,'i ...
-
很长的mysql插入查询(Long mysql insert queries)[2024-02-26]
从MySQL文档 : 尽管InnoDB在内部支持大于65,535字节的行大小,但MySQL本身对所有列的总大小强加了行大小限制为65,535 假设你有8列,每列包含5000个字符,那么这需要的最小内存量为40KB,假设每个字符只有1个字节(根据你使用的编码,它可能超过这个数量)。 但是,您也可能超过MySQL规定的限制。 我将您的问题视为更多的设计问题,特别是您试图将过多的数据塞入单个记录中。 您可以考虑通过将单个列或列的子集作为其自己的单独表来更改您的设计。 关于INSERT语句,执行批量INSERT没有 ... -
运行插入SQL查询(Run Insert SQL queries)[2022-12-04]
您可以在Access的查询设计器中构建查询,然后在设计视图中单击功能区上的“运行”。 (寻找红色的解释点。) 如果您想从代码执行此操作,则可以使用DAO数据库对象或ADO CurrentProject.Connection对象的.Execute方法。 Dim strInsert As String strInsert = "INSERT INTO tbl_UserPurchase (ID, Name)" & vbCrLf & _ "VALUES(321, 'Joe');" CurrentDb.Exe ... -
MySQL是否缓存插入查询?(Does MySQL cache insert queries?)[2023-04-12]
正如另一位用户所说,MySQL中有一种机制可以使缓存保持最新状态。 当您执行影响先前在缓存中存储的结果的INSERT时,必须更新它以反映新插入或删除,以便稍后再次处理该SELECT时再次创建。 我怀疑这就是你所看到的。 另一种可能性,虽然更明显,并且希望不是您的问题,但如果您使用显示并自动更新表的工具执行此INSERT,则可能在INSERT之后发出SELECTS。 As another user stated, there is a mechanism in MySQL which keeps the ca ... -
Camunda自定义插入查询(Camunda custom insert queries)[2023-09-22]
DbEntityManager有一个insert方法。 插入和更新由DbSqlSession根据DbEntity的getPersistantState进行管理。 您只需提供必须以insert和update为前缀的对应映射。 例如,请参阅内置实体。 The DbEntityManager has an insert method. The insert and update is than managed by the DbSqlSession based on the getPersistantState ... -
毕竟,我找不到两个选择查询的逻辑解释。 我发现最好的是在没有手动更改数据库的情况下摆脱这两个选择,如此处所述。 因此,为了摆脱这些选择,有人应该首先以不同的方式设置域类(没有约束,但有映射)。 class Myclass { String dscr static mapping = { dscr unique: true } } 然后为了保护你的代码免受异常的影响,因为现在hibernate不检查唯一性,你应该插入这样的新元素: try { def a = ...
-
从子查询插入(Insert from sub queries)[2023-07-27]
您将需要使用INSERT INTO...SELECT FROM而不是INSERT INTO..VALUES : INSERT INTO customer_entity_int (attribute_id, entity_type_id, entity_id, `value`) SELECT 14, entity_type_id, entity_id, `value` FROM customer_entity_int WHERE attribute_id = 13 AND entity_id NOT IN ... -
2000个插入查询一小时约为每1.5秒一次。 这对任何现代设备上运行的任何数据库都不是一个严重的负载。 唯一的例外是插入非常长,例如存储兆字节长度的blob或插入,这些blob或插入可能具有执行复杂工作的长触发链。 我怀疑尝试优化应用程序的这个方面还为时过早。 您应该能够为每个操作单独插入而不影响性能。 这也将简化应用程序。 通过不使用缓存,您不必担心与缓存保持一致性,如果应用程序端失败该怎么办,如果在前一个缓存更新之前发生第二次缓存更新,该怎么办,等等。 在实际更新缓存时,您也不必担心如何处理缓存。 我应 ...
-
那是因为你可能有Book 1..n Chapter , cascade设置为(至少) PERSIST 。 这意味着无论何时保存书籍,其所有章节都会被保存。 所以你实际上是想两次保存这些章节。 你不需要第二次保存(在第二个例子中) 第一个例子就是这样工作的,因为章节已经与会话相关联(也许你没有覆盖hashCode()和equals()方法),而save()根本没有做任何事情。 但这些都是猜测。 你必须展示你的映射。 That's because you probably have Book 1..n Chap ...
-
执行多个插入查询(Executing multiple insert queries)[2021-12-24]
根据MySQL INSERT计划,我们有以下问题花费时间: - Connecting - Sending query to server - Parsing query - Inserting row (1 × size of row) - Inserting indexes: (1 × number of indexes) - Closing 因此,多次插入会更快,因为它将生成Connecting , Sending query to server , Parsing query ,仅Closing开 ...