我一直想知道为什么ZooKeeper需要合奏中的大多数机器才能工作.让我们说我们有一个非常简单的3台机器的集合 - A,B,C.
当A失败时,新领导人当选 - 很好,一切正常.当另一个人死亡时,让我们说B,服务不可用.是否有意义?为什么机器C不能单独处理所有事情,直到A和B再次启动?
由于一台机器足以完成所有工作(例如单机合奏工作正常)......
ZooKeeper以这种方式设计有什么特别的原因吗?有没有办法配置ZooKeeper,例如,当N中的至少一个出现时,整体是否可用?
编辑: 也许有一种方法可以应用领导者选择的自定义算法?或者定义法定人数的大小?
提前致谢.
在触发器中我想看看sql查询触发了这个触发器.我使用了postgresql(8.4)的current_query()函数.
一切都很好,但是如果触发器是通过预备语句执行的,我会获得占位符($ 1)而不是正确的值.例如(已记录的查询):
delete from some_table where id=$1
Run Code Online (Sandbox Code Playgroud)
有没有办法获得/拥有这个值/参数?
已编辑(已添加示例):
--table for saving query
create table log_table (
query text
)
--table for trigger
create table some_table (
id text
)
--function itself
CREATE FUNCTION save_query() RETURNS trigger AS $$
switch $TG_op {
DELETE {
spi_exec "INSERT INTO log_table (query) VALUES (current_query())"
}
default {
return OK
}
}
return OK
$$ LANGUAGE pltcl;
Run Code Online (Sandbox Code Playgroud)
创建一个触发器:
create trigger test_trigger before delete on some_table for each row execute procedure save_query(); …Run Code Online (Sandbox Code Playgroud) 尝试编写脚本以在Azure上创建的VM上自动部署Azure.昨天一切都很花花公子.我进行了设置,并且服务正在部署到各自的订阅中.
我的证书区域还有许多Azure管理证书.我已经把它们全部清理干净了,因为除了一个人以外都很老了.然后我重新导入了最新的发布设置文件,希望通过从头开始,一切都会很高兴.
然后我今天登录,运行了我的一个部署,它说:
The server failed to authenticate the request.
Verify that the certificate is valid and is associated with this subscription.
Run Code Online (Sandbox Code Playgroud)
没问题,只需使用方便的dandy add-azureaccount,它会重新登录,重新运行部署,然后再说:
Set-AzureService : ForbiddenError: The server failed to authenticate the
request. Verify that the certificate is valid and is associated with this
subscription.
Run Code Online (Sandbox Code Playgroud)
有没有人知道如何获得服务器的身份验证?
我在Azure上创建并在VM上安装Teamcity的所有这些自动化.当我尝试直接在VM Powershell上运行脚本时它工作正常但是当我尝试运行Teamcity配置时发生错误,它在PowerShell构建步骤中失败.
It though returns the subscriptions that are there on VM by the command Get-AzureSubscription
[11:31:07][Step 3/3] SubscriptionId :*******
[11:31:07][Step 3/3] SubscriptionName :****
[11:31:07][Step 3/3] Environment : AzureCloud
[11:31:07][Step 3/3] SupportedModes : …
user表的定义没有AUTO_INCREMENTon user_id。我想将其更改为 AUTO_INCRMENT 字段。但问题是 user_id 被外键约束中的许多表引用。
我们可以在不删除所有外键的情况下解决这个问题吗?