ctgmq00

yyp2009發表於2018-03-17
[root@localhost ~]# mkdir -p ctgmq_deploy/version
[root@localhost ~]# cd ctgmq_deploy/version
[root@localhost version]# pwd
/root/ctgmq_deploy/version
[root@localhost version]# cd
[root@localhost ~]# ll
總用量 14108
drwxr-xr-x 3 root root       20 3月  17 15:26 ctgmq_deploy
-rwxr-xr-x 1 root root 14443465 3月  17 15:03 ctgmq-rocketmq-2.2.6_P2-ctgmq-rocketmq.tar.gz
drwxr-xr-x 4 root root       45 3月  17 15:22 jifei
drwxr-xr-x 4 root root       30 3月  16 13:17 logs
[root@localhost ~]#
[root@localhost ~]# cp ctgmq-rocketmq-2.2.6_P2-ctgmq-rocketmq.tar.gz /root/ctgmq_deploy/version
[root@localhost ~]# pwd
/root
[root@localhost ~]# ll
總用量 14108
drwxr-xr-x 3 root root       20 3月  17 15:26 ctgmq_deploy
-rwxr-xr-x 1 root root 14443465 3月  17 15:03 ctgmq-rocketmq-2.2.6_P2-ctgmq-rocketmq.tar.gz
drwxr-xr-x 4 root root       45 3月  17 15:22 jifei
drwxr-xr-x 4 root root       30 3月  16 13:17 logs
[root@localhost ~]# pwd
/root
[root@localhost ~]# cd ctgmq_deploy
[root@localhost ctgmq_deploy]# pwd
/root/ctgmq_deploy
[root@localhost ctgmq_deploy]# ls
version
[root@localhost ctgmq_deploy]# cd *
[root@localhost version]# pwd
/root/ctgmq_deploy/version
[root@localhost version]# ls
ctgmq-rocketmq-2.2.6_P2-ctgmq-rocketmq.tar.gz
[root@localhost version]# ll
總用量 14108
-rwxr-xr-x 1 root root 14443465 3月  17 15:26 ctgmq-rocketmq-2.2.6_P2-ctgmq-rocketmq.tar.gz
[root@localhost version]# pwd
/root/ctgmq_deploy/version
[root@localhost version]#

1  nameserver上要配置/ect/hosts;ip和hostname:

[ctgmq@ctgmq02 ~]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

135.149.96.246 ctgmq02  ctgmq02

2  配置java:

export JAVA_HOME=/home/ctgmq/jdk1.7.0_79
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

[ctgmq@ctgmq04 ~]$ source .bash_profile
[ctgmq@ctgmq04 ~]$
[ctgmq@ctgmq04 ~]$ echo $JAVA_HOME
/home/ctgmq/jdk1.7.0_79
3  每個配置節點新建使用者並配置密碼和許可權合適


[ctgmq@ctgmq02 ~]$ history
    1  ls
    2  ll
    3  tail -100f run_namesrv.out
    4  pwd
    5  ll
    6  tail -500f run_namesrv.out
    7  cat /etc/hosts
    8  vi /etc/hosts
    9  exit
   10  pwd
   11  cd /app/instance/namesrv/yangypns01/2/sh
   12  pwd
   13  ls
   14  ll
   15  chmod +x namesrv_2.sh
   16  ll
   17  pw
   18  pwd
   19  exit
   20  pwd
   21  ls
   22  ll
   23  pwd
   24  ll
   25  tar -xvf jdk7u79linuxx64.tar.gz
   26  pwd
   27  ls -lart
   28  vi  .bash_profile
   29  ll
   30  ls -lart
   31  source .bash_profile
   32  history
[ctgmq@ctgmq02 ~]$  echo $JAVA_HOME
/home/ctgmq/jdk1.7.0_79




[ctgmq@ctgmq03 ~]$ tail -200 runcontroller.out
load config properties file OK, /app/instance/controller/yangyp_control61/1/conf/controller_1.propreties
java.lang.NumberFormatException: For input string: "8010 "  ---這裡空格引發的血案
一定要注意zkurl複製時發生的變異,比如空格問題。

        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:492)   


[ctgmq@ctgmq03 ~]$ more runcontroller.out
load config properties file OK, /app/instance/controller/yangyp_control33/1/conf/controller_1.propreties
com.github.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server[135.149.96.244:8010,135.149.96.245:8010,135.149.96.246:8010] within timeout 5000
ms
        at com.github.zkclient.ZkClient.connect(ZkClient.java:757)
        at com.github.zkclient.ZkClient.(ZkClient.java:141)
        at com.github.zkclient.ZkClient.(ZkClient.java:130)
        at com.ctg.mq.zk.ZKClient.(ZKClient.java:97)


1  systemctl stop firewalld
2  [root@ctgmq01 conf]# vi zoo.cfg

# The number of milliseconds of each tick
tickTime=10000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
[root@ctgmq01 zookeeper-3.4.6]# cd bin
[root@ctgmq01 bin]# ./zkServer.sh restart
JMX enabled by default
Using config: /app/zookeeper8010/zookeeper-3.4.6/bin/../conf/zoo.cfg
JMX enabled by default

 yum install telnet
[ctgmq@ctgmq01 ~]$ telnet 135.149.96.245 8010
Trying 135.149.96.245...
Connected to 135.149.96.245.
Escape character is '^]'.
netstat -an|grep 8010





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