我们如何设置nodetool和cqlsh使其可以在Linux服务器上的任何位置和任何用户运行 [英] How can we set nodetool and cqlsh to be run from anywhere and by any user on linux server

查看:133
本文介绍了我们如何设置nodetool和cqlsh使其可以在Linux服务器上的任何位置和任何用户运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置环境变量,以便特定服务器上的任何用户都可以从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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆