[
https://issues.apache.org/jira/browse/HDDS-6453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17529876#comment-17529876
]
Attila Doroszlai commented on HDDS-6453:
----------------------------------------
Thanks [~jiangshouzhuang] for reporting this problem.
I think it should be fixed by option 1 (change output of getconf) instead of
option 2 (change start/stop scripts).
# In case of a single OM, the output can be a hostname or an IP address. The
modified script will not find OM if it is a hostname, hence OM will not be
started. (I'm adding a test case to catch this problem in HDDS-6669.)
# We should ensure content and formatting in the output for OM and SCM are
consistent.
I think the reason for a more structured output in OM HA case is that there may
be multiple OM services, and we need to distinguish among them. But the same
applies to SCM, where this information is missing.
My suggestion is this:
# Change {{ozone getconf -ozonemanagers}} to output a list of all OMs as a
plain list, one item per line (same as SCM). I think this is a reasonable
default behavior and it fixes the start/stop scripts. (code reference:
{{OzoneManagersCommandHandler}}, {{StorageContainerManagersCommandHandler}})
# Allow limiting the output to a specific service, both for OM and SCM.
# Add a new {{--json}} option to provide structured output (needs some tweaks
to make it valid JSON), both for OM and SCM.
This issue can be limited in scope to the first change, and we can file new
improvement issues for the rest.
CC [~kerneltime], [~umamaheswararao]
> Problems with the Ozone start and stop scripts
> ----------------------------------------------
>
> 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]