Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of installing and managing Erlang with Kerl in Centos

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "Centos uses Kerl to install and manage Erlang". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Installation depends on yum-y updateyum-y install make yum-y install gcc yum-y install gcc-c++ yum-y install kernel-devel yum-y install M4 yum-y install ncurses-devel yum-y install openssl-devel yum-y install rsync yum-y install perl-net-snmp yum-y install wx yum-y install fop yum-y install net-snmp yum-y install unixODBC yum-y install unixODBC-devel yum-y install lrzsz yum-y install bc yum-y install sysstat yum-y install lsof yum-y install wget yum- Y install xz yum-y install automake yum-y install autoconf2. Install kerlroot@SummerGao:/home/summergao#

Installation location:

Cd / home/summergao/kerl

download

Curl-O https://raw.githubusercontent.com/kerl/kerl/master/kerl

Modify execution permissions

Chmod axix kerl3. Mating environment variable

Win10 CentOS subsystem configuration method:

Sudo vim / .bashrc

Add at the end of the open file:

Export KERL_HOME=/home/summergao/kerlexport PATH=$ {KERL_HOME} /: $PATH

To make the configuration effective:

Source / .bashrc

Original CentOS configuration mode

Vim / etc/profile

Add the following code under export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL:

Export KERL_HOME=/home/summergao/kerlexport PATH=$ {KERL_HOME} /: $PATH

Make the configuration effective

Source / etc/profile

Verify that the environment variable is configured successfully

Kerl version

[root@SummerGao kerl] # kerl version

1.8.6

[root@SummerGao kerl] #

4. Update version kerl update releases5. Erlang from the official website of kerl update releases5. Show all released versions of kerl list releases6. Build the specified version (compiled using Java by default, which requires installation of JDK and configuration of environment variables)

Method 1. Use Java to compile by default

Kerl build 22.0 22.0

Method 2. (cancel java compilation) use gcc to compile

KERL_CONFIGURE_OPTIONS=--without-javac kerl build 22.0 22.0

As an experimental feature, it can also be built from the git repository

Kerl build git https://github.com/erlang/otp.git dev 19.2_dev

It takes a while to build. It is recommended to wait patiently.

[root@SummerGao builds] # kerl build 22.0 22.0

Verifying archive checksum...

Checksum verified (9842663e49f48e967c44b7574423f9e9)

Extracting source code

Building Erlang/OTP 22.0 (22.0), please wait...

APPLICATIONS DISABLED (See: / root/.kerl/builds/22.0/otp_build_22.0.log)

* jinterface: No Java compiler found

APPLICATIONS INFORMATION (See: / root/.kerl/builds/22.0/otp_build_22.0.log)

* wx: wxWidgets not found, wx will NOT be usable

If the above information appears, you need to open another terminal to install JDK JDK.

When JDK is installed successfully, it prompts:

Erlang/OTP 22.0 (22.0) has been successfully built

The following applies to versions prior to kerl 1.8.4:

Download installation package may be very slow, to this end, you can use Thunderbolt to download the installation package first, such as installation 22.0: first visit https://www.erlang.org/downloads/22.0 to find: OTP 22.0 Source File (91806805) right copy link address to Xunlei download. After the download is complete, copy (or upload) to the / root/.kerl/archives/ directory and re-perform step 6.

The following applies to the latest version:

Download installation package may be very slow, to this end, you can use Thunderbolt to download the installation package first, such as installation 22.0: first visit https://github.com/erlang/otp/tags to find: OTP-22.0 right copy link address to Xunlei download. After the download is complete, copy (or upload) to the / root/.kerl/archives/ directory and re-perform step 6.

7. Show the built version of kerl list builds

The displayed results are separated by,. The first column is the version number listed in the kerl list releases command, and the second column is the build name, which can be used by subsequent kerl install commands.

[root@SummerGao home] # kerl list builds

22.0,22.0

[root@SummerGao home] #

8. Display status kerl status

[root@SummerGao home] # kerl status

Available builds:

22.0,22.0

-

Available installations:

There are no installations available

-

No Erlang/OTP installation is currently active

[root@SummerGao home] #

9. Install a specific version of kerl install 22.0 ~ / kerl/22.0

Installing Erlang/OTP 22.0 (22.0) in / root/kerl/22.0...

You can activate this installation running the following command:

. / root/kerl/22.0/activate

Later on, you can leave the installation typing:

Kerl_deactivate

Installation will take some time. Please wait patiently.

10. Displays the installed version of kerl list installations11. Activate a specific version. / root/kerl/22.0/activate

Activating will back up your $PATH and add it to the installed bin / directory. Therefore, it is only valid for the current shell session until you activate another installation or call kerl_deactivate.

twelve。 View activated Erlang version kerl active

[root@SummerGao home] # kerl active

The current active installation is:

/ root/kerl/22.0

[root@SummerGao home] #

13. Trial operation of erlerl

[root@SummerGao home] # erl

Erlang/OTP 22 [erts-10.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Eshell V10.4 (abort with ^ G)

1 >

Expansion: 14. Delete a specific build kerl delete build 22.013. Configuration

You can execute the built configuration options on the command line, or you can configure them in the configuration file.

① configuration compilation options

The command line is specified by compilation parameters, such as:

KERL_CONFIGURE_OPTIONS=--enable-hipe kerl build 22.0 22.0_hipe

The ② configuration file is specified in $HOME/.kerlrc

# $HOME/.kerlrcKERL_CONFIGURE_OPTIONS= "--disable-debug\-- without-javac\-- enable-shared-zlib\-- enable-dynamic-ssl-lib\-- enable-hipe\-- enable-smp-support\-- enable-threads\-- enable-kernel-poll\-- with-wx" ③ configuration application

Build a minimum Erlang environment that contains only three kernel,stdlib,sasl applications

KERL_CONFIGURE_APPLICATIONS= "kernel stdlib sasl" kerl build 22.0 22.0_minimal ④ disables applications

Exclude ODBC applications from the built Erlang environment

KERL_CONFIGURE_DISABLE_APPLICATIONS= "odbc" kerl build 22.0 22.0_no_odbc ⑤ installation Erlang

Install to the specified directory, in order to be able to install multiple versions, the installation directory should be identified by the version number

Kerl install

For example

Kerl install 22.0_hipe / tmp/erlang/22.0_hipe15. Deployment

Deploy the specified Erlang build to a remote server, so that in a cluster, we can compile on one server and deploy the Erlang runtime environment of all cluster nodes.

Kerl deploy [directory] [remote_directory] kerl deploy test@192.168.1.100 / deploy/erlang/22.0_hipe

Note:

To configure the public key, ssh can log in to the remote server directly without a password.

Just add the public key to the $HOME/.ssh/authorized_key file on the remote server

The local default public key location is $HOME/.ssh/id_rsa.pub

This is the end of the introduction to "how Centos installs and manages Erlang with Kerl". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report