influxdb.py 684 B

12345678910111213141516171819
  1. from lib.compose.object import ServiceDataVolume, ServicePort
  2. from lib.compose.services import ClusterCommonService
  3. class InfluxdbService(ClusterCommonService):
  4. SVC_INFLUXDB = "influxdb"
  5. SVC_PORT_INFLUXDB = 30086
  6. VERSION = "1.7.7"
  7. def __init__(self, keystone):
  8. super().__init__(self.SVC_INFLUXDB, self.VERSION, port=self.SVC_PORT_INFLUXDB, keystone_svc=keystone)
  9. self.add_volume(self.get_data_vol())
  10. self.set_healthcheck(f"curl -k https://localhost:{self.port}")
  11. def get_data_vol(self):
  12. return ServiceDataVolume("/var/lib/influxdb")
  13. def get_command(self):
  14. return ["influxd", "-config", "/etc/yunion/influxdb.conf"]