[root@localhost ~]# ll总用量 222704-rw-r--r--. 1 root root 44760203 5月 14 15:30 eureka-server-0.0.1-SNAPSHOT.jar-rw-r--r--. 1 root root 174204631 5月 14 15:13 jdk-8u162-linux-x64.rpmdrwxr-xr-x. 2 root root 6 6月 20 18:31 rocketmq-rw-r--r--. 1 root root 9080492 12月 18 2017 rocketmq-all-4.2.0-bin-release.zip[root@localhost ~]# unzip rocketmq-all-4.2.0-bin-release.zip -d rocketmqArchive: rocketmq-all-4.2.0-bin-release.zipcreating: rocketmq/conf/creating: rocketmq/conf/2m-2s-async/creating: rocketmq/conf/2m-2s-sync/creating: rocketmq/conf/2m-noslave/creating: rocketmq/benchmark/creating: rocketmq/bin/creating: rocketmq/lib/inflating: rocketmq/LICENSEinflating: rocketmq/conf/2m-2s-async/broker-a.properties....inflating: rocketmq/lib/guava-19.0.jar[root@localhost ~]# cd rocketmq[root@localhost rocketmq]# nohup sh bin/mqnamesrv &[1] 6846[root@localhost rocketmq]# nohup: 忽略输入并把输出追加到"nohup.out"[1]+ 退出 1 nohup sh bin/mqnamesrv[root@localhost rocketmq]# ll总用量 56drwxr-xr-x. 2 root root 83 12月 13 2017 benchmarkdrwxr-xr-x. 2 root root 4096 12月 13 2017 bindrwxr-xr-x. 5 root root 187 12月 13 2017 conf-rw-r--r--. 1 root root 14445 6月 20 18:32 hs_err_pid6852.logdrwxr-xr-x. 2 root root 4096 12月 13 2017 lib-rw-r--r--. 1 root root 17336 9月 19 2017 LICENSE-rw-------. 1 root root 717 6月 20 18:32 nohup.out-rw-r--r--. 1 root root 1337 10月 18 2017 NOTICE-rw-r--r--. 1 root root 2426 10月 18 2017 README.md
启动时jvm参数配置如下[root@localhost rocketmq]# cat nohup.outJava HotSpot(TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future releaseJava HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006ec800000, 2147483648, 0) failed; error='Cannot allocate memory' (errno=12)## There is insufficient memory for the Java Runtime Environment to continue.# Native memory allocation (mmap) failed to map 2147483648 bytes for committing reserved memory.# An error report file with more information is saved as:# /root/rocketmq/hs_err_pid6852.log[root@localhost rocketmq]#意思就是分配2g heap不够内存空间,为什么映射到2g位置时报错??
[root@localhost rocketmq]# cat bin/runserver.sh#!/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.#===========================================================================================# Java Environment Setting#===========================================================================================error_exit (){echo "ERROR: $1 !!"exit 1}[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=$HOME/jdk/java[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=/usr/java[ ! -e "$JAVA_HOME/bin/java" ] && error_exit "Please set the JAVA_HOME variable in your environment, We need java(x64)!"export JAVA_HOMEexport JAVA="$JAVA_HOME/bin/java"export BASE_DIR=$(dirname $0)/..export CLASSPATH=.:${BASE_DIR}/conf:${CLASSPATH}#===========================================================================================# JVM Configuration#===========================================================================================JAVA_OPT="${JAVA_OPT} -server -Xms4g -Xmx4g -Xmn2g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"JAVA_OPT="${JAVA_OPT} -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -XX:-UseParNewGC"JAVA_OPT="${JAVA_OPT} -verbose:gc -Xloggc:/dev/shm/rmq_srv_gc.log -XX:+PrintGCDetails"JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow"JAVA_OPT="${JAVA_OPT} -XX:-UseLargePages"JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${BASE_DIR}/lib"#JAVA_OPT="${JAVA_OPT} -Xdebug -Xrunjdwp:transport=dt_socket,address=9555,server=y,suspend=n"JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}"JAVA_OPT="${JAVA_OPT} -cp ${CLASSPATH}"$JAVA ${JAVA_OPT} $@
联系客服