Installation of a controller for the self healing system. - 0-complexity/openvcloud GitHub Wiki
on ovc_git
# cd in the environement repo.
cd /opt/code/github/gig-projects/env_be-g8-2
change the listen address of the redis system on all the nodes. In jsshell do:
for service in j.atyourservice.findServices(name='redis', instance='system'):
service.hrd.set('instance.param.ip', '0.0.0.0')
service.install(reinstall=True)
In order to expose the influxdb from the controller to the master vm, create a reverse ssh tunnel on one of the node.
# cd in the environement repo.
cd /opt/code/github/gig-projects/env_be-g8-2
ays install -n autossh -i influxdbctrl -tt node.ssh -tn cpu-01.be-gen8-2
Remote bind address [127.0.0.1]: 0.0.0.0
Remote address: be-g8-2.demo.greenitglobe.com # change to the url of the environement you update
Remote connection port [22]: 1501
Remote login [root]: guest
Remote listening port: 8086
Local address to forward: 10.103.2.1 # address of the controller
Local port to forward: 8086
change the listen address of the redis system on all the nodes.
Update grafana to last version
# remove the old grafana service
mv /opt/code/github/gig-projects/env_be-g8-2/services/jumpscale__node.ssh__ovc_master/jumpscale__grafana__main /tmp
# check the admin password that was configured
cat /tmp/jumpscale__grafana__main/service.hrd
# install new version
ays install -r -n grafana -i main --parent 'jumpscale__node.ssh__ovc_master'
GRAFANA: Influxdb connection [main]: main
GRAFANA: Admin password: LzLSy1sdfsfs # used the same password as before
Connect to the master VM, update the grafana config
vim /opt//grafana/conf/defaults.ini
in the config change
root_url = %(protocol)s://%(domain)s:%(http_port)s/ to https://be-g8-2.demo.greenitglobe.com/grafana
in the auth.anonymous section, change
enabled = false to enabled = true
and
org_role = Viewer to org_role = Admin
Then restart grafana
ays restart -n grafana
On the controller
install influxdb docker
docker run -td -p 8083:8083 -p 8086:8086 -v influxdb:/optvar/data/influxdb --name influxdb jumpscale/ubuntu1604_influxdb
install jumpscale8 docker
create the container
docker run -td -p 9022:22 --name jsagent jumpscale/ubuntu1604_jsagent
login into the container, default password is gig1234
ssh root@localhost -p 9022
Once in the container, in tmux start influxdb dumper and the jsagent.
start the influxdb dumper
influxcl = j.clients.influxdb.get('172.17.0.1', database='statistics')
# replace 10.106.2.1/24 with the cidr of the environment
j.tools.realityprocess.influxpump(influxcl, cidr='10.106.2.1/24', ports=[9999])
start jsagent. Pass the correct argument to the command.
jspython jsagent.py --grid-id 107 --controller-ip 37.203.43.238 --controller-port 4444 --controller-password akjnKJnkjN