Skip to content

Commit 65e66bb

Browse files
Solr Installation
1 parent 5a9f9d1 commit 65e66bb

File tree

4 files changed

+611
-0
lines changed

4 files changed

+611
-0
lines changed

Solr-Install/Install-Solr.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
#Check for Sitecore Gallery regristration, if not regestered add it.
3+
if(!(Get-PSRepository | Where-Object{$_.Name -eq "SitecoreGallery"})){Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2;}
4+
5+
#Install Sitecore Install Framewokr
6+
Install-Module SitecoreInstallFramework
7+
8+
#Update SitecoreInstallFramework
9+
Update-Module SitecoreInstallFramework
10+
11+
Install-SitecoreConfiguration .\SolrInstall-config.json

Solr-Install/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Installing Solr
2+
3+
## Summary
4+
5+
This is a re-package of the Solr Install script created by Jeremy Davis in 2017, and found at https://gist.github.com/jermdavis/49018386ae7544ce0689568edb7ca2b8 in which I forked in February 2018 for use with Sitecore installations.
6+
7+
## How to Use
8+
9+
1. Open a PowerShell command prompt with 'Run as Administrator'
10+
2. At the prompt change the directory the location of this file
11+
3. Ensure that Sitecore Installation Framework is installed by running
12+
```powershell Get-Module SitecoreInstallFramework -ListAvailable```
13+
4. You need to confirm that you have at least 2.0.0 installed, updates can be achieved by running
14+
```powershell Update-Module SitecoreInstallFramework```
15+
5. Update the following minimal parameters in *SolrInstal-Config.json* to represent your environment
16+
1. InstallFolder
17+
2. SolrHost
18+
3. SolrPort
19+
4. SolrServiceName
20+
5. SolrVersion
21+
6. JREVersion
22+
6. Run the following command
23+
```powershell Install-SitecoreConfiguration .\SolrInstall-config.json```
24+
7. If you at first get a cannot connect message in the browser, refresh and the Solr Admin UI should display
25+
26+
### Optional Install Steps
27+
28+
1. Update the following minimal parameters in *SolrInstal-Config.json* to represent your environment
29+
1. InstallFolder
30+
2. SolrHost
31+
3. SolrPort
32+
4. SolrServiceName
33+
5. SolrVersion
34+
6. JREVersion
35+
2. Run the following: ```powershell .\Install-Solr.ps1```
36+
1. This will run a script that ensures that Sitecore Install Framework is on the machine and then runs the Solr installation based on the SolrInstall-config.json.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"Parameters" : {
3+
"SolrVersion": {
4+
"Type": "string",
5+
"DefaultValue": "7.7.2",
6+
"Description": "What version of Solr should be downloaded for install"
7+
},
8+
"InstallFolder": {
9+
"Type": "string",
10+
"DefaultValue": "c:\\solr772",
11+
"Description": "Where should Solr and NSSM be installed to"
12+
},
13+
"SolrHost": {
14+
"Type": "string",
15+
"DefaultValue": "solr772.thecodeattic.sc",
16+
"Description": "What host name should the Solr service use"
17+
},
18+
"SolrPort": {
19+
"Type": "string",
20+
"DefaultValue": "8987",
21+
"Description": "The port the Solr service should use"
22+
},
23+
"SolrServiceName":{
24+
"Type": "string",
25+
"DefaultValue": "solr-7.7.2",
26+
"Description": "The name the NSSM service will be called"
27+
},
28+
"JREVersion": {
29+
"Type": "string",
30+
"DefaultValue": "9.0.4",
31+
"Description": "What version of the Java Runtime should "
32+
},
33+
34+
"NSSMVersion": {
35+
"Type": "string",
36+
"DefaultValue": "2.24-101-g897c7ad",
37+
"Description": "What version of NSSM should be downloaded for install"
38+
},
39+
40+
"DownloadFolder": {
41+
"Type": "string",
42+
"DefaultValue": "~\\Downloads",
43+
"Description": "Where should downloaded files be placed"
44+
},
45+
"SolrUseSSL": {
46+
"Type": "boolean",
47+
"DefaultValue": true,
48+
"Description": "Should Solr require HTTPS for access?"
49+
}
50+
},
51+
52+
"Modules" : [
53+
"SolrInstall-SIF-Extensions.psm1"
54+
],
55+
56+
"Variables" : {
57+
"NSSMSourcePackage": "[concat('https://nssm.cc/ci/nssm-', parameter('NSSMVersion'), '.zip')]",
58+
"SolrSourcePackage": "[concat('https://archive.apache.org/dist/lucene/solr/', parameter('SolrVersion'), '/solr-', parameter('SolrVersion'), '.zip')]",
59+
"JREPath": "[concat('C:\\Program Files\\Java\\jre-', parameter('JREVersion'))]",
60+
"SolrInstallFolder": "[concat(parameter('InstallFolder'), '\\solr-', parameter('SolrVersion'))]",
61+
"SolrName": "[concat(parameter('SolrHost'), '-', parameter('SolrVersion'))]",
62+
"CertStoreFile": "[concat(variable('SolrInstallFolder'), '\\server\\etc\\solr-ssl.keystore.pfx')]"
63+
},
64+
65+
"Tasks" : {
66+
"Ensure NSSM is installed": {
67+
"Type": "EnsureNSSM",
68+
"Params": {
69+
"downloadFolder": "[parameter('DownloadFolder')]",
70+
"nssmVersion": "[parameter('NSSMVersion')]",
71+
"installFolder": "[parameter('InstallFolder')]",
72+
"nssmSourcePackage": "[variable('NSSMSourcePackage')]"
73+
}
74+
},
75+
"Ensure Solr is installed": {
76+
"Type": "EnsureSolr",
77+
"Params": {
78+
"downloadFolder": "[parameter('DownloadFolder')]",
79+
"solrVersion": "[parameter('SolrVersion')]",
80+
"installFolder": "[parameter('InstallFolder')]",
81+
"solrSourcePackage": "[variable('SolrSourcePackage')]"
82+
}
83+
},
84+
"Ensure Java_Home environent variable is set": {
85+
"Type": "EnsureJavaHome",
86+
"Params": {
87+
"jrePath": "[variable('JREPath')]"
88+
}
89+
},
90+
"Ensure host name exists": {
91+
"Type": "EnsureHostName",
92+
"Params": {
93+
"solrHost": "[parameter('SolrHost')]"
94+
}
95+
},
96+
"Rewrite Solr config file": {
97+
"Type": "ConfigureSolr",
98+
"Params": {
99+
"solrSSL": "[parameter('SolrUseSSL')]",
100+
"solrHost": "[parameter('SolrHost')]",
101+
"solrRoot": "[variable('SolrInstallFolder')]",
102+
"certificateStore": "[variable('CertStoreFile')]"
103+
}
104+
},
105+
"Ensure trusted SSL certificate exists (if required)": {
106+
"Type": "EnsureSSLCertificate",
107+
"Params": {
108+
"solrSSL": "[parameter('SolrUseSSL')]",
109+
"solrName": "[variable('SolrName')]",
110+
"solrHost": "[parameter('SolrHost')]",
111+
"certificateStore": "[variable('CertStoreFile')]"
112+
}
113+
},
114+
"Ensure Solr runs as a service": {
115+
"Type": "EnsureSolrService",
116+
"Params": {
117+
"solrName": "[parameter('SolrServiceName')]",
118+
"installFolder": "[parameter('InstallFolder')]",
119+
"nssmVersion": "[parameter('NSSMVersion')]",
120+
"solrRoot": "[variable('SolrInstallFolder')]",
121+
"solrPort": "[parameter('SolrPort')]"
122+
}
123+
},
124+
"Verify Solr is working": {
125+
"Type": "SolrInstall",
126+
"Params": {
127+
"solrSSL": "[parameter('SolrUseSSL')]",
128+
"solrHost": "[parameter('SolrHost')]",
129+
"solrPort": "[parameter('SolrPort')]"
130+
}
131+
}
132+
}
133+
134+
}

0 commit comments

Comments
 (0)