My IBM MobileFirst Platform 7.1 CLI-based server has some issues; how can I easily recreate it?

冷暖自知 提交于 2019-12-04 19:24:53

You might also give the "MFP eXtras" project a try --> https://github.com/kfbishop/mfpx

The mfpx kill command will stop server, kill processes, clean tmp dirs, etc. MFPX is not supported / endorsed by IBM, just me (and AndrewF :). Feedback welcomed.

This chain of commands forcibly kills your MobileFirst server, then deletes it and recreates it from scratch:

  • kill -9 $(cat ~/.ibm/mobilefirst/7.1.*/server/wlp/usr/servers/.pid/worklight.pid) - Forcibly kill your MobileFirst server using its process ID.
  • (sudo lsof -i tcp:10080 | awk "NR!=1 {print $2}" | xargs kill -9) - In case that missed it (in the rare case where it hasn't persisted its process ID correctly), kill any process listening on TCP port 10080. (Be careful. This assumes that MobileFirst is the only server which ever listens on TCP port 10080 on your system. If this is not the case, you may inadvertently kill another server.)
  • mfp server remove - Remove the MFP server using the MFP CLI
  • rm -R ~/.ibm/mobilefirst/7.1.*/ - Clean up any remaining logs and other junk.
  • rm -R $TMPDIR/wlBuildResources - Remove the wlBuildResources directory, which the CLI uses to build projects.
  • rm -R $TMPDIR/wlPreview - Remove the wlPreview directory, which the CLI uses to preview projects.
  • mfp server create && mfp start - Create a new server and start it.

On my system I have this entire chain set up as a shell alias to easily recreate my MFP server when needed.

The mfpx project also does something similar with the mfpx kill command.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!