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

playbook(memcache): support instances and instances_sequence #384

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

EricWai
Copy link

@EricWai EricWai commented Dec 18, 2023

fix #240

  1. hosts.yaml support the instances and {instances_sequence}.
  2. add the hosts_instances.yaml as a template.
  3. playbook memcached add exporter (from tombstone branch)

Now, when deploying the memcached cluster, hosts.yaml can be written as follows:

global:
  user: curve
  ssh_port: 22
  private_key_file: /home/curve/.ssh/id_rsa
  
hosts:
  - name: server-host1
    hostname: 10.0.1.1
    labels:
      - memcached
    envs:
      - SUDO_ALIAS=sudo
      - ENGINE=docker
      - IMAGE=memcached:1.6.17
      - EXPORTER_IMAGE=quay.io/prometheus/memcached-exporter:v0.13.0
      - LISTEN=10.0.1.1
      - PORT=112${instances_sequence}
      - EXPORTER_PORT=91${instances_sequence}
      - USER=root
      - MEMORY_LIMIT=32768 # item memory in megabytes
      - MAX_ITEM_SIZE=8m # adjusts max item size (default: 1m, min: 1k, max: 1024m)
      - EXT_PATH=/mnt/memcachefile/cachefile:10${instances_sequence}G
      - EXT_WBUF_SIZE=8 # size in megabytes of page write buffers.
      - EXT_ITEM_AGE=1 # store items idle at least this long (seconds, default: no age limit)
      - VERBOSE="v"
    instances: 3

  - name: server-host2
    hostname: 10.0.1.2
    labels:
      - memcached
    envs:
      - SUDO_ALIAS=sudo
      - ENGINE=docker
      - IMAGE=memcached:1.6.17
      - EXPORTER_IMAGE=quay.io/prometheus/memcached-exporter:v0.13.0
      - LISTEN=10.0.1.2
      - PORT=11211
      - EXPORTER_PORT=9151
      - USER=root
      - MEMORY_LIMIT=32768 # item memory in megabytes
      - MAX_ITEM_SIZE=8m # adjusts max item size (default: 1m, min: 1k, max: 1024m)
      - EXT_PATH=/mnt/memcachefile/cachefile:1024G
      - EXT_WBUF_SIZE=8 # size in megabytes of page write buffers.
      - EXT_ITEM_AGE=1 # store items idle at least this long (seconds, default: no age limit)
      - VERBOSE="v"

Copy link
Contributor

@montaguelhz montaguelhz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job

internal/configure/hosts/hosts.go Outdated Show resolved Hide resolved
internal/configure/hosts/hosts.go Outdated Show resolved Hide resolved
internal/configure/hosts/hosts.go Outdated Show resolved Hide resolved
internal/configure/hosts/hosts.go Outdated Show resolved Hide resolved
internal/configure/hosts/hosts.go Show resolved Hide resolved
internal/configure/hosts/hosts.go Show resolved Hide resolved
internal/configure/hosts/hosts.go Outdated Show resolved Hide resolved
internal/configure/hosts/hosts.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

curveadm playbook deploy memcached
3 participants