sudo bash install.sh -g 安装 SAP 时出错“您选择的主机名在此服务器上无效”

sudo bash install.sh -g 安装 SAP 时出错“您选择的主机名在此服务器上无效”

在我的 Ubuntu 上安装 SAP 时本指南

sudo bash install.sh -g命令返回以下错误:

The hostname you have chosen is either configured on a loopback device
or not active on this server, please check your configuration and hostname selection.
If you are confident about the choice of your hostname, 
start the install script with -s flag to skip the hostname check.

/etc/hosts的配置如下:

127.0.0.1     localhost
192.168.0.105 vhcalnplci

其他行被注释

hostname返回vhcalnplci

ifconfig返回以下内容:

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.0.105  netmask 255.255.255.0  broadcast 192.168.0.255
    inet6 fe80::a00:27ff:fe60:f84c  prefixlen 64  scopeid 0x20<link>
    ether 08:00:27:60:f8:4c  txqueuelen 1000  (Ethernet)
    RX packets 432  bytes 44014 (44.0 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 101  bytes 10319 (10.3 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1000  (Local Loopback)
    RX packets 150  bytes 10747 (10.7 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 150  bytes 10747 (10.7 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

请告知我如何解决此问题。

答案1

问题出在 install.sh 中,ifconfig不要返回文本“addr”...我的解决方案:)

myip=`ifconfig | egrep "inet addr" | grep Bcast | awk '{ print $2 }' | awk -F ":" '{ print $2 }'`

结果 :

myip="192.168.0.105"

相关内容