How can we set nodetool and cqlsh to be run from anywhere and by any user on linux server

无人久伴 提交于 2019-12-25 07:58:26

问题


I am trying to setup environment variables so that any user on a particular server can run commands like nodetool or cqlsh from any where in linux file system . The effort to traverse to bin directory everytime should be saved . How can we achieve this ? My DSE 4.8 is a tarball install .


回答1:


  • Nodetool is usually available to any user that has execution privileges in your linux boxes
  • For cqlsh, you can set any configuration inside the cqlshrc file (usually found in $HOME/.cassandra/cqlshrc; we have used to enable client-node encryption but has more configurable options



回答2:


To setup environment variable just follow some steps from root user:

# vi /etc/profile.d/cassandra.sh

Add the following lines to the cassandra.sh file-

export CASSANDRA_HOME=/opt/apache-cassandra-3.0.8
export CASSANDRA_CONF_DIR=/opt/apache-cassandra-3.0.8/conf

Here /opt/ is my directory, where I've extracted my apache-cassandra-3.0.8-bin.tar.gz tarball.

After adding those lines to cassandra.sh, save and exit. Then-

# source /etc/profile.d/cassandra.sh


来源:https://stackoverflow.com/questions/39892849/how-can-we-set-nodetool-and-cqlsh-to-be-run-from-anywhere-and-by-any-user-on-lin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!