Linux startup and stop scripts using SSH

I have a question. Actually I want to make two scripts, one is startup.sh and other is stopscript.sh
so for example, I have 5 servers.

Each server has two instances :-
abc111 - Masters
-cra4
abc222 -middle tear
-cra
abc333 -middle tear
-cra1
abc444 -middle tear
-cra2
abc555 -middle tear
-cra3

So when starting up a server, first I need to start my masters server first followed by cra4.
And then the next server, it should be middle tier followed by cra1. Same applies to other servers.
Basically when starting the servers i should start with masters first den cra4, middle tear first then cra, middle tear first then cra1, middle tear first then cra2, middle tear first then cra3.

And when stopping the servers, it should be opposite. for example, First i need stop the cra4 then masters, cra then middle tear, cra1 then middle tear, cra2 then middle tear, cra3 then middle tear.

So now I want to make my scripts to work in parallel for startup and for shutdown. I want to make a single scripts through which I can start all the servers one by one and also stop it one by one through ssh
And when we execute the startup or shutdown command, it should also ask me like :-
When we want to start: -

./startup.sh
1) masters 
2) cra
3) all
Please enter your choice inorder to start the services :- ?

Do you want read the logs for each service while startup :- ?
1) yes 
2) No 

And for stopscript.sh

./stopscript.sh 
1. masters
2. cra

Please enter your choice in order to stop the services 
1. Stop process
2. Force kill Process

Stop type :- ?

I also need to make a command to see all the running processes.
ex :- Command pshow will lists all the running process.
So anyone can help me with this please ?

I'm lost. How do you expect to use ssh to run commands on a server that is not running?