User Tools

Site Tools


development:artifactory

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
development:artifactory [2023/02/03 21:49] – updated url and stop command 10.91.110.100development:artifactory [2023/07/24 10:28] (current) bosowski
Line 1: Line 1:
-====== Errigal Artifactory ======+====== Errigal Artifactory / Nexus Sonatype ======
  --- //[[anna.dowling@errigal.com|Anna Dowling]] 2018/01/08 08:53//  --- //[[anna.dowling@errigal.com|Anna Dowling]] 2018/01/08 08:53//
 --- //[[anthony.ryan@errigal.com|Anthony Ryan]] 2023/02/03// --- //[[anthony.ryan@errigal.com|Anthony Ryan]] 2023/02/03//
Line 7: Line 7:
  
  
-<code> + 
- new artifactory on moros.err http://artifactory2.err:4041/ + new artifactory at http://artifactory.errigal.com is run as a Nexus docker container via docker-compose.yml file, located at ''ubuntu@10.91.133.220:/home/ubuntu/docker/nexus/docker-compose.yml'' 
- data is mounted using the following command + <code>docker compose up -d</code> 
- docker run -d -p 8081:8081 --name nexus -v /home/scotty/nexus-data:/nexus-data sonatype/nexus3 + 
-</code>+ Stopped using <code>docker compose down</code> 
 + 
 + restarts are done via  <code>docker compose down; docker compose up</code> 
  
 **Location:** **Location:**
-  * The Artifactory server is cloud hosted via aws. +  * The Artifactory server is hosted on our Waterford openstack.
-  * It is located on the Errigal aws account(details of which can be found in pwSafe) in the **N.Virginia** region.+
 **Access:** **Access:**
-  * The key for accessing this account can be found on dropbox in the following location: **~/Dropbox/Errigal Shared Documents/Amazon EC2/dev keys/artefactory keys/artefactory.pem** +  * The key for accessing this account can be found on dropbox in the following location:  
-  * An example of how you would ssh to this server is as follows: **ssh -i artefactory.pem ubuntu@ec2-23-23-106-9.compute-1.amazonaws.com**+  * ssh to the server via ssh ubuntu@10.91.133.220
  
  
  
-* 03/Feb  
-* Artifactory2 is run as a Nexus docker container and can be stopped using **sudo docker stop nexus** 
  
  
 +**URL:**
  
 +  * http://artifactory.errigal.com/
  
-**URL:** 
-  * http://artifactory2.err:4041/artifactory/webapp/home.html?0 
  
 +** Out of Space Issues **
 +
 +If the nexus server drops below 4G you will see in the logs the DB has moved to read only
 +
 +The only known approach so far is 
 +
 +   * login to the docker container as root ** sudo docker exec -u 0 -it nexus /bin/bash
 +**
 +   * edit the **nexus.vmoptions** file located in **cd /opt/sonatype/nexus/bin/**
 +   * or **vi /opt/sonatype/nexus/bin/nexus.vmoptions**
 +   * add or uncomment the following line **-Dstorage.diskCache.diskFreeSpaceLimit=1024
 +**
 +   * exit docker bash
 +   * restart nexus **sudo docker restart nexus**
 +   * the Nexus is now in an editable state and artifacts can be removed in an effort to claim back space
 +
 +
 +===== Cheats approach =====
 +
 +* edit file and remove # from last line
 +   * **sudo docker exec -u 0 -it nexus  vi /opt/sonatype/nexus/bin/nexus.vmoptions**
 +   * restart nexus **sudo docker restart nexus**
 +
 +
 +Once you have deleted number of artifacts, (start with largest first, to get going) you must run the **Compact Blob store** task to reduce space
 +
 +   * Go to the tasks list under the Admin tab (you must be logged in)
 +   * run the Compact process, as its only set to weekly due to length of execution
 +   * This may affect the artifactory being written to (it has performance implications)
 +{{:development:2023-nexus-compact-blob-store.jpg?400|}}
 +   * on success run the **df -h** command and verify that the disk space is > 3G
 +      * **/dev/nvme0n1p1   60G   53G  7.5G  88% /**
 +
 +
 +===== Enable Admin Execute Script =====
 +
 +Nexus allows the execution of groovy scripts on the repo, which is useful to find largest files etc
 +
 +but this must be enabled
 +
 +Reference [[https://support.sonatype.com/hc/en-us/articles/360045220393-Scripting-Nexus-Repository-Manager-3|Sonatype Support page]]
 +
 +  * Edit $data-dir/etc/nexus.properties. 
 +  * Add the following on a new line, making sure the file is saved with an ending new line and with the original file permissions:
 +<WRAP center round box 60%>
 +nexus.scripts.allowCreation=true
 +</WRAP>
 +  * Restart NXRM to pick up the property change.
 +
 +
 +===== Configure Cleanup Policy =====
 +
 +The artifactory needs to ensure that older redundant builds are periodically cleaned out, otherwise it will quickly fill up. SnmpManager is a large war file on its own.
  
 +To do this we use the Clean Up Policy Manager, example configuration deletes after 15 days
  
 +{{:development:nexus_clean_up_policy_example.png?400|}}
development/artifactory.1675460949.txt.gz · Last modified: 2023/02/03 21:49 by 10.91.110.100