[ 
https://issues.apache.org/jira/browse/HDDS-6453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530373#comment-17530373
 ] 

MLikeWater commented on HDDS-6453:
----------------------------------

[~adoroszlai] Thank you for your reply. Your idea is reasonable and needs to 
consider the single and cluster status, as well as the host name and IP.

The best way to do this is to change the output of ozone getconf -ozonemanagers 
 to suit the actual situation.

> Ozone start/stop script cannot resolve OM nodes in HA
> -----------------------------------------------------
>
>                 Key: HDDS-6453
>                 URL: https://issues.apache.org/jira/browse/HDDS-6453
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: Ozone Manager
>    Affects Versions: 1.2.1
>         Environment: Ozone version: ozone-1.2.1
> OS version: CentOS Linux release 7.8.2003 (Core)
>            Reporter: MLikeWater
>            Assignee: MLikeWater
>            Priority: Major
>              Labels: kubernetes, pull-request-available
>
> An error occurred while using Ozone's built-in start and stop script to 
> manage the cluster:
> {code:java}
> [hadoop@k8s-master01 ozone-1.2.1]$ start-ozone.sh 
> Starting datanodes
> Starting Ozone Manager nodes [{cluster1=[k8s-master01.ai.com/10.206.0.3:9862, 
> k8s-master02.ai.com/10.206.0.2:9862, k8s-master03.ai.com/10.206.0.8:9862]}]
> sed: -e expression #1, char 30: unknown option to `s'
> sed: -e expression #1, char 41: unknown option to `s'
> sed: -e expression #1, char 30: unknown option to `s'
> Starting storage container manager nodes [k8s-master02.ai.com
> k8s-master01.ai.com
> k8s-master03.ai.com] {code}
> After analyzing the script, run the following command:
> {code:java}
> ozone getconf -ozonemanagers {code}
> The result returned is:
> {code:java}
> {cluster1=[k8s-master01.ai.com/10.206.0.3:9862, 
> k8s-master02.ai.com/10.206.0.2:9862, 
> k8s-master03.ai.com/10.206.0.8:9862]}{code}
> Therefore, the script fails to parse host information.
>  
> There are two ways to solve this problem:
> 1. Modify the executable  script ozone to print the host name or IP address 
> list (similar to SCM),
> 2. The other way, simply process the returned result:
> {code:java}
> # Ozone ozonemanager nodes
> TMP_OM_NODES=$("${OZONE_HOME}/bin/ozone" getconf -ozonemanagers 2>/dev/null)
> OM_NODES=`echo $TMP_OM_NODES | grep -o '\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}' 
> | sort -d | uniq`
> echo "Starting Ozone Manager nodes [${OM_NODES}]"
> if [[ "${OM_NODES}" == "0.0.0.0" ]]; then
>   OM_NODES=$(hostname)
> fi
> ozone_uservar_su hdfs om "${OZONE_HOME}/bin/ozone" \
>   --workers \
>   --config "${OZONE_CONF_DIR}" \
>   --hostnames "${OM_NODES}" \
>   --daemon start \
>   om
> (( OZONE_JUMBO_RETCOUNTER=OZONE_JUMBO_RETCOUNTER + $? )){code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to