Sürüm Yapılandırması ve Başlatma Betikleri
Bir Erlang sürümünün uygulama ortamlarını yapılandırmak ve kesin başlangıç sırasını denetlemek için sys.config ile başlatma betiklerini öğrenin.
Sürüm Yapılandırması ve Başlatma Betikleri, CoddyKit'te ücretsiz bir Erlang OTP: Distributed & Fault-Tolerant Systems Programming dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Erlang OTP: Distributed & Fault-Tolerant Systems Programming öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Erlang OTP: Distributed & Fault-Tolerant Systems Programming kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
What Is Release Configuration?
A release bundles your applications, the Erlang runtime, and configuration. Two files drive runtime behaviour: sys.config for application settings and the boot script for the startup sequence.
The Application Environment
Each OTP application has an environment — a set of key/value parameters. You read them at runtime with application:get_env/2.
application:get_env(my_app, port).sys.config Structure
sys.config is a single Erlang term: a list of {App, [{Key, Value}]} tuples that override application defaults at boot.
[
{my_app, [{port, 8080}, {pool_size, 10}]},
{kernel, [{logger_level, info}]}
].Overriding Defaults
Values in sys.config override those in each app .app file. This lets one codebase run differently per environment (dev, staging, prod) just by swapping config.
Reading Config at Runtime
Inside a gen_server init, pull configured values so behaviour follows the environment.
init([]) ->
{ok, Port} = application:get_env(my_app, port),
{ok, listen(Port)}.What Is a Boot Script?
The boot script (.script compiled to .boot) lists every application and module to load, and the order to start them. The runtime follows it to bring the system up deterministically.
Generated from the .rel File
You describe a release in a .rel file. Tools like systools or rebar3 turn it into the boot script.
{release,
{"my_system", "1.0.0"},
{erts, "13.0"},
[{kernel, "8.0"}, {stdlib, "4.0"}, {my_app, "1.0.0"}]}.Start Phases
Applications start in dependency order. If my_app lists kernel and stdlib as dependencies, the boot script guarantees they start first.
Permanent vs Temporary Apps
In the boot script an application can be permanent (its crash takes down the node), transient, or temporary. Choose permanent for core services.
Layered Config with config/0
You can split configuration across files and merge them, or use runtime os:getenv/1 reads for secrets that should not live in sys.config.
init([]) ->
Url = os:getenv("DATABASE_URL"),
{ok, connect(Url)}.Applying a Custom Config File
At node startup you point to a config file with the -config flag, letting one release run with different settings just by swapping the file.
erl -config /etc/my_system/prod.config -boot my_systemQuick Check
Test your release configuration knowledge.
Recap
You learned how releases are configured and started:
sys.configsets the application environment per deployment- Read values with
application:get_env/2 - The
.relfile is compiled into a boot script - Boot scripts start applications in dependency order
- Use permanent apps for core services and env vars for secrets
Sıkça Sorulan Sorular
“Sürüm Yapılandırması ve Başlatma Betikleri” dersi ücretsiz mi?
Evet — “Sürüm Yapılandırması ve Başlatma Betikleri” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Erlang OTP: Distributed & Fault-Tolerant Systems Programming kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Erlang OTP: Distributed & Fault-Tolerant Systems Programming kursu toplamda 4 dersten oluşur.
“Sürüm Yapılandırması ve Başlatma Betikleri” dersinde ne öğreneceğim?
Bir Erlang sürümünün uygulama ortamlarını yapılandırmak ve kesin başlangıç sırasını denetlemek için sys.config ile başlatma betiklerini öğrenin. Erlang OTP: Distributed & Fault-Tolerant Systems Programming ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Erlang OTP: Distributed & Fault-Tolerant Systems Programming öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Erlang OTP: Distributed & Fault-Tolerant Systems Programming, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.
“Sürüm Yapılandırması ve Başlatma Betikleri” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Erlang OTP: Distributed & Fault-Tolerant Systems Programming dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Erlang OTP: Distributed & Fault-Tolerant Systems Programming dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Erlang Sürümleri Oluşturma
- Çalışırken Kod Yükleme ve Yükseltme
- Sürüm Oluşturma ve Dağıtım
- Sürüm Yapılandırması ve Başlatma Betikleri