运维小知识---If you insist running as root, then set the environment variable RUN_AS_USER=root...


If you insist running as root, then set theenvironment variable RUN_AS_USER=root before running this script.


        背景

        今天笔者在配置Nexus的时输入命令 ./nexus start后出现“ If you insist running as root, then set thee nvironment variable RUN_AS_USER=root before running this script. ”的警告信息。大概的意思是:如果你想使用root用户,那么在运行开始脚本之前应该设置环境变量”RUN_AS_USER=root"。

        

        解决方法

        关于这个问题共有两种解决方法,一种是临时解决,一种是永久的解决。


        临时方法

        

        输入:export RUN_AS_USER=root 后在执行 ./nexus start 运行结果如下图:

        运维小知识---If you insist running as root, then set the environment variable RUN_AS_USER=root..._第1张图片

        永久方法


        在系统用配置即可,输入:vi /etc/profile向其中加入exportRUN_AS_USER=root,修改后保存退出,如下图

        运维小知识---If you insist running as root, then set the environment variable RUN_AS_USER=root..._第2张图片

        修改完之后,先关闭nexus,再启动,如下图


        运维小知识---If you insist running as root, then set the environment variable RUN_AS_USER=root..._第3张图片

        简简单单的几步就OK啦


你可能感兴趣的:(linux,运维,nexus)