I learned the hard way that shutting down the hortonworks vm 2.4 sandbox using the virtual box "Power Off" seems to corrupt the VM. What is the best procedure for shutting down the VM gently?
Yes, when I said "using Ambari", I was referring to the web interface. I apologize for not being more clear.
I'm not aware of a way to stop all services from the command line using as a single command. However, you can use the Ambari API to shutdown services individually. Unfortunately, you have to call the shutdown command for each service.
Running HDP 2.5
For 1. I used @Jasper approach
For 2. I was unable to use
[root@sandbox ~]# sudo shutdown now Broadcast message from email@example.com (/dev/pts/0) at 20:39 ... The system is going down for maintenance NOW! shutdown: Unable to shutdown system
[root@sandbox ~]# sudo init 0 init: Failed to connect to socket /com/ubuntu/upstart: Connection refused
but Close > "Send the shutdown signal" worked gracefully (as far as I can tell after restarting).
Running HDP sandbox 2.6.1 on VMware.
Can't execute the shutdown commands for the docker in Step 2 via SSH, with the same error messages that @Bob Heckel is getting.
The VMware Player window is useless, since it's interacting with the host VM, not with the hosted docker container for the sandbox.
Now my sandbox appears to be corrupted again, the host VM startup process is getting stuck on starting up the docker.
I am sure there was an architectural justification to migrate to using VM + docker vs. just VM, but it's not working out very well for users.
If you still wanted to shut down VirtualBox or any other VM player for that matter, there is an easy way to shut down all HDP services gracefully:
1. In Ambari goto > Hosts (http://<your_IP>:8080/#/main/hosts)
2. Select the 'Sandbox' by checking the 1 and only host in the list
3. On Actions > Filtered Hosts > Hosts > Stop all Components
This works for the Sandbox since all is concentrated on 1 server. It saves you the time to go over all services...
(Restarting all components this way is somewhat more complex since the sequence of restarting does take services dependencies into account. Generally it is a good idea to start HDFS first)