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