Should I change value of mongo bean when deploying

2019-09-17 09:29发布

So, I am deploying my spring web app in tomcat server in production environment. I have my production server ip address. Should I replace the value of mongo bean from localhost to my ipaddress, in order to access the db?

<!-- Factory bean that creates the Mongo instance -->
<bean id="mongo" class="org.springframework.data.mongodb.core.MongoFactoryBean">
    <property name="host" value="localhost" />
</bean>

What else should I change, in order to make my web app work with mongodb in production environment?

1条回答
一夜七次
2楼-- · 2019-09-17 10:27

You need to change all the relevant details in wht mongo bean to point to your production database. If you are hosting it externally (i.e. not on localhost) then you need to point it to URL and potentially port as well to ensure you have connectivity. Don't forget login details as well, i've made that mistake a lot of times.

查看更多
登录 后发表回答