-
Notifications
You must be signed in to change notification settings - Fork 20
/
AdminTraining.html
5789 lines (3967 loc) · 254 KB
/
AdminTraining.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>AdminTraining</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/*
This document has been created with Marked.app <http://markedapp.com>, Copyright 2011 Brett Terpstra
Please leave this notice in place, along with any additional credits below.
---------------------------------------------------------------
Title: GitHub
Author: Brett Terpstra
Description: Github README style. Includes theme for Pygmentized code blocks.
*/
html, body {
color: black;
}
* {
margin: 0;
padding: 0;
}
body {
font: 13.34px helvetica,arial,freesans,clean,sans-serif;
-webkit-font-smoothing: antialiased;
line-height: 1.4;
padding: 3px;
background: #fff;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
p {
margin: 1em 0;
}
a {
color: #4183c4;
text-decoration: none;
}
#wrapper {
background-color: #fff;
padding: 0 30px;
margin: 15px;
}
#wrapper {
font-size: 14px;
line-height: 1.6;
}
#wrapper>*:first-child {
margin-top: 0!important;
}
#wrapper>*:last-child {
margin-bottom: 0!important;
}
h1,h2,h3,h4,h5,h6 {
margin: 0;
padding: 0;
}
h1 {
margin: 15px 0;
padding-bottom: 2px;
font-size: 24px;
border-bottom: 1px solid #eee;
}
h2 {
margin: 20px 0 10px 0;
font-size: 18px;
}
h3 {
margin: 20px 0 10px 0;
padding-bottom: 2px;
font-size: 14px;
border-bottom: 1px solid #ddd;
}
h4 {
font-size: 14px;
line-height: 26px;
padding: 18px 0 4px;
font-weight: bold;
text-transform: uppercase;
}
h5 {
font-size: 13px;
line-height: 26px;
padding: 14px 0 0;
font-weight: bold;
text-transform: uppercase;
}
h6 {
color: #666;
font-size: 14px;
line-height: 26px;
padding: 18px 0 0;
font-weight: normal;
font-variant: italic;
}
hr {
background: transparent url(data:image/png;
base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OENDRjNBN0E2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OENDRjNBN0I2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Q0NGM0E3ODY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Q0NGM0E3OTY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqqezsUAAAAfSURBVHjaYmRABcYwBiM2QSA4y4hNEKYDQxAEAAIMAHNGAzhkPOlYAAAAAElFTkSuQmCC) repeat-x 0 0;border: 0 none;
color: #ccc;
height: 4px;
margin: 20px 0;
padding: 0;
}
#wrapper>h2:first-child,#wrapper>h1:first-child,#wrapper>h1:first-child+h2 {
border: 0;
margin: 0;
padding: 0;
}
#wrapper>h3:first-child,#wrapper>h4:first-child,#wrapper>h5:first-child,#wrapper>h6:first-child {
margin: 0;
padding: 0;
}
h4+p,h5+p,h6+p {
margin-top: 0;
}
li p.first {
display: inline-block;
}
ul,ol {
margin: 15px 0 15px 25px;
}
ul li,ol li {
margin-top: 7px;
margin-bottom: 7px;
}
ul li>*:last-child,ol li>*:last-child {
margin-bottom: 0;
}
ul li>*:first-child,ol li>*:first-child {
margin-top: 0;
}
#wrapper>ul,#wrapper>ol {
margin-top: 21px;
margin-left: 36px;
}
dl {
margin: 0;
padding: 20px 0 0;
}
dl dt {
font-size: 14px;
font-weight: bold;
line-height: normal;
margin: 0;
padding: 20px 0 0;
}
dl dt:first-child {
padding: 0;
}
dl dd {
font-size: 13px;
margin: 0;
padding: 3px 0 0;
}
blockquote {
margin: 14px 0;
border-left: 4px solid #ddd;
padding-left: 11px;
color: #555;
}
table {
border-collapse: collapse;
margin: 20px 0 0;
padding: 0;
}
table tr {
border-top: 1px solid #ccc;
background-color: #fff;
margin: 0;
padding: 0;
}
table tr:nth-child(2n) {
background-color: #f8f8f8;
}
table tr th,table tr td {
border: 1px solid #ccc;
text-align: left;
margin: 0;
padding: 6px 13px;
}
img {
max-width: 100%;
height: auto
}
code,tt {
margin: 0 2px;
padding: 2px 5px;
white-space: nowrap;
border: 1px solid #ccc;
background-color: #f8f8f8;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
font-size: 12px
}
pre>code {
margin: 0;
padding: 0;
white-space: pre;
border: none;
background: transparent;
font-size: 13px
}
.highlight pre,pre {
background-color: #f8f8f8;
border: 1px solid #ccc;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
#wrapper>pre,#wrapper>div.highlight {
margin: 10px 0 0;
}
pre code,pre tt {
background-color: transparent;
border: none;
}
#wrapper {
background-color: #fff;
border: 1px solid #CACACA;
padding: 30px;
}
.poetry pre {
font-family: Georgia, Garamond, serif !important;
font-style: italic;
font-size: 110% !important;
line-height: 1.6em;
display: block;
margin-left: 1em;
}
.poetry pre code {
font-family: Georgia, Garamond, serif !important;
word-break: break-all;
word-break: break-word; /* Non standard for webkit */
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
white-space: pre-wrap;
}
sup,sub,a.footnote {
font-size: 1.4ex;
height: 0;
line-height: 1;
vertical-align: super;
position: relative;
}
sub {
vertical-align: sub;
top: -1px;
}
@media print {
body {
background: #fff;
}
img, pre, blockquote, table, figure {
page-break-inside: avoid
}
#wrapper {
background: #fff;
border: none;
}
code {
background-color: #fff;
color: #444!important;
padding: 0 .2em;
border: 1px solid #DEDEDE;
}
pre code {
background-color: #fff!important;
overflow: visible;
}
pre {
background: #fff;
}
}
@media screen {
body.inverted, .inverted #wrapper, .inverted hr
.inverted p,.inverted td,.inverted li,.inverted h1,.inverted h2,.inverted h3,.inverted h4,.inverted h5,.inverted h6,.inverted th,.inverted .math,.inverted caption,.inverted dd,.inverted dt, .inverted blockquote {
color: #eee !important;
border-color: #555
}
.inverted td, .inverted th {
background: #333;
}
.inverted pre,.inverted code, .inverted tt {
background: #444!important;
}
.inverted h2 {
border-color: #555
}
.inverted hr {
border-color: #777;
border-width: 1px !important;
}
::selection {
background: rgba(157, 193, 200,.5)
}
h1::selection {
background-color: rgba(45, 156, 208, .3)
}
h2::selection {
background-color: rgba(90, 182, 224, .3)
}
h3::selection,
h4::selection,
h5::selection,
h6::selection,li::selection,ol::selection {
background-color: rgba(133, 201, 232, .3)
}
code::selection {
background-color: rgba(0,0,0,.7);
color: #eee
}
code span::selection {
background-color: rgba(0,0,0,.7) !important;
color: #eee !important
}
a::selection {
background-color: rgba(255, 230, 102,.2)
}
.inverted a::selection {
background-color: rgba(255, 230, 102,.6)
}
td::selection,th::selection,caption::selection {
background-color: rgba(180, 237, 95, .5);
}
.inverted {
background: #0b2531;
}
.inverted #wrapper,.inverted {
background: rgba(37, 42, 42, 1)
}
.inverted a {
color: rgba(172, 209, 213, 1);
}
}
.highlight .c {
color: #998;
font-style: italic;
}
.highlight .err {
color: #a61717;
background-color: #e3d2d2;
}
.highlight .k {
font-weight: bold;
}
.highlight .o {
font-weight: bold;
}
.highlight .cm {
color: #998;
font-style: italic;
}
.highlight .cp {
color: #999;
font-weight: bold;
}
.highlight .c1 {
color: #998;
font-style: italic;
}
.highlight .cs {
color: #999;
font-weight: bold;
font-style: italic;
}
.highlight .gd {
color: #000;
background-color: #fdd;
}
.highlight .gd .x {
color: #000;
background-color: #faa;
}
.highlight .ge {
font-style: italic;
}
.highlight .gr {
color: #a00;
}
.highlight .gh {
color: #999;
}
.highlight .gi {
color: #000;
background-color: #dfd;
}
.highlight .gi .x {
color: #000;
background-color: #afa;
}
.highlight .go {
color: #888;
}
.highlight .gp {
color: #555;
}
.highlight .gs {
font-weight: bold;
}
.highlight .gu {
color: #800080;
font-weight: bold;
}
.highlight .gt {
color: #a00;
}
.highlight .kc {
font-weight: bold;
}
.highlight .kd {
font-weight: bold;
}
.highlight .kn {
font-weight: bold;
}
.highlight .kp {
font-weight: bold;
}
.highlight .kr {
font-weight: bold;
}
.highlight .kt {
color: #458;
font-weight: bold;
}
.highlight .m {
color: #099;
}
.highlight .s {
color: #d14;
}
.highlight .na {
color: #008080;
}
.highlight .nb {
color: #0086B3;
}
.highlight .nc {
color: #458;
font-weight: bold;
}
.highlight .no {
color: #008080;
}
.highlight .ni {
color: #800080;
}
.highlight .ne {
color: #900;
font-weight: bold;
}
.highlight .nf {
color: #900;
font-weight: bold;
}
.highlight .nn {
color: #555;
}
.highlight .nt {
color: #000080;
}
.highlight .nv {
color: #008080;
}
.highlight .ow {
font-weight: bold;
}
.highlight .w {
color: #bbb;
}
.highlight .mf {
color: #099;
}
.highlight .mh {
color: #099;
}
.highlight .mi {
color: #099;
}
.highlight .mo {
color: #099;
}
.highlight .sb {
color: #d14;
}
.highlight .sc {
color: #d14;
}
.highlight .sd {
color: #d14;
}
.highlight .s2 {
color: #d14;
}
.highlight .se {
color: #d14;
}
.highlight .sh {
color: #d14;
}
.highlight .si {
color: #d14;
}
.highlight .sx {
color: #d14;
}
.highlight .sr {
color: #009926;
}
.highlight .s1 {
color: #d14;
}
.highlight .ss {
color: #990073;
}
.highlight .bp {
color: #999;
}
.highlight .vc {
color: #008080;
}
.highlight .vg {
color: #008080;
}
.highlight .vi {
color: #008080;
}
.highlight .il {
color: #099;
}
.highlight .gc {
color: #999;
background-color: #EAF2F5;
}
.type-csharp .highlight .k {
color: #00F;
}
.type-csharp .highlight .kt {
color: #00F;
}
.type-csharp .highlight .nf {
color: #000;
font-weight: normal;
}
.type-csharp .highlight .nc {
color: #2B91AF;
}
.type-csharp .highlight .nn {
color: #000;
}
.type-csharp .highlight .s {
color: #A31515;
}
.type-csharp .highlight .sc {
color: #A31515;
}
</style>
<style>#wrapper { max-width:900px; margin:0 auto }</style>
</head>
<body class="normal poetry">
<div id="wrapper">
<h1 id="contents"><strong>Contents</strong></h1>
<ol>
<li><p><strong>Overview of OpenShift Enterprise</strong> </p></li>
<li><p><strong>Registering and updating the operating system</strong> </p></li>
<li><p><strong>Installing and configuring DNS</strong> </p></li>
<li><p><strong>Configuring the DHCP client and hostname</strong> </p></li>
<li><p><strong>Installing and configuring MongoDB</strong> </p></li>
<li><p><strong>Installing and configuring ActiveMQ</strong> </p></li>
<li><p><strong>Installing and configuring the MCollective client</strong> </p></li>
<li><p><strong>Installing and configuring the broker application</strong> </p></li>
<li><p><strong>Configuring the broker plugins and MongoDB user accounts</strong> </p></li>
<li><p><strong>Installing the OpenShift Enterprise Web Console</strong> </p></li>
<li><p><strong>Configuring DNS resolution for the node host</strong> </p></li>
<li><p><strong>Setting up MCollective on the node host</strong> </p></li>
<li><p><strong>Installing and configuring the OpenShift Enterprise node packages</strong> </p></li>
<li><p><strong>Configuring PAM namespace module, Linux control groups (cgroups), and user quotas</strong> </p></li>
<li><p><strong>Configuring SELinux and System Control Settings</strong> </p></li>
<li><p><strong>Configuring SSH, OpenShift Port Proxy, and node configuration</strong> </p></li>
<li><p><strong>Configuring local machine for DNS resolution</strong> </p></li>
<li><p><strong>Adding cartridges</strong> </p></li>
<li><p><strong>Managing resources</strong> </p></li>
<li><p><strong>Managing districts</strong> </p></li>
<li><p><strong>Installing the RHC client tools</strong> </p></li>
<li><p><strong>Using <em>rhc setup</em></strong> </p></li>
<li><p><strong>Creating a PHP application</strong> </p></li>
<li><p><strong>Managing an application</strong> </p></li>
<li><p><strong>Using cartridges</strong> </p></li>
<li><p><strong>Using the web console to create applications</strong> </p></li>
<li><p><strong>Scaling an application</strong> </p></li>
<li><p><strong>The DIY application type</strong> </p></li>
<li><p><strong>Java EE applications using JBoss EAP</strong> </p></li>
<li><p><strong>Using Jenkins continuous integration</strong> </p></li>
<li><p><strong>Using JBoss Tools</strong> </p></li>
<li><p><strong>Using quickstarts</strong> </p></li>
<li><p><strong>Creating a quick start</strong> </p></li>
<li><p><strong>Appendix</strong> </p></li>
</ol>
<!--BREAK-->
<h1 id="overviewofopenshiftenterprise"><strong>1.0 Overview of OpenShift Enterprise</strong></h1>
<h2 id="assumptions"><strong>1.1 Assumptions</strong></h2>
<p>This lab manual assumes that you are attending an instructor led training class and that you will be using this lab manual in conjunction with the lecture. </p>
<p>I also assume that you have been granted access to two Red Hat Enterprise Linux servers with which to perform the exercises in this lab manual. If you do not have access to your servers, please notify the instructor.</p>
<p>A working knowledge of SSH, git, and yum, and familiarity with a Linux-based text editor are assumed. If you do not have an understanding of any of these technologies, please let the instructor know. </p>
<h2 id="whatyoucanexpecttolearnfromthistrainingclass"><strong>1.2 What you can expect to learn from this training class</strong></h2>
<p>At the conclusion of this training class, you should have a solid understanding of how to install and configure OpenShift Enterprise. You should also feel comfortable in the usage of creating and deploying applications using the OpenShift Enterprise web console, command line tools, and JBoss Developer Studio. </p>
<h2 id="overviewofopenshiftenterprisepaas"><strong>1.3 Overview of OpenShift Enterprise PaaS</strong></h2>
<p>Platform as a Service is changing the way developers approach developing software. Developers typically use a local sandbox with their preferred application server and only deploy locally on that instance. Developers typically start JBoss locally using the startup.sh command and drop their .war or .ear file in the deployment directory and they are done. Developers have a hard time understanding why deploying to the production infrastructure is such a time consuming process. </p>
<p>System Administrators understand the complexity of not only deploying the code, but procuring, provisioning and maintaining a production level system. They need to stay up to date on the latest security patches and errata, ensure the firewall is properly configured, maintain a consistent and reliable backup and restore plan, monitor the application and servers for CPU load, disk IO, HTTP requests, etc. </p>
<p>OpenShift Enterprise provides developers and IT organizations an auto-scaling cloud application platform for quickly deploying new applications on secure and scalable resources with minimal configuration and management headaches. This means increased developer productivity and a faster pace in which IT can support innovation. </p>
<p>This manual will walk you through the process of installing and configuring an OpenShift Enterprise environment as part of this two day training class that you are attending. </p>
<h2 id="overviewofiaas"><strong>1.4 Overview of IaaS</strong></h2>
<p>The great thing about OpenShift Enterprise is that we are infrastructure agnostic. You can run OpenShift on bare metal, virtualized instances, or on public/private cloud instances. The only thing that is required is Red Hat Enterprise Linux as the underlying operating system. We require this in order to take advantage of SELinux and other enterprise features so that you can ensure your installation is rock solid and secure. </p>
<p>What does this mean? This means that in order to take advantage of OpenShift Enterprise, you can use any existing resources that you have in your hardware pool today. It doesn’t matter if your infrastructure is based on EC2, VMware, RHEV, Rackspace, OpenStack, CloudStack, or even bare metal as we run on top of any Red Hat Enterprise Linux operating system as long as the architecture is x86_64. </p>
<p>For this training class will be using OpenStack as our infrastructure as a service layer. </p>
<h2 id="usingthekickstartscript"><strong>1.5 Using the <em>kickstart</em> script</strong></h2>
<p>In this training class, we are going to go into the details of installing and configuring all of the components required for OpenShift Enterprise. We will be installing and configuring BIND, MongoDB, DHCP, ActiveMQ, MCollective, and other vital pieces to OpenShift. Doing this manually will give you a better understanding of how all of the components of OpenShift Enterprise work together to create a complete solution. </p>
<p>That being said, once you have a solid understanding of all of the moving pieces, you will probably want to take advantage of our kickstart script that performs all the functions in the administration portion of this training on your behalf. This script will allow you to create complete OpenShift Enterprise environments in a matter of minutes. It is not intended for you to use the kickstart as part of this training class. </p>
<p>The kickstart script is located at:<br/>
https://mirror.openshift.com/pub/enterprise-server/scripts/1.0/ </p>
<p>When using the kickstart script, be sure to edit it to use the correct Red Hat subscriptions. Take a look at the script header for full instructions. </p>
<h2 id="electronicversionofthisdocument"><strong>1.6 Electronic version of this document</strong></h2>
<p>This lab manual contains many configuration items that will need to be performed on your broker and node hosts. Manually typing in all of these values would be a tedious and error prone effort. To alleviate the risk of errors, and to let you concentrate on learning the material instead of typing tedious configuration items, an electronic version of the document is available at the following URL: </p>
<pre><code>http://training.runcloudrun.com
</code></pre>
<p>In order to download all of the sample configuration files for the lab, enter the following command on your host:</p>
<pre><code># wget -rnp --reject index.\* http://training.runcloudrun.com/labs/
</code></pre>
<!--BREAK-->
<h1 id="lab1:registeringandupdatingtheoperatingsystemestimatedtime:10minutes"><strong>Lab 1: Registering and updating the operating system (Estimated time: 10 minutes)</strong></h1>
<p><strong>Server used:</strong></p>
<ul>
<li>broker host</li>
</ul>
<p><strong>Tools used:</strong></p>
<ul>
<li>SSH</li>
<li>subscription-manager</li>
<li>ntpdate</li>
<li>yum</li>
</ul>
<h2 id="registeringthesystemandaddingsubscriptions"><strong>Registering the system and adding subscriptions</strong></h2>
<p>In order to be able to update to newer packages, and to download the OpenShift Enterprise software, your system will need to be registered with Red Hat to allow your system access to appropriate software channels. You will need the following subscriptions at a minimum for this class.</p>
<ul>
<li>Red Hat Enterprise Linux Employee Subscription</li>
<li>OpenShift Enterprise Employee Subscription</li>
</ul>
<p>The machines provided to you in this lab have already been registered with the production Red Hat Network. However, they have not been enabled for the above subscriptions. List all of the available subscriptions for the account that has been registered for you:</p>
<pre><code># subscription-manager list --available
</code></pre>
<p>From the list provided, subscribe to Red Hat Enterprise Linux.</p>
<pre><code># subscription-manager subscribe --pool [POOL IID from previous command]
</code></pre>
<p>Once you have subscribed to Red Hat Enterprise Linux, the next step is subscribe to the OpenShift Enterprise Employee subscription. Complete that step and then verify that you are subscribed to both RHEL and OpenShift Enterprise.</p>
<pre><code># subscription-manager list --consumed
</code></pre>
<p>Also, take note of the yum repositories that you are now able to install packages from.</p>
<pre><code># yum repolist
</code></pre>
<h2 id="updatingtheoperatingsystemtothelatestpackages"><strong>Updating the operating system to the latest packages</strong></h2>
<p>We need to update the operating system to have all of the latest packages that may be in the yum repository for RHEL Server. This is important to ensure that you have a recent update to the SELinux packages that OpenShift Enterprise relies on. In order to update your system, issue the following command:</p>
<pre><code># yum update
</code></pre>
<p><strong>Note:</strong> Depending on your connection and speed of your broker host, this installation make take several minutes. </p>
<h2 id="configuringtheclocktoavoidclockskew"><strong>Configuring the clock to avoid clock skew</strong></h2>
<p>OpenShift Enterprise requires NTP to synchronize the system and hardware clocks. This synchronization is necessary for communication between the broker and node hosts; if the clocks are too far out of synchronization, MCollective will drop messages. Every MCollective request (discussed in a later lab) includes a time stamp, provided by the sending host’s clock. If a sender’s clock is substantially behind a recipient’s clock, the recipient drops the message. This is often referred to as clock skew and is a common problem that users encounter when they fail to sync all of the system clocks.</p>
<pre><code># ntpdate clock.redhat.com
# chkconfig ntpd on
# service ntpd start
</code></pre>
<p><strong>Lab 1 Complete!</strong> </p>
<!--BREAK-->
<h1 id="lab2:installingandconfiguringdnsestimatedtime:20minutes"><strong>Lab 2: Installing and configuring DNS (Estimated time: 20 minutes)</strong></h1>
<p><strong>Server used:</strong></p>
<ul>
<li>broker host</li>
</ul>
<p><strong>Tools used:</strong></p>
<ul>
<li>SSH</li>
<li>BIND</li>
<li>text editor (vi, emacs, nano, etc.)</li>
<li>environment variables</li>
<li>SELinux</li>
<li>Commands: cat, echo, chown, dnssec-keygen, rndc-confgen, restorecon, chmod, lokkit, chkconfig, service, nsupdate, ping, dig</li>
</ul>
<p><strong>Note: For this lab, use the 192.x.x.x IP address when setting up your nameserver</strong> </p>
<h2 id="installingthebinddnsserver"><strong>Installing the BIND DNS Server</strong></h2>
<p>In order for OpenShift Enterprise to work correctly, you will need to configure BIND so that you have a DNS server setup. At a typical customer site, they will have an existing DNS infrastructure in place. However, for the purpose of this training class, we need to install and configure our own server so that name resolution works properly. Primarily, we will be using name resolution for communication between our broker and node hosts as well as dynamically updating our DNS server to resolve gear application names when we start creating application gears. </p>
<p>This lab starts off by requiring the installation of both <em>bind</em> and <em>bind-utils</em> packages.</p>
<pre><code># yum install bind bind-utils
</code></pre>
<h2 id="creatingenvironmentvariablesandadnsseckeyfile"><strong>Creating environment variables and a DNSSEC key file</strong></h2>
<p>The official OpenShift documentation suggests that you set an environment variable for the domain name that you will be using to facilitate faster configuration of BIND. Let’s follow the suggested route for this training class by issuing the following command:</p>
<pre><code># domain=example.com
</code></pre>
<p>DNSSEC, which stands for DNS Security Extensions, is a method by which DNS servers can verify that DNS data is coming from the correct place. You create a private/public key pair to determine to authenticity of the source domain name server. In order to implement DNSSEC on our new PaaS, we need to create a key file, which we will store in /var/named. For convenience, set the $keyfile variable now to the location of the this key file:</p>
<pre><code># keyfile=/var/named/${domain}.key
</code></pre>
<p>Create a DNSSEC key pair and store the private key in a variable named $key by using the following commands:</p>
<pre><code># cd /var/named
# dnssec-keygen -a HMAC-MD5 -b 512 -n USER -r /dev/urandom ${domain}
# KEY="$(grep Key: K${domain}*.private | cut -d ' ' -f 2)"
# cd -
# rndc-confgen -a -r /dev/urandom
</code></pre>
<p>Verify that the key was created properly by viewing the contents of the key variable:</p>
<pre><code># echo $KEY
</code></pre>
<p>Configure the ownership, permissions, and SELinux context for the key we created:</p>
<pre><code># restorecon -v /etc/rndc.* /etc/named.*
# chown -v root:named /etc/rndc.key
# chmod -v 640 /etc/rndc.key
</code></pre>
<h2 id="creatingthefowarders.confconfigurationfileforhostnameresolution"><strong>Creating the <em>fowarders.conf</em> configuration file for host name resolution</strong></h2>
<p>The DNS forwarding facility of BIND can be used to create a large site-wide cache on a few servers, reducing traffic over links to external nameservers. It can also be used to allow queries by servers that do not have direct access to the Internet, but wish to look up exterior names anyway. Forwarding occurs only on those queries for which the server is not authoritative and does not have the answer in its cache. </p>
<p>Create a forwards.conf file with the following commands: </p>
<p><strong>The forwarders.conf file is available on the lab support website</strong></p>
<pre><code># echo "forwarders { 8.8.8.8; 8.8.4.4; } ;" >> /var/named/forwarders.conf
# restorecon -v /var/named/forwarders.conf
# chmod -v 755 /var/named/forwarders.conf
</code></pre>
<h2 id="configuringsubdomainresolutionandcreatinganinitialdnsdatabase"><strong>Configuring subdomain resolution and creating an initial DNS database</strong></h2>
<p>To ensure that we are starting with a clean <em>/var/named/dynamic</em> directory, let’s remove this directory if it exists:</p>
<pre><code># rm -rvf /var/named/dynamic
# mkdir -vp /var/named/dynamic
</code></pre>
<p>Issue the following command to create the <em>${domain}.db</em> file (before running this command, verify that the domain variable you set earlier in this lab is available to your current session): </p>
<p><strong>The example.com.db file is available on the lab support website</strong> </p>
<pre><code>cat <<EOF > /var/named/dynamic/${domain}.db
\$ORIGIN .
\$TTL 1 ; 1 seconds (for testing only)
${domain} IN SOA ns1.${domain}. hostmaster.${domain}. (
2011112904 ; serial
60 ; refresh (1 minute)
15 ; retry (15 seconds)
1800 ; expire (30 minutes)
10 ; minimum (10 seconds)
)
NS ns1.${domain}.
MX 10 mail.${domain}.
\$ORIGIN ${domain}.
ns1 A 127.0.0.1
EOF
</code></pre>
<p>Once you have entered the above echo command, cat the contents of the file to ensure that the command was successful:</p>
<pre><code># cat /var/named/dynamic/${domain}.db
</code></pre>
<p>You should see the following output: </p>
<pre><code>$ORIGIN .
$TTL 1 ; 1 second
example.com IN SOA ns1.example.com. hostmaster.example.com. (
2011112916 ; serial
60 ; refresh (1 minute)
15 ; retry (15 seconds)
1800 ; expire (30 minutes)
10 ; minimum (10 seconds)
)
NS ns1.example.com.
MX 10 mail.example.com.
$ORIGIN example.com.
ns1 A 127.0.0.1
</code></pre>
<p>Now we need to install the DNSSEC key for our domain: </p>