Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dq example 疑问 #30

Open
withseid opened this issue Jun 22, 2022 · 1 comment
Open

dq example 疑问 #30

withseid opened this issue Jun 22, 2022 · 1 comment

Comments

@withseid
Copy link

NewProducer 方法里面要求 Endpoint 必须大于 2 且 Endpoints 必须是多个不同的实例,那是不是需要一个 beanstalkd 集群呢?

func NewProducer(beanstalks []Beanstalk) Producer {
	if len(beanstalks) < minWrittenNodes {
		log.Fatalf("nodes must be equal or greater than %d", minWrittenNodes)
	}
	var nodes []Producer
	producers := make(map[string]lang.PlaceholderType)
	for _, node := range beanstalks {
		if _, ok := producers[node.Endpoint]; ok {
			log.Fatal("all node endpoints must be different")
		}

		producers[node.Endpoint] = lang.Placeholder
		nodes = append(nodes, NewProducerNode(node.Endpoint, node.Tube))
	}

	return &producerCluster{nodes: nodes}
}

看了一下,好像没有 beanstalkd 集群部署方式? 都是多个 beanstalkd 实例,那假如某个 beanstalkd 实例宕机了,数据不就丢失了吗

@chenkaiwei
Copy link

beanstalkd的集群是客户端指定的,也即服务端不做配置,相互不感知存在,客户端配了哪些,哪些就属于这个集群。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants