MOC3021 appropriate input resistance value for microcontroller application
According to the datasheet MOC3021 requires 15mA at T=25 degree C to be sure of triggering. You should add some to that to account for aging and lower temperatures, so maybe 20mA. 

If your microcontroller can safely source 20mA you can look at the minimum Vout(high) while sourcing 20mA to see what the resistor should be. 

Otherwise, either use a transistor to drive the LED or use a more sensitive optocoupler.