4

Openshift origin was installed via the ansible playbooks.

According to this documentation, the correct command to restart is:

$ systemctl restart atomic-openshift-master-api atomic-openshift-master-controllers

However, this just results in:

Failed to restart atomic-openshift-master-api.service: Unit not found.
Failed to restart atomic-openshift-master-controllers.service: Unit not found.

What is the correct way to restart openshift origin (okd) after installing via ansible on Centos7?

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
MirroredFate
  • 12,396
  • 14
  • 68
  • 100

3 Answers3

7

If you get the following error:

bash: master-restart: command not found

try:

/usr/local/bin/master-restart
DReis
  • 151
  • 1
  • 7
4

If you installed the OKD as v3.10, you should restart master services as follows. [0] The service is running as pod from v3.10, so you should use the specific command for restarting the master services, such as api and controllers

# master-restart api
# master-restart controllers

[0] RESTARTING MASTER SERVICES

Daein Park
  • 4,393
  • 2
  • 12
  • 21
  • Are you logged into one of the masters as root when you try this? – Geoff Dec 17 '18 at 11:16
  • Where do the master-restart come from ? On the master node : locate master-restart => no result – user2668735 Apr 25 '19 at 18:24
  • If you use less than v3.10 version, then you should use `systemctl` for restart. Usually the script located as `/usr/local/bin/master-restart`. And you can verify to use `which master-restart`. – Daein Park Apr 26 '19 at 09:27
4

As far as I know, you have two alternatives:

  1. Using ansible

    Use the same inventory.ini as you used when installing OpenShift origin.

    Assuming that you have the inventory.ini file and the openshift-ansible repository cloned under /home/user/, execute the master restart playbook:

    ansible-playbook -i /home/user/inventory.ini /home/user/openshift-ansible/playbooks/openshift-master/restart.yml

  2. Restart the services

    To restart the services manually, the service names are origin-master-api and origin-master-controllers. Thus the command to restart them should be:

    systemctl restart origin-master-api origin-master-controllers

I strongly recommend using the first option.

OrionMD
  • 389
  • 1
  • 7
  • 13
i.olteanu
  • 81
  • 1
  • 8
  • $systemctl restart origin-master-api Failed to restart origin-master-api.service: Unit origin-master-api.service not found. As the cluster has been untared and started with oc cluster up, that is not suprising the command below does not work, but how then to restart ? – user2668735 Apr 25 '19 at 18:32