Skip to main content

Monitor keepalived status, run start.sh if server get MASTER role, and run stop.sh if server get SLAVE role.

Project description

Monitor keepalived status, run start.sh if server get MASTER role, and run stop.sh if server get SLAVE role.

Install

pip install keepstart

Example Config

application:
    daemon: false
    pidfile: jenkins-keep.pid

keepstart:
    nic: eth0
    vip: 172.18.1.44
    start: /opt/app/start.sh
    stop: /opt/app/stop.sh
    is-running: /opt/app/status.sh

logging:
    version: 1
    disable_existing_loggers: false
    formatters:
        simple:
        format: "%(asctime)-15s\t%(levelname)s\t%(message)s"
    handlers:
        console:
            class: logging.StreamHandler
            level: DEBUG
            formatter: simple
    loggers:
        keepstart:
            level: DEBUG
            handlers:
                - console
            propagate: no
    root:
        level: DEBUG
        handlers:
            - console

Server command

keepserver -c config.yaml start
keepserver -c config.yaml stop
keepserver -c config.yaml reload

Command help

zencoreDeMacPro:keepstart zencore$ keepserver --help
Usage: keepserver [OPTIONS] COMMAND [ARGS]...

Options:
-c, --config FILENAME  Config file path, use yaml format. Default to
                        config.yaml.
--help                 Show this message and exit.

Commands:
reload  Reload application server.
start   Start application server.
stop    Stop application server.
zencoreDeMacPro:keepstart zencore$

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keepstart-0.1.1.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file keepstart-0.1.1.tar.gz.

File metadata

  • Download URL: keepstart-0.1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for keepstart-0.1.1.tar.gz
Algorithm Hash digest
SHA256 82fb67986777006013b34d0a4df1fe5a3fc8780a84453ec89f0f7e1e66d02b3e
MD5 328dbaf168f335ebe91e1ac611a0ad23
BLAKE2b-256 6fa915108200881c1e2da9d988d21ead8be91915b6dc9ce98c6175e15a434d09

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page