mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-4.0' into cassandra-4.1
This commit is contained in:
commit
ede18e6c9f
|
|
@ -19,6 +19,7 @@ Merged from 3.11:
|
|||
* Revert CASSANDRA-18543 (CASSANDRA-18854)
|
||||
* Fix NPE when using udfContext in UDF after a restart of a node (CASSANDRA-18739)
|
||||
Merged from 3.0:
|
||||
* Implement the logic in bin/stop-server (CASSANDRA-18838)
|
||||
* Upgrade snappy-java to 1.1.10.4 (CASSANDRA-18878)
|
||||
* Add cqlshrc.sample and credentials.sample into Debian package (CASSANDRA-18818)
|
||||
* Refactor validation logic in StorageService.rebuild (CASSANDRA-18803)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
|
|
@ -14,18 +16,59 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
show_help()
|
||||
{
|
||||
echo "Usage: $0 [-p <pidfile>] | [-l] | [-e] | [-h]"
|
||||
echo " -p <pidfile> Stop the process using the specified pidfile"
|
||||
echo " -l Stop the process with the name like 'cassandra'"
|
||||
echo " -e Stop the process with the name equal 'CassandraDaemon'"
|
||||
echo " -h Show the help message"
|
||||
}
|
||||
|
||||
echo "please read the stop-server script before use"
|
||||
kill_processes()
|
||||
{
|
||||
pids=$(pgrep -u "$(whoami)" -f "${1}")
|
||||
if [ -n "$pids" ]; then
|
||||
echo "$pids" | xargs kill -9
|
||||
fi
|
||||
}
|
||||
|
||||
# if you are using the cassandra start script with -p, this
|
||||
# is the best way to stop:
|
||||
if [ $# -eq 0 ]; then
|
||||
show_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# kill `cat <pidfile>`
|
||||
case "$1" in
|
||||
-p)
|
||||
if [ -z "$2" ]; then
|
||||
echo "missing pidfile argument after -p"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "$2" ]; then
|
||||
echo "pidfile $2 does not exist"
|
||||
exit 1
|
||||
fi
|
||||
# if you are using the cassandra start script with -p, this
|
||||
# is the best way to stop:
|
||||
kill "$(cat "$2")"
|
||||
;;
|
||||
-l)
|
||||
# you can run something like this, but
|
||||
# this is a shotgun approach and will kill other processes
|
||||
# with cassandra in their name or arguments too:
|
||||
kill_processes cassandra
|
||||
;;
|
||||
-e)
|
||||
kill_processes org.apache.cassandra.service.CassandraDaemon
|
||||
;;
|
||||
-h)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# otherwise, you can run something like this, but
|
||||
# this is a shotgun approach and will kill other processes
|
||||
# with cassandra in their name or arguments too:
|
||||
|
||||
# user=`whoami`
|
||||
# pgrep -u $user -f cassandra | xargs kill -9
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ patch -p1 < debian/patches/cassandra_logdir_fix.diff
|
|||
sed -i 's/^# hints_directory:/hints_directory:/' conf/cassandra.yaml
|
||||
|
||||
# remove other files not being installed
|
||||
rm -f bin/stop-server
|
||||
rm -f bin/*.orig
|
||||
rm -f bin/cassandra.in.sh
|
||||
rm -f lib/sigar-bin/*winnt* # strip segfaults on dll..
|
||||
|
|
@ -154,7 +155,6 @@ exit 0
|
|||
%attr(755,root,root) %{_bindir}/sstableupgrade
|
||||
%attr(755,root,root) %{_bindir}/sstableutil
|
||||
%attr(755,root,root) %{_bindir}/sstableverify
|
||||
%attr(755,root,root) %{_bindir}/stop-server
|
||||
%attr(755,root,root) %{_sbindir}/cassandra
|
||||
%attr(755,root,root) /%{_sysconfdir}/rc.d/init.d/%{username}
|
||||
%{_sysconfdir}/default/%{username}
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ patch -p1 < debian/patches/cassandra_logdir_fix.diff
|
|||
sed -i 's/^# hints_directory:/hints_directory:/' conf/cassandra.yaml
|
||||
|
||||
# remove other files not being installed
|
||||
rm -f bin/stop-server
|
||||
rm -f bin/*.orig
|
||||
rm -f bin/cassandra.in.sh
|
||||
rm -f lib/sigar-bin/*winnt* # strip segfaults on dll..
|
||||
|
|
@ -154,7 +155,6 @@ exit 0
|
|||
%attr(755,root,root) %{_bindir}/sstableupgrade
|
||||
%attr(755,root,root) %{_bindir}/sstableutil
|
||||
%attr(755,root,root) %{_bindir}/sstableverify
|
||||
%attr(755,root,root) %{_bindir}/stop-server
|
||||
%attr(755,root,root) %{_sbindir}/cassandra
|
||||
%attr(755,root,root) /%{_sysconfdir}/rc.d/init.d/%{username}
|
||||
%{_sysconfdir}/default/%{username}
|
||||
|
|
|
|||
Loading…
Reference in New Issue