安裝MQ7.5指令碼

studywell發表於2017-05-09
安裝MQ7.5指令碼:

#!/bin/sh

echo "start to create users and roles..."
groupadd -g 994 mqm
mkdir /home/mqm
useradd -u 994 -g 994 -d /home/mqm mqm
chown -R mqm:mqm /home/mqm

echo "start to install mq...."
mkdir mqins
gunzip WS_MQ_LIN_ON_X86-64_V7.5.0.1_EIM.tar.gz    
tar -xvf WS_MQ_LIN_ON_X86-64_V7.5.0.1_EIM.tar -C mqins
cd mqins
./mqlicense.sh -accept
rpm -ivh MQSeriesJava-7.5.0-1.x86_64.rpm MQSeriesJRE-7.5.0-1.x86_64.rpm MQSeriesClient-7.5.0-1.x86_64.rpm MQSeriesFTAgent-7.5.0-1.x86_64.rpm MQSeriesFTBase-7.5.0-1.x86_64.rpm MQSeriesFTLogger-7.5.0-1.x86_64.rpm MQSeriesFTService-7.5.0-1.x86_64.rpm MQSeriesFTTools-7.5.0-1.x86_64.rpm MQSeriesGSKit-7.5.0-1.x86_64.rpm MQSeriesMan-7.5.0-1.x86_64.rpm MQSeriesMsg_Zh_CN-7.5.0-1.x86_64.rpm MQSeriesRuntime-7.5.0-1.x86_64.rpm MQSeriesSamples-7.5.0-1.x86_64.rpm MQSeriesSDK-7.5.0-1.x86_64.rpm MQSeriesServer-7.5.0-1.x86_64.rpm MQSeriesXRClients-7.5.0-1.x86_64.rpm MQSeriesXRService-7.5.0-1.x86_64.rpm
/opt/mqm/bin/setmqinst -i -p /opt/mqm

echo "set envs for mq7.5....."
echo "#config for mq7.5" >> /etc/sysctl.conf
echo "net.ipv4.ip_forward = 0" >> /etc/sysctl.conf
echo "net.ipv4.conf.default.rp_filter = 1" >> /etc/sysctl.conf
echo "net.ipv4.conf.default.accept_source_route = 0" >> /etc/sysctl.conf
echo "net.ipv4.tcp_keepalive_time = 200" >> /etc/sysctl.conf
echo "kernel.sysrq = 0" >> /etc/sysctl.conf
echo "kernel.core_uses_pid = 1" >> /etc/sysctl.conf
echo "net.ipv4.tcp_syncookies = 1" >> /etc/sysctl.conf
echo "kernel.msgmnb = 65536" >> /etc/sysctl.conf
echo "kernel.msgmax = 65536" >> /etc/sysctl.conf
echo "net.ipv4.conf.all.accept_redirects = 0" >> /etc/sysctl.conf
echo "kernel.sem = 500 512000 250 4096" >> /etc/sysctl.conf
echo "kernel.msgmni = 1024" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmax = 268435456" >> /etc/sysctl.conf
echo "fs.file-max = 524288" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 8192 65535" >> /etc/sysctl.conf
echo "vm.max_map_count=1966080" >> /etc/sysctl.conf
sysctl -p

echo "#config for mq" >> /etc/security/limits.conf
echo "*        hard    nproc           8192" >> /etc/security/limits.conf
echo "*        soft    nofile          262144" >> /etc/security/limits.conf
echo "*        hard    nofile          262144" >> /etc/security/limits.conf
echo "rjroot     soft    nproc           8192" >> /etc/security/limits.conf
echo "mqm     soft  nproc 8192" >> /etc/security/limits.conf


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29519108/viewspace-2138762/,如需轉載,請註明出處,否則將追究法律責任。

相關文章