Have you started a roscore
in another terminal?
If not: that would be what you'd need to do. roscore
is the program that starts the "master".
If you want to know more about what "the master" does and is, see wiki/master.
PS:
I've just installed melodic
if you include this sort of statement in your question, please always link us to whatever guide or tutorial you followed. As-is, we can only assume you've installed Melodic in some way, but depending on which exact instructions you've followed, the error you mention could be caused by a nr of different things.
It's always good to be precise, and when asking for help, even more so.