使用“./bin/cassandra -f”启动cassandra,如何恢复终端窗口?

发布于 2024-10-16 05:40:51 字数 3647 浏览 3 评论 0原文

当使用./bin/cassandra -f时,它显示:

Cz@z-EX465-MX:~/cassandra$ ./bin/cassandra -f
 INFO 09:12:19,460 Logging initialized
 INFO 09:12:19,484 Heap size: 1033895936/1033895936
 INFO 09:12:19,486 JNA not found. Native methods will be disabled.
 INFO 09:12:19,501 Loading settings from file:/home/z/cassandra/conf/cassandra.yaml
 INFO 09:12:19,711 DiskAccessMode 'auto' determined to be standard, indexAccessMode is standard
 INFO 09:12:19,829 Creating new commitlog segment /var/lib/cassandra/commitlog/CommitLog-1297127539829.log
 INFO 09:12:19,888 Deleted /var/lib/cassandra/data/system/LocationInfo-f-12
 INFO 09:12:19,889 Deleted /var/lib/cassandra/data/system/LocationInfo-f-9
 INFO 09:12:19,890 Deleted /var/lib/cassandra/data/system/LocationInfo-f-11
 INFO 09:12:19,891 Deleted /var/lib/cassandra/data/system/LocationInfo-f-10
 INFO 09:12:19,939 reading saved cache /var/lib/cassandra/saved_caches/system-IndexInfo-KeyCache
 INFO 09:12:19,946 reading saved cache /var/lib/cassandra/saved_caches/system-Schema-KeyCache
 INFO 09:12:19,949 reading saved cache /var/lib/cassandra/saved_caches/system-Migrations-KeyCache
 INFO 09:12:19,952 reading saved cache /var/lib/cassandra/saved_caches/system-LocationInfo-KeyCache
 INFO 09:12:19,962 Opening /var/lib/cassandra/data/system/LocationInfo-f-13
 INFO 09:12:19,984 reading saved cache /var/lib/cassandra/saved_caches/system-HintsColumnFamily-KeyCache
 INFO 09:12:20,043 Couldn't detect any schema definitions in local storage.
 INFO 09:12:20,045 Found table data in data directories. Consider using JMX to call org.apache.cassandra.service.StorageService.loadSchemaFromYaml().
 INFO 09:12:20,058 Replaying /var/lib/cassandra/commitlog/CommitLog-1297127304757.log
 INFO 09:12:20,060 Finished reading /var/lib/cassandra/commitlog/CommitLog-1297127304757.log
 INFO 09:12:20,061 Log replay complete
 INFO 09:12:20,147 Cassandra version: 0.7.1-SNAPSHOT
 INFO 09:12:20,147 Thrift API version: 19.4.0
 INFO 09:12:20,168 Loading persisted ring state
 INFO 09:12:20,175 Starting up server gossip
 INFO 09:12:20,195 switching in a fresh Memtable for LocationInfo at CommitLogContext(file='/var/lib/cassandra/commitlog/CommitLog-1297127539829.log', position=89)
 INFO 09:12:20,197 Enqueuing flush of Memtable-LocationInfo@14850080(29 bytes, 1 operations)
 INFO 09:12:20,199 Writing Memtable-LocationInfo@14850080(29 bytes, 1 operations)
 INFO 09:12:20,604 Completed flushing /var/lib/cassandra/data/system/LocationInfo-f-14-Data.db (80 bytes)
 INFO 09:12:20,623 Starting Messaging Service on port 7000
 INFO 09:12:20,669 Using saved token 66456586001264063553489133185713650713
 INFO 09:12:20,670 switching in a fresh Memtable for LocationInfo at CommitLogContext(file='/var/lib/cassandra/commitlog/CommitLog-1297127539829.log', position=270)
 INFO 09:12:20,671 Enqueuing flush of Memtable-LocationInfo@5006112(53 bytes, 2 operations)
 INFO 09:12:20,671 Writing Memtable-LocationInfo@5006112(53 bytes, 2 operations)
 INFO 09:12:20,938 Completed flushing /var/lib/cassandra/data/system/LocationInfo-f-15-Data.db (163 bytes)
 INFO 09:12:20,945 Will not load MX4J, mx4j-tools.jar is not in the classpath
 INFO 09:12:21,008 Binding thrift service to localhost/127.0.0.1:9160
 INFO 09:12:21,013 Using TFastFramedTransport with a max frame size of 15728640 bytes.
 INFO 09:12:21,016 Listening for thrift clients...

所以当浏览127.0.0.1:9160时,它显示空白的白色页面。但除了按 Ctrl+c 并停止 cassandra 之外,我无法使用此终端窗口。

我正在寻找是否可以使用 ./bin/cassandra -f & 返回终端窗口,但是在尝试 pgrep thriftpgrep cassandra< /code>,我什么也没找到。使用其他终端窗口时我不知道如何停止它

when using ./bin/cassandra -f, it shows:

Cz@z-EX465-MX:~/cassandra$ ./bin/cassandra -f
 INFO 09:12:19,460 Logging initialized
 INFO 09:12:19,484 Heap size: 1033895936/1033895936
 INFO 09:12:19,486 JNA not found. Native methods will be disabled.
 INFO 09:12:19,501 Loading settings from file:/home/z/cassandra/conf/cassandra.yaml
 INFO 09:12:19,711 DiskAccessMode 'auto' determined to be standard, indexAccessMode is standard
 INFO 09:12:19,829 Creating new commitlog segment /var/lib/cassandra/commitlog/CommitLog-1297127539829.log
 INFO 09:12:19,888 Deleted /var/lib/cassandra/data/system/LocationInfo-f-12
 INFO 09:12:19,889 Deleted /var/lib/cassandra/data/system/LocationInfo-f-9
 INFO 09:12:19,890 Deleted /var/lib/cassandra/data/system/LocationInfo-f-11
 INFO 09:12:19,891 Deleted /var/lib/cassandra/data/system/LocationInfo-f-10
 INFO 09:12:19,939 reading saved cache /var/lib/cassandra/saved_caches/system-IndexInfo-KeyCache
 INFO 09:12:19,946 reading saved cache /var/lib/cassandra/saved_caches/system-Schema-KeyCache
 INFO 09:12:19,949 reading saved cache /var/lib/cassandra/saved_caches/system-Migrations-KeyCache
 INFO 09:12:19,952 reading saved cache /var/lib/cassandra/saved_caches/system-LocationInfo-KeyCache
 INFO 09:12:19,962 Opening /var/lib/cassandra/data/system/LocationInfo-f-13
 INFO 09:12:19,984 reading saved cache /var/lib/cassandra/saved_caches/system-HintsColumnFamily-KeyCache
 INFO 09:12:20,043 Couldn't detect any schema definitions in local storage.
 INFO 09:12:20,045 Found table data in data directories. Consider using JMX to call org.apache.cassandra.service.StorageService.loadSchemaFromYaml().
 INFO 09:12:20,058 Replaying /var/lib/cassandra/commitlog/CommitLog-1297127304757.log
 INFO 09:12:20,060 Finished reading /var/lib/cassandra/commitlog/CommitLog-1297127304757.log
 INFO 09:12:20,061 Log replay complete
 INFO 09:12:20,147 Cassandra version: 0.7.1-SNAPSHOT
 INFO 09:12:20,147 Thrift API version: 19.4.0
 INFO 09:12:20,168 Loading persisted ring state
 INFO 09:12:20,175 Starting up server gossip
 INFO 09:12:20,195 switching in a fresh Memtable for LocationInfo at CommitLogContext(file='/var/lib/cassandra/commitlog/CommitLog-1297127539829.log', position=89)
 INFO 09:12:20,197 Enqueuing flush of Memtable-LocationInfo@14850080(29 bytes, 1 operations)
 INFO 09:12:20,199 Writing Memtable-LocationInfo@14850080(29 bytes, 1 operations)
 INFO 09:12:20,604 Completed flushing /var/lib/cassandra/data/system/LocationInfo-f-14-Data.db (80 bytes)
 INFO 09:12:20,623 Starting Messaging Service on port 7000
 INFO 09:12:20,669 Using saved token 66456586001264063553489133185713650713
 INFO 09:12:20,670 switching in a fresh Memtable for LocationInfo at CommitLogContext(file='/var/lib/cassandra/commitlog/CommitLog-1297127539829.log', position=270)
 INFO 09:12:20,671 Enqueuing flush of Memtable-LocationInfo@5006112(53 bytes, 2 operations)
 INFO 09:12:20,671 Writing Memtable-LocationInfo@5006112(53 bytes, 2 operations)
 INFO 09:12:20,938 Completed flushing /var/lib/cassandra/data/system/LocationInfo-f-15-Data.db (163 bytes)
 INFO 09:12:20,945 Will not load MX4J, mx4j-tools.jar is not in the classpath
 INFO 09:12:21,008 Binding thrift service to localhost/127.0.0.1:9160
 INFO 09:12:21,013 Using TFastFramedTransport with a max frame size of 15728640 bytes.
 INFO 09:12:21,016 Listening for thrift clients...

so when browse 127.0.0.1:9160, it shows blank white page. but I cannot use this terminal window except pressing Ctrl+c and stop cassandra.

I'm looking if I can use ./bin/cassandra -f & to have back the terminal window, but when trying pgrep thrift or pgrep cassandra, I found nothing. I dont know how to stop it when using other terminal window

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

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

发布评论

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

评论(6

紫罗兰の梦幻 2024-10-23 05:40:51

-f 用于前景。如果您希望 Cassandra 进行守护进程,则忽略它即可。

The -f is for foreground. Just omit it, if you want Cassandra to daemonize.

时光匆匆的小流年 2024-10-23 05:40:51

解决了。
使用pgrep java查看进程

solved.
use pgrep java to see the process

策马西风 2024-10-23 05:40:51

在 *nix 系统上,您应该能够输入 ctrl-z 来停止前台 cassandra 进程。这会给你一个提示,如果你在提示下输入 bg,cassandra 进程将进入后台。您可以对需要后台运行的任何前台进程执行此操作。

On a *nix system, you should be able to type ctrl-z to halt the foreground cassandra process. That will give you a prompt, if you then type bg at the prompt, the cassandra process will be backgrounded. You can do this with any foreground process that you need to background.

╭ゆ眷念 2024-10-23 05:40:51

如果您确实使用了 -f& 的组合,那么您的工作将在后台进行。

您只需输入:

fg

将其带回到前台,然后按 CTRL-C

或使用:

jobs

查看后台有什么。那么您可以将 fg 与工作编号一起使用。

您还可以使用 CTRL-Z 暂停终端上当前正在运行的任何内容,然后使用:

bg

将其置于后台。

这是一个示例会话,我运行 tail 两次并演示将其打开和关闭终端

rob@deathstar:~$ tail -f /var/log/messages &
[1] 13074                                            <-- that's the PID :) 
rob@deathstar:~$ tail -f /var/log/daemon.log &
[2] 13089
rob@deathstar:~$ jobs
[1]-  Running                 tail -f /var/log/messages &
[2]+  Running                 tail -f /var/log/daemon.log &
rob@deathstar:~$ fg 1
tail -f /var/log/messages
^Z
[1]+  Stopped                 tail -f /var/log/messages
rob@deathstar:~$ bg
[1]+ tail -f /var/log/messages &
rob@deathstar:~$ jobs
[1]-  Running                 tail -f /var/log/messages &
[2]+  Running                 tail -f /var/log/daemon.log &
rob@deathstar:~$ fg 2
tail -f /var/log/daemon.log
^Z
[2]+  Stopped                 tail -f /var/log/daemon.log
rob@deathstar:~$ bg
[2]+ tail -f /var/log/daemon.log &
rob@deathstar:~$ jobs
[1]-  Running                 tail -f /var/log/messages &
[2]+  Running                 tail -f /var/log/daemon.log &
rob@deathstar:~$ 

if you do use a combination of -f and & then your job is in the background.

you can just enter:

fg

to bring it back to the foreground and then CTRL-C

or use:

jobs

to see what you have in the background. then you can use fg with the job number.

You can also use CTRL-Z to suspend whatever is currently running on the terminal, then use:

bg

to background it.

Here is an example session where I run tail twice and demonstrate putting it on and off the terminal

rob@deathstar:~$ tail -f /var/log/messages &
[1] 13074                                            <-- that's the PID :) 
rob@deathstar:~$ tail -f /var/log/daemon.log &
[2] 13089
rob@deathstar:~$ jobs
[1]-  Running                 tail -f /var/log/messages &
[2]+  Running                 tail -f /var/log/daemon.log &
rob@deathstar:~$ fg 1
tail -f /var/log/messages
^Z
[1]+  Stopped                 tail -f /var/log/messages
rob@deathstar:~$ bg
[1]+ tail -f /var/log/messages &
rob@deathstar:~$ jobs
[1]-  Running                 tail -f /var/log/messages &
[2]+  Running                 tail -f /var/log/daemon.log &
rob@deathstar:~$ fg 2
tail -f /var/log/daemon.log
^Z
[2]+  Stopped                 tail -f /var/log/daemon.log
rob@deathstar:~$ bg
[2]+ tail -f /var/log/daemon.log &
rob@deathstar:~$ jobs
[1]-  Running                 tail -f /var/log/messages &
[2]+  Running                 tail -f /var/log/daemon.log &
rob@deathstar:~$ 
少女七分熟 2024-10-23 05:40:51

使用

./cassandra -f pid.txt

您的进程将自动在后台运行并将进程 ID 推送到文件中。使用 pid.txt 中的进程 ID 有助于停止 cassandra 进程。

Use

./cassandra -f pid.txt

Your process will run in background automatically and push the process id into a file. Will be helpful to stop cassandra process using the process id in pid.txt.

深海蓝天 2024-10-23 05:40:51

在 Windows 的情况下......您需要再次重新启动集群,因为一旦服务在前台运行,集群将需要重新启动

In the case of Windows.... you would need to restart the cluster again as once the service is running in the foreground, the cluster will need to be restarted

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