You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assume that latios software is in current directory, run the following command:
42
50
43
51
sudo ./laitos -config <PATH TO JSON FILE> -daemons <LIST>
@@ -60,25 +68,62 @@ Note that:
60
68
*[`maintenance`](https://github.com/HouzuoGuo/laitos/wiki/%5BDaemon%5D-system-maintenance) - Automated server maintenance and program health report
61
69
- Apps are enabled automatically once they are configured in the JSON file. Some apps such as the RSS News Reader are automatically enabled via their built-in default configuration.
62
70
71
+
## Other deployment techniques
72
+
73
+
### Use environment variables to feed the program configuration
74
+
75
+
For ease of deployment, laitos can fetch its program configuration along with
76
+
the content of HTTP daemon index page from environment variables - instead of
77
+
the usual files.
78
+
79
+
When `LAITOS_CONFIG` environment variable is present and not empty, laitos
80
+
program will load its configuration from there. When `LAITOS_INDEX_PAGE`
81
+
environment variable is present and not empty, laitos will use its content
82
+
to serve the index page on its HTTP servers.
83
+
84
+
Check out environment variable usage examples in the [Kubernetes example](https://github.com/HouzuoGuo/laitos/blob/master/k8s.example/laitos-in-k8s.yaml)
85
+
and the [example in Dockerfile](https://github.com/HouzuoGuo/laitos/blob/master/Dockerfile)
86
+
87
+
Be aware that the combined size of all environment variables generally cannot
88
+
exceed ~2MBytes.
89
+
90
+
### Build a container image
91
+
The images of a (usually) up-to-date version of laitos are uploaded to Docker
If you wish to customise the image to your needs, feel free to use the [`Dockerfile`](https://github.com/HouzuoGuo/laitos/blob/master/Dockerfile)
95
+
from GitHub repository as a reference.
96
+
63
97
## Deploy on cloud
98
+
64
99
laitos runs well on all popular cloud vendors, it supports cloud virtual machines for a straight-forward installation,
65
100
as well as more advanced cloud features such as AWS Elastic Beanstalk and AWS Lambda (in combination with API gateway).
66
101
Check out the [cloud deployment tips](https://github.com/HouzuoGuo/laitos/wiki/Cloud-tips).
67
102
68
103
## Deploy on Windows
104
+
69
105
laitos is well tuned for running on Windows server and desktop. Check out this [PowerShell script](https://raw.githubusercontent.com/HouzuoGuo/laitos/master/extra/windows/setup.ps1)
70
106
that helps to start laitos automatically as a background service.
71
107
72
-
## Advanced behaviours
108
+
## Advanced program behaviours
109
+
73
110
### Self-healing
74
-
laitos is extremely reliable thanks to its many built-in mechanisms that activate automatically in the unlikely event of program anormaly.
75
-
The mechanisms are fully automatic and do not require manual intervention:
76
111
77
-
1. Access to external resources, such as API services on the public Internet, automatically recover from transient errors.
78
-
2. Each daemon automatically restarts in case of a transient initialisation error, such as when required system resource is unavailable.
79
-
3. laitos program and its daemons restart automatically in case of a complete program crash.
80
-
4. In the extremely unlikely event of repeated program crashes in short succession (20 minutes), laitos will restart automatically while
81
-
shedding of its daemons starting from the heaviest daemon, thus ensuring the maximum availabily of remaining healthy daemons.
112
+
laitos is extremely reliable thanks to its many built-in mechanisms that make
113
+
automated attempts to restart and isolate faulty components. The built-in
114
+
mechanisms are fully automatic and do not require intervention:
115
+
116
+
1. Automatically recover from transient errors when contacting external
117
+
resources, such as API services on the public Internet.
118
+
2. Every daemon automatically restarts in case of a transient initialisation
119
+
error.
120
+
3. In the unlikely event of a program crash, the laitos program automatically
121
+
restarts itself to recover.
122
+
4. In the extremely unlikely event of repeated program crashes in short
123
+
succession (20 minutes), laitos will attempt to automatically isolate the
124
+
faulty daemon by removing daemons before the next restart - shedding the
125
+
heavier daemons (e.g. DNS) first before shedding the lighter daemons (e.g.
126
+
HTTP daemon).
82
127
83
128
Optionally, laitos can send server owner a notification mail when a program crash occurs. To enable the notification, follow
84
129
[outgoing mail configuration](https://github.com/HouzuoGuo/laitos/wiki/Outgoing-mail-configuration) and then specify Email recipients in
@@ -98,6 +143,7 @@ Please use [Github issues](https://github.com/HouzuoGuo/laitos/issues) to report
98
143
output contain valuable clues for diagnosis - please retain them for an issue report.
99
144
100
145
### More command line options
146
+
101
147
Use the following command line options with extra care:
102
148
<table>
103
149
<tr>
@@ -166,19 +212,3 @@ Use the following command line options with extra care:
166
212
</td>
167
213
</tr>
168
214
</table>
169
-
170
-
### Build a container image
171
-
Images of a (usually) up-to-date version of laitos are uploaded to Docker Hub [hzgl/laitos](https://hub.docker.com/r/hzgl/laitos).
172
-
173
-
If you wish to customise the image to your needs, feel free to use the [`Dockerfile`](https://github.com/HouzuoGuo/laitos/blob/master/Dockerfile)
174
-
from GitHub repository as a reference.
175
-
176
-
### Supply program configuration in an environment variable
177
-
Usually, the program configuration is kept in a JSON file, the path of which is specified in the laitos launch command line (`-config my-laitos-config.json`).
178
-
However, if the program configuration is short enough to fit into an environment variable, laitos can also get its configuration
179
-
from there. This can be rather useful for testing a configuration snippet or starting a small number of daemons in a container.
180
-
181
-
The following example starts the HTTP daemon (without TLS) on the default port number (80), the web server comes with app-command runner endpoint:
0 commit comments