3.shell 执行脚本安装二次开发后的Apache Dolphinscheduler时报‘$\r’ command not found

一、问题

运行二次开发后的Apache Dolphinscheduler安装脚本时报‘\r’ command not fand

执行命令

sh install.sh

已经安装好了就没必要去重现了,报错日志类似下图
在这里插入图片描述

二、解决

1.思路

\r\n是windows下默认的换行符
\n是linux下默认的换行符
看报错应该是和文件格式有关的问题
打开一个报错中出现的文件,查看格式

vim start-all.sh
:set ff

发现果然是dos

2、解决

下载dos2unix

yum -y install dos2unix

执行dos2unix 将脚本和配置文件的格式都转换成unix格式

cd $DOLPHINSCHEDULER_HOME/conf
[username@hostname conf]# dos2unix ./*
dos2unix: converting file ./alert.properties to Unix format ...
dos2unix: converting file ./application-api.properties to Unix format ...
dos2unix: converting file ./common.properties to Unix format ...
dos2unix: Skipping ./config, not a regular file.
dos2unix: converting file ./datasource.properties to Unix format ...
dos2unix: Skipping ./env, not a regular file.
dos2unix: Skipping ./i18n, not a regular file.
dos2unix: converting file ./logback-alert.xml to Unix format ...
dos2unix: converting file ./logback-api.xml to Unix format ...
dos2unix: converting file ./logback-master.xml to Unix format ...
dos2unix: converting file ./logback-worker.xml to Unix format ...
dos2unix: converting file ./master.properties to Unix format ...
dos2unix: Skipping ./org, not a regular file.
dos2unix: converting file ./quartz.properties to Unix format ...
dos2unix: converting file ./worker.properties to Unix format ...
dos2unix: converting file ./zookeeper.properties to Unix format ...

cd $DOLPHINSCHEDULER_HOME/bin
[username@hostname conf]# dos2unix ./*

此时conf和bin下的所有文件都已经变为unix
打开一个检查一下

vi $DOLPHINSCHEDULER_HOME/conf/common.properties
:set ff 

发现已经是unix了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值