Git Product home page Git Product logo

Comments (10)

peterzhuamazon avatar peterzhuamazon commented on July 17, 2024 2

Thanks @cebor @JSkier21
Seems like /etc/profile, /etc/profile.d are both working on Bash, while default Bourne Shell only works with ~/.profile.

I have setup the ENV directly in dockerfile this time, seems working: #944


$ docker exec -it ostest bash -c "cd plugins/opensearch-security/tools && ./securityadmin.sh -cd ../securityconfig/ -icl -nhnv -cacert ../../../config/root-ca.pem -cert ../../../config/kirk.pem -key ../../../config/kirk-key.pem"
Security Admin v7
Will connect to localhost:9300 ... done
Connected as CN=kirk,OU=client,O=client,L=test,C=de
OpenSearch Version: 1.1.0
OpenSearch Security Version: 1.1.0.0
Contacting opensearch cluster 'opensearch' and wait for YELLOW clusterstate ...
Clustername: docker-cluster
Clusterstate: GREEN
Number of nodes: 1
Number of data nodes: 1
.opendistro_security index already exists, so we do not need to create one.
Populate config from /usr/share/opensearch/plugins/opensearch-security/securityconfig
Will update '_doc/config' with ../securityconfig/config.yml
   SUCC: Configuration for 'config' created or updated
Will update '_doc/roles' with ../securityconfig/roles.yml
   SUCC: Configuration for 'roles' created or updated
Will update '_doc/rolesmapping' with ../securityconfig/roles_mapping.yml
   SUCC: Configuration for 'rolesmapping' created or updated
Will update '_doc/internalusers' with ../securityconfig/internal_users.yml
   SUCC: Configuration for 'internalusers' created or updated
Will update '_doc/actiongroups' with ../securityconfig/action_groups.yml
   SUCC: Configuration for 'actiongroups' created or updated
Will update '_doc/tenants' with ../securityconfig/tenants.yml
   SUCC: Configuration for 'tenants' created or updated
Will update '_doc/nodesdn' with ../securityconfig/nodes_dn.yml
   SUCC: Configuration for 'nodesdn' created or updated
Will update '_doc/whitelist' with ../securityconfig/whitelist.yml
   SUCC: Configuration for 'whitelist' created or updated
Will update '_doc/audit' with ../securityconfig/audit.yml
   SUCC: Configuration for 'audit' created or updated
Done with success

$ docker exec -it ostest bash -c "env"
HOSTNAME=ac1f16b539e0
TERM=xterm
LD_LIBRARY_PATH=:/usr/share/opensearch/plugins/opensearch-knn/knnlib
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/share/opensearch/jdk/bin
PWD=/usr/share/opensearch
JAVA_HOME=/usr/share/opensearch/jdk
discovery.type=single-node
SHLVL=1
HOME=/usr/share/opensearch
_=/usr/bin/env

$ docker exec -it ostest sh -c "env"
HOSTNAME=3d9af79ddeff
TERM=xterm
LD_LIBRARY_PATH=:/usr/share/opensearch/plugins/opensearch-knn/knnlib
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/share/opensearch/jdk/bin
PWD=/usr/share/opensearch
JAVA_HOME=/usr/share/opensearch/jdk
discovery.type=single-node
SHLVL=1
HOME=/usr/share/opensearch
_=/usr/bin/env

from opensearch-build.

cebor avatar cebor commented on July 17, 2024 1

Steps to reproduce:

# start container
docker run --name ostest --rm -e "discovery.type=single-node" opensearchproject/opensearch:1.1.0

# run securityadmin.sh
docker exec -it ostest bash -c "cd plugins/opensearch-security/tools && ./securityadmin.sh -cd ../securityconfig/ -icl -nhnv -cacert ../../../config/root-ca.pem -cert ../../../config/kirk.pem -key ../../../config/kirk-key.pem"

from opensearch-build.

MichaelRoosz avatar MichaelRoosz commented on July 17, 2024

Should I create a PR for this? 1.0.0 release is coming soon.

from opensearch-build.

peterzhuamazon avatar peterzhuamazon commented on July 17, 2024

Seems like AdoptOpenJDK installation does not add the JAVA_HOME to profile.
Also, we change the dockerfile which directly take the bundled JDK from tarball thus ignored the setup of JAVA_HOME.
We have identified a fix now and will apply it in the next release.
Thanks.

from opensearch-build.

peterzhuamazon avatar peterzhuamazon commented on July 17, 2024

Add fix PR.

from opensearch-build.

cebor avatar cebor commented on July 17, 2024

This issue is still in version 1.1.0!

from opensearch-build.

peterzhuamazon avatar peterzhuamazon commented on July 17, 2024

This issue is still in version 1.1.0!

Please give detailed description of what is the issues so we can take a look @cebor 😄

from opensearch-build.

cebor avatar cebor commented on July 17, 2024

This issue is still in version 1.1.0!

Please give detailed description of what is the issues so we can take a look @cebor 😄

JAVA_HOME env var is not set, and so its not possible to run securityadmin.sh out of the box.

Issues is also described by the author above. ;-)

from opensearch-build.

peterzhuamazon avatar peterzhuamazon commented on July 17, 2024

This issue is still in version 1.1.0!

Please give detailed description of what is the issues so we can take a look @cebor 😄

JAVA_HOME env var is not set, and so its not possible to run securityadmin.sh out of the box.

Issues is also described by the author above. ;-)

Can you show your full step on how to produce this?
I just checked and java home is set on my side.
Thanks.

from opensearch-build.

JSkier21 avatar JSkier21 commented on July 17, 2024

Also have this issue. Running in Podman, OS1.1.0 JAVA_HOME is blank, can't run those tools either.

Update:
Looks like the variable is there in a bash shell, but not the sh shell. Confirmed running sh with bash or going into bash shell in console and it works.

from opensearch-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.