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 memcached add instances and ${instances_sequence} #341

Closed
wants to merge 1 commit into from

Conversation

EricWai
Copy link

@EricWai EricWai commented Nov 10, 2023

fix #240

  1. hosts.yaml support the instances.
  2. add the hosts_instances.yaml as a template.
  3. Fixed spelling errors in variable names: "expoter" -> "exporter".
  4. add "if [ "${EXPORTER_PORT}" ];then".

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:
  - host: 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=1121${instances_sequence}
      - EXPORTER_PORT=915${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:102${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

  - host: 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"

@aspirer
Copy link
Collaborator

aspirer commented Nov 24, 2023

replicas: 3 should change to instances: 3, refer to #301

Signed-off-by: EricWai <51902911+EricWai@users.noreply.github.com>
@EricWai EricWai changed the title playbook memcached add replicas and ${replicas_sequence} playbook memcached add instances and ${instances_sequence} Nov 24, 2023
@EricWai
Copy link
Author

EricWai commented Nov 24, 2023

replicas: 3 should change to instances: 3, refer to #301

Thanks for the guidance, Finished!

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