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
Copy file name to clipboardExpand all lines: tutorial1/README.md
+69-4
Original file line number
Diff line number
Diff line change
@@ -523,7 +523,7 @@ If your workstation or laptop is running Windows, then you may proceed using eit
523
523
524
524
### Username and Password
525
525
526
-
Once you've successfully logged into your head node VM, you are encouraged to change your password so that you may access your head node through the OpenStack VNC console interface.
526
+
Once you've successfully logged into your head node VM, you are encouraged to setup your password login as a fail safe incase your ssh keys are giving issue, you may also access your head node through the OpenStack VNC console interface.
527
527
528
528
```bash
529
529
sudo passwd <username>
@@ -539,10 +539,75 @@ Once logged into your head node, you can now make use of the [previously discuss
539
539
540
540
<palign="center"><imgalt="Verifying head node basic networking configuration."src="./resources/head_node_basic_networking_commands.png"width=900 /></p>
541
541
542
-
## Manual Pages `man`, Reading Documents `cat` and the `-h` Switch
543
-
## Piping `|` Through `grep`, `more` or `less`
544
-
## Redirecting `>>` Console Output to a File
542
+
## Manual Pages `man`
543
+
In linux every information about all linux commands is found in a linux built in manual page document. This doncument is accessible via a command called `man` short term for manual page. Run the ff commands to understand what each command mean, scroll up and down then press `q` to exit the page, these are some of the commands you will use throught the week.
544
+
545
+
```bash
546
+
man sudo
547
+
man ping
548
+
man tracepath
549
+
man ls
550
+
man cat
551
+
552
+
```
553
+
<palign="center"><imgalt="manual page for `sudo` command"src="./resources/man_sudo_feedback.png"width=900 /></p>
554
+
555
+
556
+
## the `-h` Switch
557
+
If you don't want to use the `man` command to learn about each command and related options, you can use the `--help or -h` flag to see which options are available for a specific command. run the ff command to learn about available options each command has.
558
+
559
+
```bash
560
+
561
+
sudo -h
562
+
ifconfig -h
563
+
ping -h
564
+
ssh-keygen --help
565
+
grep --help
566
+
567
+
```
568
+
569
+
<palign="center"><imgalt="manual page for `sudo` command"src="./resources/sudo_with-h_flag.png"width=900 /></p>
570
+
571
+
572
+
## Reading Documents
573
+
you will be reading a lof of files throughout the week and the ff commands can be used to read files with ease, use `man` to learn about each command. All the following command are used to read the content of a file `staff_list.txt`
574
+
575
+
```bash
576
+
less staff_list.txt
577
+
more staff_list.txt
578
+
cat staff_list.txt
579
+
vi staff_list.txt
580
+
nana staff_list.txt
581
+
582
+
583
+
```
584
+
585
+
<palign="center"><imgalt="cat prints the content of file on screen"src="./resources/cat_command.png"width=900 /></p>
586
+
587
+
<palign="center"><imgalt="read the content of the file with `less` command "src="./resources/less_command.png"width=900 /></p>
588
+
589
+
## Piping
590
+
591
+
`|` Through `grep` is used when searching the content of the file, if it exist it will be printed on the screen, if the search does not exist nothing will show on the screen.
592
+
593
+
<palign="center"><imgalt="search the file with `grep` command "src="./resources/search_commands_grep.png"width=400 /></p>
594
+
595
+
## Console Output to a File
596
+
597
+
`>` replaces the content of an output file with all input content
598
+
`>>` appends the input content to the end of the output file.
599
+
600
+
<palign="center"><imgalt="appends james at the endo of staff_list.txt file"src="./resources/append.png"width=900 /></p>
601
+
602
+
<palign="center"><imgalt="replaces the content of staff_list.txt file with james"src="./resources/replaces.png"width=900 /></p>
603
+
545
604
## GNU `history` Library
605
+
`history` command shows all commands you have executed so far, the feedback is numbered, use `!14` to rerun the 20th command
Copy file name to clipboardExpand all lines: tutorial2/README.md
+173-16
Original file line number
Diff line number
Diff line change
@@ -93,9 +93,12 @@ This tutorial will demonstrate how to access web services that are on your virtu
93
93
94
94
# Spinning Up a Compute Node in OpenStack
95
95
96
-
play around
97
96
98
-
scripting and automation to test out differnet configurations
97
+
# Manually from openstack dashboard
98
+
To launch your compute node vm, go to `Compute-> Instances` click `launch instance` and follow the headnode vm launch process on Tutorial 1. **remember** to use `compute` flavors and `local_team_keys` used when launching the headnode on Tutorial 1.
99
+
100
+
101
+
# scripting and automation to test out differnet configurations
99
102
100
103
As previously discussed in [Tutorial 1: OpenStack Flavors](../tutorial1/README.md#openstack-instance-flavors), an important aspect of system administration is resource monitoring, management and utilization. Once you have successfully stood up your head node, your team will need to plan and manage the resources remaining which will be available for your compute node(s).
101
104
@@ -112,7 +115,7 @@ Sensible default instance flavors have already been identified and configured fo
112
115
113
116
One important distinction between your head node and compute node(s), is that the compute nodes will **not** have a floating IP associated to them. Your head node will act as a ***Gateway*** for your Compute Node(s), and ***Route*** traffic between the internet and your cluster, using a method referred to as ***Network Address Translation (NAT)***, which was discussed in the [WiFi Hotspot Example](../tutorial1/README.md#wifi-hotspot-example).
114
117
115
-
The final important consideration that must be made for your compute node is that you must not forget to configure an SSH key, so that you may access it after it has successfully launched. For ease of access and to simplify your configuration, you are *strongly* advised to use the same SSH key that you'd [previously generated](../tutorial1/README.md#generating-ssh-keys).
118
+
The final important consideration that must be made for your compute node is that you must not forget to configure an SSH key, so that you may access it after it has successfully launched. For ease of access and to simplify your configuration, you are *strongly* advised to use the same SSH key that you'd [previously generated](../tutorial1/README.md#generating-ssh-keys) on your local machine/laptop.
116
119
117
120
# Accessing Your Compute Node
118
121
@@ -128,7 +131,7 @@ TODO: High level explanation of OpenStack's automatic network configuration and
128
131
129
132
TODO: Maybe remove the default routing table on compute node and route through headnode?
130
133
131
-
## Command Line Proxy Jump Directive
134
+
## Command Line Proxy Jump Directive
132
135
133
136
From you workstation, using either MobaXTerm or Windows Powershell, you can `ssh` directly into your compute node by first making an **ssh** connection too your head node and then establishing a TCP forwarding connection to your compute node. Using this method, the SSH keys for both your head node and compute node must reside on your local workstation:
134
137
@@ -207,8 +210,11 @@ Just as you did so in the previous tutorial when you generated SSH keys [on your
207
210
208
211
# Understanding the Roles of the Head Node and Compute Node
209
212
Networking Diagram and client server model
213
+
headnode (hd) and compute node (cn) relationship follow a server (hd) - client (cn) relations, the headnode carries the systems services and compute node does all the computations
210
214
System software need to be installed on both head node and compute nodes
211
-
Do not ssh endlessly between head and compute nodes, one terminal example or multiplexing
215
+
Do not ssh endlessly between head and compute nodes, one terminal example or multiplexing (screen sessions via `tmux`)
216
+
217
+
212
218
## Terminal Multiplexers
213
219
214
220
Discuss GNU Screen and [tmux](https://github.com/tmux/tmux/wiki)
@@ -256,7 +262,7 @@ sudo apt-get install tmux
256
262
To start a new `tmux` session on your **head node**:
257
263
258
264
```bash
259
-
tmux
265
+
tmux new -s session_name
260
266
```
261
267
262
268
### Working on your Head Node and Compute Node in Two Adjacent Panes
@@ -333,18 +339,169 @@ Should your terminal application close, or if you relocate from the laboratores.
333
339
To connect to an existing `tmux` session on your **head node**:
334
340
335
341
```bash
336
-
tmux attach
342
+
tmux a -t session_name
343
+
```
344
+
345
+
346
+
## Basic Linux commands
347
+
348
+
# Basic System Monitoring
349
+
`top``htop` are system built commands used to monitor server resource suage. for`htop` first install epel source repository then install htop
If you are lost and don't know where you currently working use `pwd` (print working directory), it will show you your current woring space
366
+
367
+
```bash
368
+
pwd
369
+
```
370
+
371
+
372
+
## Manipulating Files and Directories
373
+
374
+
# Make a New Directory
375
+
376
+
`mkdir` command is used to create folders or directories, the `-p` flag means create the directory path `mnu/2024` if it does not exits before creating `SCC` directory.
377
+
378
+
```bash
379
+
mkdir SCC
380
+
mkdir -p mnu/2024/SCC
381
+
```
382
+
383
+
384
+
385
+
# creating new Files
386
+
The following commands are used to create and edit files
387
+
`touch` create a new file(s)
388
+
389
+
`vi, vim, nano ` file editor commands and are used to edit existing files, but if a file does not exist it will create the file and open it for editing.
390
+
391
+
392
+
```bash
393
+
touch file
394
+
395
+
vi file1
396
+
```
397
+
398
+
399
+
400
+
# List Directory
401
+
`ls` (list) command used to list the content of directory/folder.
402
+
403
+
```bash
404
+
ls
405
+
406
+
ls mnu/2024/SCC
407
+
```
408
+
409
+
`ls` list or prints the content of the current directory
410
+
`ls mnu/2024/SCC` list or print the content of the last `SCC` directory
411
+
412
+
413
+
414
+
# Change Directory
415
+
416
+
`cd` commad allow you move from directory to directory
417
+
418
+
```bash
419
+
420
+
cd mnu/2024/SCC
421
+
422
+
```
423
+
424
+
`cd mnu/2024/SCC` means moving to `SCC` directory, you can verify your current working directory by `pwd` command
425
+
426
+
<p align="center"><img alt="change from current to SCC directory" src="./resources/cdexample.png" width=700 /></p>
427
+
428
+
429
+
430
+
431
+
# Copy File or Directory
432
+
433
+
`cp` copy files/directories from source to destinations, it works like windows `copy and paste`.
434
+
435
+
```bash
436
+
mkdir -p mnu/2024/team
437
+
cp -r mnu/2024/SCC mnu/2024/team/
438
+
439
+
```
440
+
441
+
`mkdir -p mnu/2024/team` creates a team directory/folder under mnu/2024 directoy path
442
+
`cp -r mnu/2024/SCC mnu/2024/team/` will recursilvely copy the `SCC` directory and it content to `mnu/2024/team/` directory.
443
+
444
+
<p align="center"><img alt="creating the SCC directory" src="./resources/cpexamble.png" width=700 /></p>
445
+
446
+
447
+
448
+
449
+
# Move File or Directory
450
+
451
+
`mv` command literally moves files/directories from source to destinations, it work like windows `cut and paste`.
452
+
453
+
454
+
```bash
455
+
mv staff_list.txt mnu/2024/team/SCC
456
+
457
+
```
458
+
459
+
`staff_list.txt` file is being moved to SCC directory
460
+
461
+
<p align="center"><img alt="moving staff list file to SCC directory" src="./resources/mvcommandexample.png" width=700 /></p>
462
+
463
+
464
+
465
+
466
+
# Remove File or Directory
467
+
468
+
`rm` remove command used to delete files, directory with `-r` flag
469
+
470
+
```bash
471
+
rm mnu/2024/team/SCC/staff_list.txt
472
+
rm -r mnu/2024/team/SCC
473
+
474
+
```
475
+
476
+
<p align="center"><img alt="moving staff list file to SCC directory" src="./resources/rmcommand.png" width=700 /></p>
477
+
<p align="center"><img alt="moving staff list file to SCC directory" src="./resources/rmcommandexample.png" width=700 /></p>
478
+
479
+
480
+
481
+
482
+
# The history Command
483
+
484
+
`history` command shows all commands you have executed so far, the feedback is numbered, use `!14` to rerun the 20th command
<p align="center"><img alt="rerun commands from history " src="./resources/rerun_command_from_history.png" width=900 /></p>
488
+
489
+
490
+
491
+
492
+
# The virtual environment Command
493
+
494
+
`virtualenv` command helps you run multiple services with conflicting packages without any problems. each virtual enviroment is treated as an independant entity.
495
+
Below is how you create and source or access a virtual enviroment then deactivate to exit, ensure to use sensible names.
0 commit comments