forked from apache/rocketmq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export bin directory. reviewed by @zhouxinyu @vongosling
- Loading branch information
1 parent
95df4b7
commit 191f5c2
Showing
28 changed files
with
1,065 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
### 操作系统调优 | ||
在生产环境部署Broker前,必须要执行os.sh,对操作系统进行调优 | ||
|
||
**P.S: os.sh只能执行一次,需要sudo root权限** | ||
|
||
### 启动broker | ||
* Unix平台 | ||
|
||
`nohup sh mqbroker &` | ||
|
||
* Windows平台(仅支持64位) | ||
|
||
`mqbroker.exe` | ||
|
||
### 关闭broker | ||
sh mqshutdown broker | ||
|
||
### 启动Name Server | ||
* Unix平台 | ||
|
||
`nohup sh mqnamesrv &` | ||
|
||
* Windows平台(仅支持64位) | ||
|
||
`mqnamesrv.exe` | ||
|
||
### 关闭Name Server | ||
sh mqshutdown namesrv | ||
|
||
### 更新或创建Topic | ||
sh mqadmin updateTopic -b 127.0.0.1:10911 -t TopicA | ||
|
||
### 更新或创建订阅组 | ||
sh mqadmin updateSubGroup -b 127.0.0.1:10911 -g SubGroupA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/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 regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
export PATH=$PATH:/sbin | ||
|
||
while true; do | ||
nr_free_pages=`fgrep -A 10 Normal /proc/zoneinfo |grep nr_free_pages |awk -F ' ' '{print $2}'` | ||
high=`fgrep -A 10 Normal /proc/zoneinfo |grep high |awk -F ' ' '{print $2}'` | ||
|
||
NOW_DATE=`date +%D` | ||
NOW_TIME=`date +%T` | ||
|
||
if [ ${nr_free_pages} -le ${high} ]; then | ||
sysctl -w vm.drop_caches=3 | ||
nr_free_pages_new=`fgrep -A 10 Normal /proc/zoneinfo |grep nr_free_pages |awk -F ' ' '{print $2}'` | ||
|
||
printf "%s %s [CLEAN] nr_free_pages < high, clean cache. nr_free_pages=%s ====> nr_free_pages=%s\n" "${NOW_DATE}" "${NOW_TIME}" ${nr_free_pages} ${nr_free_pages_new} | ||
|
||
sysctl -w vm.drop_caches=1 | ||
echo | ||
echo | ||
echo | ||
else | ||
printf "%s %s [NOTHING] nr_free_pages=%s high=%s\n" "${NOW_DATE}" "${NOW_TIME}" ${nr_free_pages} ${high} | ||
fi | ||
|
||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/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 regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
export PATH=$PATH:/sbin | ||
|
||
sysctl -w vm.drop_caches=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/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 regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
export PATH=$PATH:/sbin | ||
|
||
# | ||
# GB | ||
# | ||
function changeFreeCache() | ||
{ | ||
EXTRA=$1 | ||
MIN=$2 | ||
sysctl -w vm.extra_free_kbytes=${EXTRA}000000 | ||
sysctl -w vm.min_free_kbytes=${MIN}000000 | ||
} | ||
|
||
|
||
if [ $# -ne 1 ] | ||
then | ||
echo "Usage: $0 freecache(GB)" | ||
echo "Example: $0 15" | ||
exit | ||
fi | ||
|
||
changeFreeCache 3 $1 | ||
changeFreeCache 3 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/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 regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
if [ -z "$ROCKETMQ_HOME" ] ; then | ||
## resolve links - $0 may be a link to maven's home | ||
PRG="$0" | ||
|
||
# need this for relative symlinks | ||
while [ -h "$PRG" ] ; do | ||
ls=`ls -ld "$PRG"` | ||
link=`expr "$ls" : '.*-> \(.*\)$'` | ||
if expr "$link" : '/.*' > /dev/null; then | ||
PRG="$link" | ||
else | ||
PRG="`dirname "$PRG"`/$link" | ||
fi | ||
done | ||
|
||
saveddir=`pwd` | ||
|
||
ROCKETMQ_HOME=`dirname "$PRG"`/.. | ||
|
||
# make it fully qualified | ||
ROCKETMQ_HOME=`cd "$ROCKETMQ_HOME" && pwd` | ||
|
||
cd "$saveddir" | ||
fi | ||
|
||
export ROCKETMQ_HOME | ||
|
||
sh ${ROCKETMQ_HOME}/bin/tools.sh com.alibaba.rocketmq.tools.command.MQAdminStartup $@ |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!-- | ||
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 regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
<java> | ||
<debug>false</debug> | ||
|
||
<javahome>${JAVA_HOME}</javahome> | ||
|
||
<jvmtype>server</jvmtype> | ||
|
||
<mainclass>com.alibaba.rocketmq.tools.command.MQAdminStartup</mainclass> | ||
|
||
<properties> | ||
<java.ext.dirs>${cpd}/../lib</java.ext.dirs> | ||
<rocketmq.home.dir>${cpd}/..</rocketmq.home.dir> | ||
</properties> | ||
|
||
<classpaths> | ||
</classpaths> | ||
|
||
<options> | ||
<-Xms512m></-Xms512m> | ||
<-Xmx1g></-Xmx1g> | ||
<-XX:NewSize>256M</-XX:NewSize> | ||
<-XX:MaxNewSize>512M</-XX:MaxNewSize> | ||
<-XX:PermSize>128M</-XX:PermSize> | ||
<-XX:MaxPermSize>128M</-XX:MaxPermSize> | ||
</options> | ||
</java> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/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 regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
if [ -z "$ROCKETMQ_HOME" ] ; then | ||
## resolve links - $0 may be a link to maven's home | ||
PRG="$0" | ||
|
||
# need this for relative symlinks | ||
while [ -h "$PRG" ] ; do | ||
ls=`ls -ld "$PRG"` | ||
link=`expr "$ls" : '.*-> \(.*\)$'` | ||
if expr "$link" : '/.*' > /dev/null; then | ||
PRG="$link" | ||
else | ||
PRG="`dirname "$PRG"`/$link" | ||
fi | ||
done | ||
|
||
saveddir=`pwd` | ||
|
||
ROCKETMQ_HOME=`dirname "$PRG"`/.. | ||
|
||
# make it fully qualified | ||
ROCKETMQ_HOME=`cd "$ROCKETMQ_HOME" && pwd` | ||
|
||
cd "$saveddir" | ||
fi | ||
|
||
export ROCKETMQ_HOME | ||
|
||
rm -f $HOME/rmq_bk_gc.log.bac | ||
cp $HOME/rmq_bk_gc.log $HOME/rmq_bk_gc.log.bac | ||
sh ${ROCKETMQ_HOME}/bin/runbroker.sh com.alibaba.rocketmq.broker.BrokerStartup $@ |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/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 regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
if [ -z "$ROCKETMQ_HOME" ] ; then | ||
## resolve links - $0 may be a link to maven's home | ||
PRG="$0" | ||
|
||
# need this for relative symlinks | ||
while [ -h "$PRG" ] ; do | ||
ls=`ls -ld "$PRG"` | ||
link=`expr "$ls" : '.*-> \(.*\)$'` | ||
if expr "$link" : '/.*' > /dev/null; then | ||
PRG="$link" | ||
else | ||
PRG="`dirname "$PRG"`/$link" | ||
fi | ||
done | ||
|
||
saveddir=`pwd` | ||
|
||
ROCKETMQ_HOME=`dirname "$PRG"`/.. | ||
|
||
# make it fully qualified | ||
ROCKETMQ_HOME=`cd "$ROCKETMQ_HOME" && pwd` | ||
|
||
cd "$saveddir" | ||
fi | ||
|
||
export ROCKETMQ_HOME | ||
|
||
export RMQ_NUMA_NODE=0 | ||
|
||
sh ${ROCKETMQ_HOME}/bin/mqbroker $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/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 regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
if [ -z "$ROCKETMQ_HOME" ] ; then | ||
## resolve links - $0 may be a link to maven's home | ||
PRG="$0" | ||
|
||
# need this for relative symlinks | ||
while [ -h "$PRG" ] ; do | ||
ls=`ls -ld "$PRG"` | ||
link=`expr "$ls" : '.*-> \(.*\)$'` | ||
if expr "$link" : '/.*' > /dev/null; then | ||
PRG="$link" | ||
else | ||
PRG="`dirname "$PRG"`/$link" | ||
fi | ||
done | ||
|
||
saveddir=`pwd` | ||
|
||
ROCKETMQ_HOME=`dirname "$PRG"`/.. | ||
|
||
# make it fully qualified | ||
ROCKETMQ_HOME=`cd "$ROCKETMQ_HOME" && pwd` | ||
|
||
cd "$saveddir" | ||
fi | ||
|
||
export ROCKETMQ_HOME | ||
|
||
export RMQ_NUMA_NODE=1 | ||
|
||
sh ${ROCKETMQ_HOME}/bin/mqbroker $@ |
Oops, something went wrong.