安装依赖包
$ yum -y install make ncurses-devel gcc gcc-c++ unixODBC unixODBC-devel openssl openssl-devel
下载
#:wget http://erlang.org/download/otp_src_18.3.tar.gz
#:tar -zxvf otp_src_18.3.tar.gz#:cd otp_src_18.3
编译:
#:./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac
安装
root@iZ941149niaZ otp_src_18.3]# make && make install
MAKE depend
make[1]: Entering directory `/usr/local/otp_src_18.3/erts/emulator'
MAKE generate
make[2]: Entering directory `/usr/local/otp_src_18.3/erts/emulator'
GEN x86_64-unknown-linux-gnu/gen_git_version.mk
M4 x86_64-unknown-linux-gnu/opt/plain/hipe_x86_asm.h
M4 x86_64-unknown-linux-gnu/opt/plain/hipe_amd64_asm.h
M4 x86_64-unknown-linux-gnu/opt/plain/hipe_sparc_asm.h
M4 x86_64-unknown-linux-gnu/opt/plain/hipe_ppc_asm.h
...........
................
冲杯咖啡☕️喝完就差不多了。
/usr/bin/install -c -m 644 "/usr/local/otp_src_18.3/OTP_VERSION" "/usr/local/erlang/lib/erlang/releases/18"
cd /usr/local/erlang/bin
rm -f erl
rm -f erlc
rm -f epmd
rm -f run_erl
rm -f to_erl
rm -f dialyzer
rm -f typer
rm -f escript
rm -f ct_run
ln -s ../lib/erlang/bin/erl erl
ln -s ../lib/erlang/bin/erlc erlc
ln -s ../lib/erlang/bin/epmd epmd
ln -s ../lib/erlang/bin/run_erl run_erl
ln -s ../lib/erlang/bin/to_erl to_erl
ln -s ../lib/erlang/bin/dialyzer dialyzer
ln -s ../lib/erlang/bin/typer typer
ln -s ../lib/erlang/bin/escript escript
ln -s ../lib/erlang/bin/ct_run ct_run
OK
环境变量
[root@iZ941149niaZ otp_src_18.3]# vi /etc/profile
export JAVA_HOME=/usr/local/jdk/
ERL_HOME=/usr/local/erlang
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin:$ERL_HOME/bin
export ERL_HOME PATH
"/etc/profile" 83L, 2018C written
激活
[root@iZ941149niaZ otp_src_18.3]# source /etc/profile
[root@iZ941149niaZ otp_src_18.3]# echo $ERL_HOME
/usr/local/erlang
[root@iZ941149niaZ otp_src_18.3]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/jdk//bin:/root/bin:/usr/local/jdk//bin:/usr/local/erlang/bin
安装rabbit
[root@iZ941149niaZ local]# wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-generic-unix-3.6.1.tar.xz
--2017-11-13 11:55:26-- http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-generic-unix-3.6.1.tar.xz
Resolving www.rabbitmq.com... 104.20.63.197, 104.20.62.197, 2400:cb00:2048:1::6814:3ec5, ...
Connecting to www.rabbitmq.com|104.20.63.197|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4884356 (4.7M) [application/x-tar]
Saving to: “rabbitmq-server-generic-unix-3.6.1.tar.xz”
100%[=========================================================================================================================================================================>] 4,884,356 86.8K/s in 47s
2017-11-13 11:56:14 (101 KB/s) - “rabbitmq-server-generic-unix-3.6.1.tar.xz” saved [4884356/4884356]
解压
[root@iZ941149niaZ local]# xz -d rabbitmq-server-generic-unix-3.6.1.tar.xz
再解
[root@iZ941149niaZ local]# tar -xvf rabbitmq-server-generic-unix-3.6.1.tar
[root@iZ941149niaZ local]# mv rabbitmq_server-3.6.1 rabbitmq-3.6.1
[root@iZ941149niaZ local]# cd ./rabbitmq-3.6.1/sbin/
[root@iZ941149niaZ sbin]# ls
rabbitmqctl rabbitmq-defaults rabbitmq-env rabbitmq-plugins rabbitmq-server
[root@iZ941149niaZ sbin]# ./rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Applying plugin configuration to rabbit@iZ941149niaZ... failed.
* Could not contact node rabbit@iZ941149niaZ.
Changes will take effect at broker restart.
* Options: --online - fail if broker cannot be contacted.
--offline - do not try to contact broker.
启动
[root@iZ941149niaZ sbin]# ./rabbitmq-server &
命令包括:
/sbin/service rabbitmq-server stop/start/etc
#进入RabbitMQ安装目录
cd /usr/local/rabbitmq-3.6.1/sbin
#添加用户
./rabbitmqctl add_user rabbitadmin 123456
#分配用户标签
./rabbitmqctl set_user_tags rabbitadmin administrator
登陆
浏览器输入地址:http://服务器IP地址:15672
登陆不了关了防火墙或者加入开放端口。
done