ArcGIS Enterprise10.8.1部署在Linux環境下安裝教程
ArcGIS Enterprise基礎部署Linux版安裝教程)
- 1 準備工作
- 2 安裝和配置ArcGIS Server
- 3 安裝和配置ArcGIS Data Store
- 4 安裝和配置Portal for ArcGIS
- 5 安裝和配置ArcGIS Web Adaptor
- 6 為Portal和Server配置聯合託管
- 7 在Linux上設定開機自啟動
- systemctl stop arcgisserver.service
- systemctl start arcgisserver.service
- systemctl status arcgisserver.service
- systemctl stop arcgisportal.service
- systemctl start arcgisportal.service
- systemctl status arcgisportal.service
- 8 常見問題及解決辦法
windows版安裝教程:
Windows server2012配置enterprise10.8.1的Web_Adaptor_Java版安裝詳細教程
1 準備工作
1.1 遠端到Linux伺服器
Linux一般作為伺服器使用,而伺服器一般放在機房,你不可能在機房操作你的Linux伺服器,這時我們就需要遠端登入到Linux伺服器來管理維護系統。
Linux系統中是通過ssh服務實現的遠端登入功能,預設ssh服務埠號為 22。
Window系統上Linux遠端登入客戶端有SecureCRT, Putty, SSH Secure Shell等,這裡我用的是putty。
安裝好之後,輸入伺服器的ip和賬戶密碼即可連線上。
連線之後顯示介面如下,在這個介面中我們就可以輸入各種Linux命令了:
1.2 拷貝並解壓安裝介質
1.2.1 拷貝
首先,我們需要將放置在windows系統下的安裝檔案拷貝到Linux系統下。這裡我用的是一款綠色免安裝的WinSCP軟體,可以視覺化的在windows和Linux之間上傳下載檔案。
為了保險起見,上傳完後我把資料夾改成了全英文,以保證全英文路徑,如下/root/。
1.2.2 解壓
接下來我們就可以使用以下命令對安裝檔案進行解壓了,依次將所有檔案和安裝包都解壓完成。如:
$ tar -zxvf ArcGIS_Server_Linux_1081_175289.tar.gz
1.3 環境說明
系統版本:CentOS 7.6.1810
軟體版本:ArcGIS 10.8.1。
檢視系統版本命令:cat /etc/redhat-release
本次採用1臺機器的安裝方式,即將Portal、Server、ArcGIS Web Adaptor、ArcGIS Data Store的基礎元件都裝在同一臺機器上。
1.4 環境準備
1.4.1 關閉防火牆(可選)
停止防火牆:
[[email protected] home]# systemctl stop firewalld.service
禁用防火牆的開機啟動:
[[email protected] home]# systemctl disable firewalld.service
檢視防火牆狀態:
[[email protected] home]# systemctl status firewalld.service
以下提示說明防火牆已經關閉:
Tips:不關閉防火牆時,可選擇放行埠。單機環境下部署ArcGIS Enterprise時,可考慮僅開啟:
- 80和443,確保外部客戶端可通過Web Adaptor訪問到Portal for ArcGIS或ArcGIS for Server服務頁面;
- 當Web Adaptor層未啟用ArcGIS for Server的管理功能時,則需開啟6080和6443埠,確保外部客戶端上的ArcMap向此環境下的ArcGIS for Server釋出服務。關於ArcGIS Enterprise更多的埠資訊,請參考下面的連結。
- ArcGIS Server所用埠號:
http://server.arcgis.com/en/server/latest/install/windows/ports-used-by-arcgis-server.htm - Portal for ArcGIS所用埠號:
http://server.arcgis.com/en/portal/latest/administer/windows/ports-used-by-portal-for-arcgis.htm - ArcGIS Data Store所用埠號:
http://server.arcgis.com/en/portal/latest/administer/windows/ports-used-by-arcgis-data-store.htm
1.4.2 建立使用者和組
使用groupadd和useradd命令建立使用者arcgis和組esrichina,並將arcgis使用者加入esrichina組,arcgis使用者的密碼也是arcgis:
[[email protected] home]# groupadd esrichina
[[email protected] home]# useradd -g esrichina -m arcgis
[[email protected] home]# passwd arcgis
注:
-
cat /etc/passwd
檢視所有使用者的資訊
-
cat /etc/passwd | grep 使用者名稱
查詢某個使用者
-
cat /etc/group|grep 組名
查詢某個使用者組
1.4.3 修改機器名,對應ip
ArcGIS Enterprise的安裝要求計算機名是完全限定域名的形式。這一修改可通過編輯/etc/hostname和/etc/hosts兩個檔案實現。
1.4.3.1 修改hostname檔案
命令如下:[[email protected] ~]# vi /etc/hostname
在檔案中寫入T990,儲存。
Tips:
1、如果進入檔案後不能輸入或編輯,請按鍵盤i鍵,待底部出現insert字樣即可編輯。
2、修改完後,按Esc+:+wq進行儲存(Esc+:+q!不儲存)。
1.4.3.2 修改network檔案
1)將/etc/sysconfig/network檔案中的hostname修改為T990,命令如下:
[[email protected] ~]# vi /etc/sysconfig/network
2)使用more命令檢視下修改是否成功:
[[email protected] ~]# more /etc/sysconfig/network
1.4.3.3 修改host檔案
1) 使用vi /etc/hosts命令:
在/etc/hosts中新增hostname對應的ip地址,修改內容如下:
2) 執行命令:hostname T990,
讓修改的hostname立即生效(重啟也可以讓hostname立即生效,重啟命令:reboot)
[[email protected] ~]# hostname T990
1.4.3.4 檢測主機名修改是否成功
檢查下主機名是否符合規範,命令如下:
[[email protected] ~]# hostname 檢視域名
[[email protected] ~]# hostname –f 檢視完全限定域名
Tips:1. 修改hosts檔案,vim /etc/hosts,一般不能去掉localhost,去掉後zookeeper等框架可能會出問題;
2. 不能只修改/etc/sysconfig/network,而不修改/etc/hosts,因為java的InetAddress要通過hostname來去/etc/hosts中找對應的ip,取不到會報UnknownHostException異常。
1.4.4 修改資料夾許可權
在第1章的1.2中我們已經拷貝並解壓了安裝檔案,且在第2.1.2節中建立了使用者和組,接下來我們需要修改資料夾的許可權,讓建立的使用者有許可權訪問上述資料夾。
依次執行chown和chmod對步驟1.2.2解壓後的四個資料夾修改許可權(GeoEvent Server資料夾暫時無需處理)。先確保我們在解壓檔案所在位置,用ls命令檢視資料夾:
然後執行
[[email protected] arcgis]# chown -R arcgis:esrichina ArcGISServer/
[[email protected] arcgis]# chmod -R 755 ArcGISServer/
2 安裝和配置ArcGIS Server
2.1 Server安裝環境準備
2.1.1 修改limits.conf檔案
編輯/etc/security/limits.conf檔案,
新增如下內容:
arcgis soft nofile 65535
arcgis hard nofile 65535
arcgis soft nproc 25059
arcgis hard nproc 25059
儲存退出,執行如下命令使其生效:
2.1.2 檢測環境是否符合Server要求
切換到arcgis賬戶下,並切換到安裝包目錄下,由於我們剛開始檔案是在root資料夾下面放著,那麼我們需要把檔案更換到home/arcgis檔案下,
因為在arcgis使用者下,對root檔案沒有許可權:
而我們剛開始的時候檔案是在root檔案中的:
進入arcgis使用者中,然後命令進入到home/arcgis檔案
然後在執行ArcGISServer中下面的serverdiag指令碼:診斷當前環境是否滿足ArcGIS for Server安裝要求。
執行serverdiag指令碼診斷當前環境是否滿足ArcGIS for Server安裝要求。
[[email protected] ~]# su - arcgis
[[email protected] ~]$ ./ArcGISServer/serverdiag/serverdiag
當出現“There were 0 failure(s) and 0 warning(s) found:”提示時,說明環境滿足要求,可安裝ArcGIS Server。
Tip:su命令用於切換當前使用者身份到其它使用者身份,之前一直用root使用者執行各種命令,至此切換到ArcGIS使用者進行安裝。
2.2 安裝ArcGIS Server
這裡利用console模式進行互動安裝。命令如下:
[[email protected] ~]$ cd ArcGISServer/
[[email protected] ArcGISServer]$ ./Setup -m console
接下來就是不斷按enter鍵將安裝協議閱讀完,然後輸入Y鍵接受安裝協議:
Tip:注意預設的安裝路徑,如果需要修改路徑,請手動輸入一個路徑,如不修改,按entter繼續;
輸入授權檔案的位置,繼續,出現以下資訊,說明安裝成功。
2.3 配置ArcGIS Server
在瀏覽器中輸入步驟2.2.2中返回的ArcGIS Server Manager地址,自動跳轉至ArcGIS for Server的6443埠,開始進行站點配置。
建立站點、設定站點主賬戶的使用者名稱和密碼,配置Server目錄等,直到完成Server配置。
3 安裝和配置ArcGIS Data Store
3.1 診斷環境是否滿足ArcGIS Data Store的要求
執行datastorediag指令碼診斷當前環境是否滿足ArcGIS DataStore的安裝要求。
[[email protected] arcgis]# su - arcgis
[[email protected] ~]$ ArcGISDataStore_Linux/datastorediag/datastorediag
當出現如下資訊,說明當前環境滿足需求,可安裝ArcGIS DataStore。
There were 0 failure(s) and 0 warning(s) found:
3.2 安裝ArcGIS Data Store
這裡利用silent模式進行靜默安裝。
[[email protected] ~]$ cd ArcGISDataStore_Linux/
[[email protected] ArcGISDataStore_Linux]$ ./Setup -m silent -l Yes
安裝完畢,顯示如下資訊,說明安裝成功。
Starting installation of ArcGIS Data Store 10.8.1…
…ArcGIS Data Store 10.8.1 installation is complete.
You will be able to configure ArcGIS Data Store 10.8.1 by navigating to https:// localhost:2443/arcgis/datastore.
配置ArcGIS Data Store
在瀏覽器中輸入ArcGIS Data Store的訪問地址 https://T990.esrichina.com:2443/arcgis/datastore/ ,開始進行ArcGIS Data Store的配置。
1、 輸入步驟2.2.2中的ArcGIS Server 的地址以及步驟2.2.3中設定的ArcGIS for Server主站點管理員賬戶的使用者名稱和密碼,點選下一步。
2、 設定內容目錄的位置,點選下一步。
3、 根據需要,選擇配置關係型、切片快取型和時空型的Data Store,點選下一步,點選完成,直至安裝成功。
配置完成:
去server站點驗證datastore:
4 安裝和配置Portal for ArcGIS
4.1 診斷環境是否滿足Portal for ArcGIS安裝要求
執行portaldiag指令碼診斷當前環境是否滿足 Portal for ArcGIS 的安裝要求。
[[email protected] ~]$ PortalForArcGIS/portaldiag/portaldiag
當出現如下資訊,說明當前環境滿足需求,可安裝Portal for ArcGIS。
There were 0 failure(s) and 0 warning(s) found:
4.2 安裝Portal for ArcGIS
這裡利用console模式進行互動安裝。。
[[email protected] ~]$ cd PortalForArcGIS/
[[email protected] PortalForArcGIS]$ ./Setup -m console
同樣,在這個過程中需要多按幾次回車,一點點閱讀完安裝須知,之後選擇/預設路徑安裝。
這之後就是等待安裝過程完成:
記得提前準備好授權檔案,在安裝過程中需要指定目錄,安裝完畢,顯示如下資訊,說明安裝成功。
Congratulations. Portal for ArcGIS 10.8.1 has been successfully installed to:
/home/arcgis/arcgis/portal
You will be able to access Portal for ArcGIS 10.8.1 by navigating to
https://localhost:7443/arcgis/home.
4.3 配置Portal for ArcGIS
在瀏覽器中輸入Portal for ArcGIS的訪問地址https://T990.esrichina.com:7443/arcgis/home/,開始進行Portal for ArcGIS的配置。
點選建立portal,並填寫各種必要資訊,點選建立,直到建立完成。
5 安裝和配置ArcGIS Web Adaptor
5.1 安裝環境準備
5.1.1 安裝JDK
5.1.1.1 解壓JDK
下載JDK Liunx版本安裝包,推薦版本1.8及以上。
將下載好的安裝包拷貝到Liunx伺服器上,並解壓。(當然也可以從Liunx下用命令直接下載,這裡我是從windows上下載好後拷貝)。命令如下:
[[email protected] home]# tar -zxvf jdk-8u201-linux-x64.tar.gz
[[email protected] home]# mv jdk1.8.0_201/ jdk8
5.1.1.2 配置環境變數
1)編輯/etc/profile檔案,配置JDK環境變數,編輯命令如下:
[[email protected] home]# vi /etc/profile
向檔案中寫入下列內容:
JAVA_HOME=/home/jdk8
CLASSPATH=.:
J
A
V
A
H
O
M
E
/
l
i
b
/
t
o
o
l
s
.
j
a
r
:
JAVA_HOME/lib/tools.jar:
JAVAHOME/lib/tools.jar:JAVA_HOME/lib/dt.jar
PATH=
J
A
V
A
H
O
M
E
/
b
i
n
:
JAVA_HOME/bin:
JAVAHOME/bin:PATH
export JAVA_HOME CLASSPATH PATH
3) 執行 source /etc/profile,
使JDK環境變數配置立即生效。
Tips:
1、這裡幾個JAVA變數與等號和值之間,不能有空格,加入空格,後續JAVA變數配置會不成功。
2、用vi命令在/etc/profile檔案中新增變數時,該變數將會對Linux下所有使用者有效,並且是“永久的”。要讓剛才的修改馬上生效,需要執行source程式碼。
3、這裡大家也可以看到,使用vi命令,程式碼都是同一個顏色,而之前使用vim命令編輯,程式碼會分不同顏色顯示。這兩個命令都是可以的。
5.1.1.3 驗證JDK安裝是否成功
使用下列命令驗證JDK配置是否成功:
[[email protected] home]# java -version
java version “1.8.0_201”
Java™ SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot™ 64-Bit Server VM (build 25.201-b09, mixed mode)
出現上述資訊,Java版本是1.8.0_201,說明JDK環境變數配置成功。
5.1.2 建立自簽名證書
5.1.2.1 建立私鑰和證書請求
1 建立私鑰和證書請求
在tomcat8目錄下建立ssl資料夾,用來存放私鑰檔案及證書
[[email protected] ~]# mkdir /home/tomcat8/ssl
[[email protected] ~]# openssl req -newkey rsa:2048 -nodes -keyout /home/arcgis/tomcat8/ssl/T990.key -x509 -days 365 -out /home/arcgis/tomcat8/ssl/T990.crt
輸入自簽名證書建立所需的引數。建立自簽名證書時,Common Name輸入的是當前機器的完全限定域名即T990.esrichina.com。
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) : Xian
Locality Name (eg, city) [Default City]:Xian
Organization Name (eg, company) [Default Company Ltd]:esrichina
Organizational Unit Name (eg, section) :esrichina
Common Name (eg, your name or your server’s hostname) :T990.esrichina.com
Email Address :[email protected]
Tips:
1、在這個過程中,第一次執行命令提示上述路徑不存在,通過mkdir命令建立ssl資料夾,建立完再執行上述命令就沒有報錯了。如下:
2、記得路徑要寫到當前目錄級別,即如果你處在目錄/tomcat8下,則地址要寫/tomcat8/ssl/…,不能從/ssl開始寫,會報錯。
5.1.2.2 建立自簽名證書
命令如下:
[[email protected] ~]# openssl pkcs12 -inkey /home/arcgis/tomcat8/ssl/T990.key -in /home/arcgis/tomcat8/ssl/T990.crt -export -out /home/arcgis/tomcat8/ssl/T990.pfx
Tips:
1、這裡按照上面的引數執行時,有提示要設定匯出密碼,我設定為了arcgis。
2、要使用SHA-256演算法進行加密,參見下面命令:
openssl req -sha256 -newkey rsa:2048 -nodes -keyout /home/tomcat8/ssl/T990.key -x509 -days 365 -out /home/tomcat8/ssl/T990.crt
openssl pkcs12 -inkey /home/tomcat8/ssl/T990.key -in /home/tomcat8/ssl/T990.crt -export -out /home/tomcat8/ssl/T990.pfx
5.1.3 安裝Tomcat並啟用SSL
5.1.3.1 安裝Tomcat
幫助中明確,對於ArcGIS 10.6版本來說,Linux系統上支援的Web Server版本,Tomcat只支援7.0.82,8.0.47以及8.5.23這三個版本,因此這裡我下載了8.5.23版本。
將下載好的tomcat安裝包拷貝到Linux系統的指定位置,並解壓,命令如下:
[[email protected] home]# tar -zxvf apache-tomcat-8.5.23.tar.gz
在home目錄下新建tomcat8資料夾,將解壓縮後的檔案移入tomcat8資料夾備用。
[[email protected] home]# mv apache-tomcat-8.5.23 tomcat8
1.cp命令
命令:cp dir1/a.doc dir2 表示將dir1下的a.doc檔案複製到dir2目錄下
cp -r dir1 dir2 表示將dir1及其dir1下所包含的檔案複製到dir2下
cp -r dir1/. dir2 表示將dir1下的檔案複製到dir2,不包括dir1目錄
5.1.3.2 對Tomcat啟用ssl
編輯tomcat的server.xml檔案,命令:
[[email protected] tomcat8]# vi apache-tomcat-8.5.35/conf/server.xml
修改為:
修改為:
- 將8080埠號修改為80,(紅框1部分);
- 取消埠號8443對應的connector的註釋,將8443埠修改為443並啟用ssl(紅框2部分)。
Tips:
1、tomcat的版本不同,這裡配置檔案的內容也會有所不同,我查到網上8.0.32及其它版本的修改方式都跟8.5.23不同,因此請確認好Tomcat的版本後再按照版本對應的格式修改,如下圖是8.0.32的改法:
2、這裡的certificateKeystoreFile和certificateKeystorePassword引數都是我們在5.1.2.2步驟中自行建立的,請指定正確的位置和密碼,否則也不會成功。
5.1.3.3 驗證tomcat是否成功
執行startup.sh啟動tomcat。
[[email protected] home]# cd tomcat8/bin/
[[email protected] bin]# ./startup.sh
在瀏覽器中輸入地址,出現以下頁面時說明tomcat啟動成功。
http://t990.esrichina.com/和https://t990.esrichina.com/都可以正常訪問的話,那麼就證明我們的tomcat配置成功了;
5.2 安裝ArcGIS Web Adaptor
先切換回arcgis使用者,導航到WebAdaptor,這裡以靜默方式安裝ArcGIS Web Adaptor,命令如下:
[[email protected] ~]$./Setup -m silent -l Yes
看到如下資訊,說明Web Adaptor安裝成功:
…ArcGIS Web Adaptor (Java Platform) 10.8.1 installation is complete.
5.3 部署Web Adaptor到Tomcat下
依次部署名為portal和server的Web Adaptor應用到tomcat下,用於實現對Portal for ArcGIS和ArcGIS for Server的配置。
命令如下:
[[email protected] home]# cp /home/arcgis/webadaptor10.8.1/java/arcgis.war /home/arcgis/tomcat8/webapps/portal.war
[[email protected] home]# cp /home/arcgis/webadaptor10.8.1/java/arcgis.war /home/arcgis/tomcat8/webapps/server.war
5.4 配置ArcGIS Web Adaptor
接下來需要為Portal for ArcGIS和Server分別配置ArcGIS Web Adaptor。當通過瀏覽器對Portal for ArcGIS和ArcGIS for Server配置Web Adaptor時,要求必須在Web Adaptor所在的機器上。因此,當從非Web Adaptor所在機器的其他客戶端配置Web Adaptor時,需要以命令列的形式。
5.4.1 為Portal配置Web Adaptor
為Portal for ArcGIS配置名為portal的Web Adaptor,命令如下:
[[email protected] ~]$ cd webadaptor10.8.1/java/tools/
[[email protected] tools]$ ./configurewebadaptor.sh -m portal -w https://T990.esrichina.com/portal/webadaptor -g https://T990.esrichina.com:7443 -u admin -p heng14706
返回** Successfully Registered.**說明配置成功,即可通過webadaptor訪問Portal for ArcGIS。
5.4.2 為Server配置Web Adaptor
為ArcGIS Server配置名為Server的ArcGIS Web Adaptor,命令如下:
[[email protected] tools]$ ./configurewebadaptor.sh -m server -w https:// T990.esrichina.com/server/webadaptor -g https://T990.esrichina.com:6443 -u siteadmin -p siteadmin -a true
返回** Successfully Registered.**說明配置成功,即可通過webadaptor訪問ArcGIS for Server了。
6 為Portal和Server配置聯合託管
接下來的步驟大家應該很熟悉了,而且都是在瀏覽器中視覺化的進行,這裡不贅述,簡單描述過程如下:
1、在瀏覽器中輸入Portal地址並登入 Portal for ArcGIS;
2、依次點選My Organization->EDIT SETTINGS->Servers,然後點選 ADD SERVER。
3、在彈出的Add ArcGIS Server對話方塊上設定Services URL、Administration URL,和主站點管理員賬戶的使用者名稱和密碼,點選ADD。
4、在Hosting Server選中聯合的Server,即T990.esrichina.com/server,點選儲存完成配置。
關於為什麼需要server和portal進行聯合託管,參考:
ArcGIS Enterprise託管服務/託管伺服器/託管資料庫-之“託管”理解
7 在Linux上設定開機自啟動
7.1 server的開機自啟動
① 切換至root賬戶下,將 <ArcGIS Server 安裝目錄>/framework/etc/scripts/arcgisserver.service 單元檔案複製到 /etc/systemd/system。 將 /etc/systemd/system/arcgisserver.service 的檔案許可權從 700 更改為 600
[[email protected] ~]# cp /home/arcgis/arcgis/server/framework/etc/scripts/arcgisserver.service /etc/systemd/system
重新整理下:
[[email protected] ~]# chmod 600 /etc/systemd/system/arcgisserver.service
② 仍然以root的身份執行# systemctl enable arcgisserver.service命令,以在 /etc/systemd/system/multi-user.target.wants 中自動建立連結
③ 驗證 systemd 服務是否配置正確,請重新啟動服務後檢查其狀態。
systemctl stop arcgisserver.service
systemctl start arcgisserver.service
systemctl status arcgisserver.service
④ 重新啟動作業系統,然後驗證 ArcGIS Server 是否正確重啟。
這時候我去驗證我自己的server/manage介面,是無法開啟的:
那麼我們重啟linux系統試試:使用reboot命令,在重新查詢下server的狀態:
開啟server/manager即顯示正常:
7.2 portal的開機自啟動
① 切換至root賬戶下,將 <Portal for ArcGIS 安裝目錄>/framework/etc/arcgisportal.service 單元檔案複製到 /etc/systemd/system.。
檔案複製完成後,請確認 /etc/systemd/system/arcgisportal.service 已將其檔案許可權設定為 600
[[email protected] ~]# cp /home/arcgis/arcgis/portal/framework/etc / arcgisportal.service /etc/systemd/system
[[email protected] ~]# chmod 600 /etc/systemd/system/arcgisportal.service
② 仍然以root使用者的身份執行命令# systemctl enable arcgisportal.service,以在 /etc/systemd/system/multi-user.target.wants 中自動建立連結:
③ 驗證 systemd 服務是否配置正確,請重新啟動服務後檢查其狀態。
systemctl stop arcgisportal.service
systemctl start arcgisportal.service
systemctl status arcgisportal.service
④ 重新啟動作業系統,然後驗證 ArcGIS Portal是否正確重啟。
7.3 datastore的開機自啟動
① 切換至root賬戶下,將 <ArcGIS Data Store 安裝目錄>/framework/etc/scripts/arcgisdatastore.service 複製到 /etc/systemd/system。將 /etc/systemd/system/arcgisdatastore.service 的許可權從 700 更新為 600。
[[email protected] ~]# cp /home/arcgis/arcgis/datastore/framework/etc/scripts/arcgisdatastore.service /etc/systemd/system
[[email protected] ~]# chmod 600 /etc/systemd/system/arcgisdatastore.service
② 仍然以root的身份執行# systemctl enable arcgisdatastore.service命令,以在 /etc/systemd/system/multi-user.target.wants 中自動建立連結
③ 驗證 systemd 服務是否配置正確,請重新啟動服務後檢查其狀態。
$ systemctl stop arcgisdatastore.service
$ systemctl start arcgisdatastore.service
$ systemctl status arcgisdatastore.service
④ 重新啟動作業系統,然後驗證ArcGIS Data Store是否正確重啟。
8 常見問題及解決辦法
8.1 正確命令莫名報錯
問題描述:
在安裝過程中,有些命令正確,但執行時會莫名報錯。
原因:
在安裝Server、Portal等過程中,使用了arcgis使用者來安裝,但有些命令需要在root賬戶下執行,arcgis使用者許可權不夠,因此會莫名報一些錯誤。
解決辦法:
使用“su – 使用者名稱”命令切換到有許可權的使用者上即可解決。如圖:
也是可以切換到root使用者之後順利執行的。
8.2 檢視服務是否啟動
問題描述:
在一次重啟機器之後,Server、Portal for ArcGIS等突然不能訪問了。
原因:
Server、Portal、Data Store等預設安裝好後沒有註冊為服務,只能通過程序方式檢視,使用top -u arcgis命令看程序,除非註冊為服務,那就可以通過systemctl檢視。
可通過命令在開機自動啟動裡註冊為服務。
解決方法:
使用下列top命令檢視Server等服務是否啟動,沒啟動的話使用命令啟動。
[[email protected] tools]$ exit
logout
[[email protected] ~]# netstat -anp|grep 7443
[[email protected] ~]# netstat -anp|grep 7080
[[email protected] ~]$ top -u arcgis
[[email protected] ~]$ ls –al
[[email protected] ~]$ arcgis/server/startserver.sh
Attempting to start ArcGIS Server…
[ OK ]
[[email protected] ~]$ arcgis/portal/startportal.sh
Starting Portal for ArcGIS…
[ OK ]
[[email protected] ~]$ top -u arcgis
8.3 忘了檔案放哪兒
問題描述:
Linux中有些命令經常採用預設路徑,如解壓、安裝等,解壓後忘記了預設路徑在哪裡,或者忘記檔案放哪裡了。
解決辦法:
請使用命令find查詢,如下:
查詢目錄:find /(查詢範圍) -name ‘查詢關鍵字’ -type d
查詢檔案:find /(查詢範圍) -name 查詢關鍵字 -print
例1:查詢tomcat7資料夾所在的位置
find / -name ‘tomcat7’ -type d
例2:查詢server.xml檔案的位置
find / -name ‘server.xml’ -print