The obsolete adjective hail meant free from injury, infirmity or disease. It is from Old Norse heill, meaning whole, hale, sound.
This Old Norse word is related to the English adjectives whole and hale, which are doublets, as they are both from Old English hāl. The current spelling of whole, which first appeared in the mid-15th century, originally reflected a dialectal pronunciation with w-. (The same phenomenon explains the initial w- in whore, which is from late Old English hōre.)
The obsolete English adjective hail occurred in greetings and toasts. In particular, the drinking formula wæs hæil, from Old Norse ves heill, meant be hale [= healthy]!. Hence the noun wassail, which was formerly a salutation used when presenting a cup of wine to a guest, or when drinking someone’s health, the reply being drink-hail.
And phrases such as Hail be thou expressed well-wishing or reverence. For example, about 1380, the English religious reformer John Wycliffe (circa 1330-1384) wrote:
Heil be þou, marie, ful of grace (= Hail be thou, Mary, full of grace).
Elliptically from these sentences, hail became an exclamation of greeting or salutation, corresponding to Latin salve and ave (cf. Ave Maria, Hail Mary). The English-Latin dictionary Promptorium parvulorum sive clericorum (Storehouse for Children or Clerics – around 1440) had the following definition:
Heyl, sede for gretynge [= said for greeting], ave, salve.
The familiar greeting Hail, fellow! gave rise to the adjectives hail-fellow and hail-fellow-well-met, meaning showing excessive familiarity or friendliness.
The greeting Well met! meant no more than the modern Good to see you!, and came to be tacked on to the adjectival hail-fellow as reinforcement. The English poet and playwright William Shakespeare (1564-1616) used this greeting for example in As you Like it (around 1599):
(Folio 1, 1623)
– Wel met honest Gentleman.
– By my troth well met : come, sit, sit, and a song.
The first recorded use of hail-fellow-well-met is in The ciuile conuersation of M. Steeuen Guazzo written first in Italian, and nowe translated out of French by George Pettie, deuided into foure bookes (1581), a translation by the English writer George Pettie (circa 1548-1589) of La civil conversazione (1574), by the Italian author Stefano Guazzo (1530-93):
Wee must set boundes and limites to all our doings, which we must not go beyond: I hold well with you yt [= that] the maister keep his state & degree, for being as you say haile fellow well met with his seruaunt, he should shewe himselfe to low minded, and not fitte to commaunde, and to bee as it were a seruaunt with seruauntes, which would redound to his reproch.