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

重构 redis cluster 节点 run id 命名方式 #127

Open
hlwanghl opened this issue Mar 30, 2021 · 0 comments
Open

重构 redis cluster 节点 run id 命名方式 #127

hlwanghl opened this issue Mar 30, 2021 · 0 comments

Comments

@hlwanghl
Copy link
Contributor

https://github.com/QingCloudAppcenter/redis/blob/5e0b64cec759967c7a034f5e0d6fc3ead870e77d/ansible/roles/redis-cluster/files/etc/confd/templates/redis-cluster.sh/02.nodes.conf.tmpl#L2

目前 run id 是随机生成的,可读性不好,不便于排查。建议改成格式 [集群ID]-[gid]-[sid]-[padding],便于快速找到节点之间的对应关系:

cl-oaybs2di-001-001--------------------- 172.22.2.55:6379@16379 master - 0 1617105310314 1 connected 0-5460
cl-oaybs2di-001-002--------------------- 172.22.2.56:6379@16379 slave cl-oaybs2di-001-001--------------------- 0 1617105309715 1 connected
cl-oaybs2di-002-003--------------------- 172.22.2.57:6379@16379 master - 0 1617105310016 2 connected 5461-10921
cl-oaybs2di-002-004--------------------- 172.22.2.58:6379@16379 slave cl-oaybs2di-002-003--------------------- 0 1617105312319 2 connected
cl-oaybs2di-003-005--------------------- 172.22.2.59:6379@16379 myself,master - 0 1617105311318 0 connected 10922-16383
cl-oaybs2di-003-006--------------------- 172.22.2.54:6379@16379 slave cl-oaybs2di-003-005--------------------- 0 1617105311000 0 connected
  echo -n {{ getv "/cluster/cluster_id" }}-{{ getv "/host/gid" }}-{{ getv "/host/sid" }}------------------------------ | head -c 40
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

1 participant