Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

wsrep_cluster_address is incorrectly set in my.cnf #113

@jeanbza

Description

@jeanbza

Pertinent line: https://github.com/cloudfoundry/cf-mysql-release/blob/develop/jobs/mysql/templates/my.cnf.erb#L47

cf_mysql.mysql.cluster_ips (from bosh manifest) is being joined into a command separated line and set for wsrep_cluster_address in /etc/mysql/my.cnf. However, wsrep_cluster_address expects a single value. Therefore when cf_mysql.mysql.cluster_ips has multiple values in yml and wsrep_cluster_address is set with this comma-separated list, we get this error:

{"timestamp":"1467149656.280482054","source":"mariadb_ctrl","message":"mariadb_ctrl.Error reading config file","log_level":3,"data":{"error":"Unmarshaling config: yaml: unmarshal errors:\n  line 23: cannot unmarshal !!seq into string\n  line 25: cannot unmarshal !!seq into string\n  line 27: cannot unmarshal !!seq into string","trace":"goroutine 1 [running]:\ngithub.com/pivotal-golang/lager.(*logger).Fatal(0xc820018240, 0x871800, 0x19, 0x7f7866bea028, 0xc820015cd0, 0x0, 0x0, 0x0)\n\t/var/vcap/packages/mariadb_ctrl/src/github.com/pivotal-golang/lager/logger.go:131 +0xc5\nmain.main()\n\t/var/vcap/packages/mariadb_ctrl/src/github.com/cloudfoundry/mariadb_ctrl/main.go:43 +0x385\n"}}
panic: Unmarshaling config: yaml: unmarshal errors:
  line 23: cannot unmarshal !!seq into string
  line 25: cannot unmarshal !!seq into string
  line 27: cannot unmarshal !!seq into string

goroutine 1 [running]:
github.com/pivotal-golang/lager.(*logger).Fatal(0xc820018240, 0x871800, 0x19, 0x7f7866bea028, 0xc820015cd0, 0x0, 0x0, 0x0)
    /var/vcap/packages/mariadb_ctrl/src/github.com/pivotal-golang/lager/logger.go:152 +0x698
main.main()
    /var/vcap/packages/mariadb_ctrl/src/github.com/cloudfoundry/mariadb_ctrl/main.go:43 +0x385

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1696 +0x1

goroutine 5 [syscall]:
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
    /usr/local/go/src/os/signal/signal_unix.go:28 +0x37

Our /etc/mysql/my.cnf line looks like this:

cat /etc/mysql/my.cnf | grep wsrep_cluster_address
wsrep_cluster_address="gcomm://10.0.20.11,10.0.20.16,10.0.20.17"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions