在Cassandra中使用CQLSH与SSL:更改CQLSHRC位置

发布于 2025-01-23 10:26:57 字数 132 浏览 6 评论 0原文

我想与SSL一起使用CQLSH。我遵循DataStax文档推荐的过程,效果很好。 但是,我想更改CQLSHRC文件的位置,而不是按照Cassandra文档中所述的 /myhomedirectry/.cassandra将其放置 怎么办? 感谢您的帮助。

I would like to use cqlsh with ssl. I followed the procedure recommended by the datastax documentation, and it worked well.
However, I would like to change the location of the cqlshrc file, and not place it in /myHomeDirectry/.cassandra as described in the cassandra documentation
how can this be done?
thanks for help..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡淡绿茶香 2025-01-30 10:26:57

您可以通过指定- - CQLSHRC选项和新的CQLSHRC文件位置在从命令行运行CQLSH时。

bin/cqlsh 192.168.0.1 -u aaron -p flynnL1ves --cqlshrc=../stackoverflow/cqlshrc

这是Apache Cassandra网站上文档的链接,以获取更多信息:

> 在bin/cqlsh.py中:

# BEGIN history/config definition
HISTORY_DIR = os.path.expanduser(os.path.join('~', '.cassandra'))

cqlsh存储cqlsh_history file file ,它还使用history_dir定义设置CQLSHRC文件的默认位置。在命令行上指定CQLSHRC文件的情况下,您需要通过在上面的os.path.join中指定目录名称来覆盖该默认位置。

请注意,这绝对是那些“以您自身的风险进行”时刻之一。

You can do this by specifying the —-cqlshrc option and new cqlshrc file location when running cqlsh from the command line.

bin/cqlsh 192.168.0.1 -u aaron -p flynnL1ves --cqlshrc=../stackoverflow/cqlshrc

Here's a link to the docs on the Apache Cassandra site for more info: https://cassandra.apache.org/doc/latest/cassandra/tools/cqlsh.html#cqlshrc

Edit -

The only other way to do this, is to modify this line in bin/cqlsh.py:

# BEGIN history/config definition
HISTORY_DIR = os.path.expanduser(os.path.join('~', '.cassandra'))

Cqlsh stores the cqlsh_history file in ~/.cassandra and it also uses that HISTORY_DIR definition to set the default location of the cqlshrc file. Without specifying the cqlshrc file on the command line, you'll need to override that default location by specifying the directory name(s) in the os.path.join above.

Note that this is definitely one of those "proceed at your own risk" moments.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文