rabbitmq

/ 0评 / 0

Install Erlang

yum install erlang

or

  1. <span class="pln">wget http</span><span class="pun">:</span><span class="com">//erlang.org/download/otp_src_19.0.tar.gz</span>
  2. <span class="pln">tar </span><span class="pun">-</span><span class="pln">zxvf otp_src_19</span><span class="pun">.</span><span class="lit">0.tar</span><span class="pun">.</span><span class="pln">gz</span>
  3. <span class="pln">cd otp_src_19</span><span class="pun">.</span><span class="lit">0</span>
  4. <span class="pun">./</span><span class="pln">configure </span><span class="pun">--</span><span class="pln">prefix</span><span class="pun">=</span><span class="str">/opt/</span><span class="pln">erlang </span><span class="pun">--</span><span class="pln">without</span><span class="pun">-</span><span class="pln">javac</span>

报错

  1. <span class="pln">configure</span><span class="pun">:</span><span class="pln"> error</span><span class="pun">:</span><span class="pln"> </span><span class="typ">No</span><span class="pln"> curses library functions found</span>
  2. <span class="pln">configure</span><span class="pun">:</span><span class="pln"> error</span><span class="pun">:</span><span class="pln"> </span><span class="str">/bin/</span><span class="pln">sh </span><span class="str">'/root/otp/erts/configure'</span><span class="pln"> failed </span><span class="kwd">for</span><span class="pln"> erts</span>

解决

  1. <span class="pln">yum </span><span class="pun">-</span><span class="pln">y install ncurses</span><span class="pun">-</span><span class="pln">devel</span>
  2. <span class="pun">./</span><span class="pln">configure </span><span class="pun">--</span><span class="pln">prefix</span><span class="pun">=</span><span class="str">/opt/</span><span class="pln">erlang </span><span class="pun">--</span><span class="pln">without</span><span class="pun">-</span><span class="pln">javac</span>

报错

  1. <span class="pln">odbc </span><span class="pun">:</span><span class="pln"> ODBC library </span><span class="pun">-</span><span class="pln"> link check failed</span>
  2. <span class="pln">orber </span><span class="pun">:</span><span class="pln"> </span><span class="typ">No</span><span class="pln"> C</span><span class="pun">++</span><span class="pln"> compiler found</span>

解决

  1. <span class="pln">yum list </span><span class="pun">|</span><span class="pln"> grep ODBC</span>
  2. <span class="pln">yum install unixODBC</span><span class="pun">-</span><span class="pln">devel</span>
  3. <span class="pun">./</span><span class="pln">configure </span><span class="pun">--</span><span class="pln">prefix</span><span class="pun">=</span><span class="str">/opt/</span><span class="pln">erlang </span><span class="pun">--</span><span class="pln">without</span><span class="pun">-</span><span class="pln">javac</span>

安装

make && make install

设置环境变量

  1. <span class="pln">vi </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">profile</span>
  2. <span class="com">#set erlang environment</span>
  3. <span class="kwd">export</span><span class="pln"> PATH</span><span class="pun">=</span><span class="pln">$PATH</span><span class="pun">:</span><span class="str">/opt/</span><span class="pln">erlang</span><span class="pun">/</span><span class="pln">bin</span>
  4. <span class="pln">source </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">profile</span>
  5. <span class="pun">/</span><span class="pln">opt</span><span class="pun">/</span><span class="pln">erlang</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">erl</span>

Install RabbitMQ Server

  1. <span class="pln">wget http</span><span class="pun">:</span><span class="com">//www.rabbitmq.com/releases/rabbitmq-server/v3.6.5/rabbitmq-server-3.6.5-1.noarch.rpm</span>
  2. <span class="pln">yum install rabbitmq</span><span class="pun">-</span><span class="pln">server</span><span class="pun">-</span><span class="lit">3.6</span><span class="pun">.</span><span class="lit">5</span><span class="pun">-</span><span class="lit">1.noarch</span><span class="pun">.</span><span class="pln">rpm</span>

提示

  1. <span class="typ">Requires</span><span class="pun">:</span><span class="pln"> erlang </span><span class="pun">>=</span><span class="pln"> R16B</span><span class="pun">-</span><span class="lit">03</span>
  2. <span class="typ">Installed</span><span class="pun">:</span><span class="pln"> erlang</span><span class="pun">-</span><span class="pln">R14B</span><span class="pun">-</span><span class="lit">04.3</span><span class="pun">.</span><span class="pln">el6</span><span class="pun">.</span><span class="pln">x86_64 </span><span class="pun">(</span><span class="lit">@epel</span><span class="pun">)</span>
  3. <span class="pln">erlang </span><span class="pun">=</span><span class="pln"> R14B</span><span class="pun">-</span><span class="lit">04.3</span><span class="pun">.</span><span class="pln">el6</span>

忽略erlang的版本问题

rpm -ivh --nodeps rabbitmq-server-3.6.5-1.noarch.rpm

Run RabbitMQ Server

启用管理插件

  1. <span class="pln">cd </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">lib</span><span class="pun">/</span><span class="pln">rabbitmq</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span>
  2. <span class="pun">./</span><span class="pln">rabbitmq</span><span class="pun">-</span><span class="pln">plugins enable rabbitmq_management</span>

运行

  1. <span class="pln">chown </span><span class="pun">-</span><span class="pln">R rabbitmq</span><span class="pun">:</span><span class="pln">rabbitmq </span><span class="pun">/</span><span class="kwd">var</span><span class="pun">/</span><span class="pln">lib</span><span class="pun">/</span><span class="pln">rabbitmq</span><span class="pun">/</span>
  2. <span class="pln">service rabbitmq</span><span class="pun">-</span><span class="pln">server start</span>

创建用户赋予权限

  1. <span class="pln">rabbitmqctl add_user user pawwword</span>
  2. <span class="pln">rabbitmqctl set_user_tags user administrator</span>
  3. <span class="pln">rabbitmqctl set_permissions </span><span class="pun">-</span><span class="pln">p </span><span class="pun">/</span><span class="pln"> user </span><span class="str">".*"</span><span class="pln"> </span><span class="str">".*"</span><span class="pln"> </span><span class="str">".*"</span>
来自为知笔记(Wiz)