我们如何设置nodetool和cqlsh使其可以在Linux服务器上的任何位置和任何用户运行 [英] How can we set nodetool and cqlsh to be run from anywhere and by any user on linux server
问题描述
我正在尝试设置环境变量,以便特定服务器上的任何用户都可以从linux文件系统中的任何位置运行诸如nodetool或cqlsh之类的命令.应该节省每次遍历到bin目录的精力. 我们怎样才能做到这一点?我的DSE 4.8是一个tarball安装.
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 .
推荐答案
要设置环境变量,只需遵循root用户的一些步骤:
To setup environment variable just follow some steps from root user:
# vi /etc/profile.d/cassandra.sh
将以下行添加到cassandra.sh
文件-
export CASSANDRA_HOME=/opt/apache-cassandra-3.0.8
export CASSANDRA_CONF_DIR=/opt/apache-cassandra-3.0.8/conf
这里/opt/
是我的目录,我在其中提取了apache-cassandra-3.0.8-bin.tar.gz
tarball.
Here /opt/
is my directory, where I've extracted my apache-cassandra-3.0.8-bin.tar.gz
tarball.
将这些行添加到cassandra.sh
之后,保存并退出.然后-
After adding those lines to cassandra.sh
, save and exit. Then-
# source /etc/profile.d/cassandra.sh
这篇关于我们如何设置nodetool和cqlsh使其可以在Linux服务器上的任何位置和任何用户运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!