There's no question that Stalin knew about the atomic bombs prior to the bombing of Japan. The USSR had many moles within the Manhattan Project and an extensive network of spies throughout the rest of the United States. They had several scientists on their end tasked with interpreting the espionage data, as well (they did not have the resources during WWII to commit to trying to build a bomb). So there is no question he knew. Certainly he knew what Truman was vaguely referring to in July 1945 when Truman told him, at the Potsdam Conference, that the US had a new weapon that they were going to use — he correctly understood that, from accounts of others there, to mean that the US had successfully tested an atomic bomb.
That being said, he certainly was not happy with the development. After Hiroshima he retreated to his dacha for a day to mope, according to sources in the USSR. This was less because he feared the bomb and more because he feared the US would end the war prior to the Soviet Union being able to declare war on Japan, which would mean that the USSR would have no claim to the territory it expected to get out of the war. But when Japan did not immediately surrender, he did two things: he ordered his invasion of Japan pushed up (it started late on August 8th), and he ordered that a full Soviet atomic bomb production project would be carried out, sparing no expense. The Soviet atomic project would ultimately require the labor of some 600,000 Soviet citizens (not all voluntary), to give an example of what the difference between the wartime work and the postwar production program meant.
Did Stalin feel betrayed? He certainly felt that it was clear that Truman was not trustworthy, since the latter (and the UK) had not included the USSR in the bomb work, and clearly deliberately lied to the USSR several times about it. In any event, he clearly understood that a world in which only the USA had nuclear weapons was untenable. It is reported that in 1949, after the USSR acquired its first nuclear weapons, he tasked the Soviet atomic and missile scientists to develop a means of hitting the USA directly, so that they could never be "like Japan" — vulnerable.
For details on the Soviet bomb program and espionage, a good read is Michael Gordin, Red Cloud at Dawn, as is David Holloway, Stalin and the Bomb.