1832, in imitation of African-American vernacular; extended form of Lord (n.) as an interjection.
Entries linking to lordy
mid-13c., laverd, loverd, from Old English hlaford "master of a household, ruler, feudal lord, superior; husband," also "God," translating Latin dominus, Greek kyrios in the New Testament, Hebrew yahweh in the Old (though Old English dryhten was more frequent). Old English hlaford is a contraction of earlier hlafweard, literally "one who guards the loaves," from hlaf "bread, loaf" (see loaf (n.)) + weard "keeper, guardian" (from PIE root *wer- (3) "perceive, watch out for").
Compare lady (literally "bread-kneader"), and Old English hlafæta "household servant," literally "loaf-eater." For the contraction, compare Harold. The modern monosyllabic form emerged 14c. Meaning "an owner of land, houses, etc.," is from c. 1300; the sense in landlord. As the "usual polite or respectful form of address to a nobleman under the rank of a duke, and to a bishop" [OED] from 1540s. As an interjection from late 14c. Lords "peers of England," especially as represented in parliaments, is from mid-15c.
Lord's Prayer is from 1540s. Year of our Lord is from late 14c. (translating Latin anno domini) in reference to the incarnation of God in Christ. Lord knows (who, what, why, etc.), expressing a state of ignorance, is from 1711. Lord of the Flies (1907) translates Beelzebub (q.v.); William Golding's book was published in 1954. To drink like a lord is from 1620s.