Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIGTOP-3922:zkcli.sh of Solr does not have executable permissions #1098

Merged
merged 3 commits into from
Apr 13, 2023

Conversation

guluo2016
Copy link
Contributor

Description of PR

Resolve issue BIGTOP-3922 by adding executable permissions to files in {SOLR_HOME}/server/scripts/cloud-scripts

How was this patch tested?

building Solr,
Checking the permissions of thoese files by installing Solr or decompressing Solr package

For code changes:

install_solr.sh

@iwasakims
Copy link
Member

@guluo2016 I guess the zkCli.sh was not used since the zookeeper is expected to be installed as package dependency. If the bundled script is crucial, you should add test case to smoke-tests for showing the use case.

Comment on lines 138 to 139
chmod 755 $PREFIX/$LIB_DIR/bin/*
chmod 755 $PREFIX/$LIB_DIR/server/scripts/cloud-scripts/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer applying chmod to specific file rather than using wildcard.

@guluo2016
Copy link
Contributor Author

@guluo2016 I guess the zkCli.sh was not used since the zookeeper is expected to be installed as package dependency. If the bundled script is crucial, you should add test case to smoke-tests for showing the use case.

solr's zkcli.sh and zookeeper's zkCli.sh are different.

This is the content of zookeeper's zkCli.sh.

"$JAVA" "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" "-Dzookeeper.log.file=${ZOO_LOG_FILE}" \
     -cp "$CLASSPATH" $CLIENT_JVMFLAGS $JVMFLAGS \
     org.apache.zookeeper.ZooKeeperMain "$@"

This is the content of solr's zkcli.sh.

PATH=$JAVA_HOME/bin:$PATH $JVM $SOLR_ZK_CREDS_AND_ACLS $ZKCLI_JVM_FLAGS -Dlog4j.configurationFile=$log4j_config \
-classpath "$sdir/../../solr-webapp/webapp/WEB-INF/lib/*:$sdir/../../lib/ext/*:$sdir/../../lib/*" org.apache.solr.cloud.ZkCLI ${1+"$@"}

solr's zkcli.sh is use to upload/download configs which is used by solr collection
for example:

zkcli.sh -zkhost localhost:9983 -cmd upconfig -confdir /opt/solr/collection1/conf -confname myconf
zkcli.sh -zkhost localhost:9983 -cmd downconfig -confdir /opt/solr/collection1/conf -confname myconf

Because zkcli.sh/zkcli.sh always executed directly, we should grant solr's zkcli.sh/zkcli.bat 755 permission.

For smoke-tests,I can try adding some test cases later in other tasks if there are necessary.

Copy link
Member

@iwasakims iwasakims left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm going to wait a bit for additional comments from another committers maintaining Solr before merging this.

@iwasakims iwasakims merged commit 75d2224 into apache:master Apr 13, 2023
@iwasakims
Copy link
Member

I merged this. Thanks for the contribution, @guluo2016.

@guluo2016 guluo2016 deleted the solr_zkcli branch April 17, 2023 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants