p4search perforce application installation and configuration Guide in Linux
p4search is an small and powerful tool to search repository of perforce. It will allow you to do much complex file search against to your perforce server. What it does is indexes file content from different types of files. In this article we are going to see how to setup p4search perforce application installation and configuration guide in Linux.
Advantages of p4search
- Easy to search for particular change
- Faster way to find your change list
- You can also integrate with swarm application which gives more flexibility
- It also support advanced search based user name, string and specified repository path
Let’s see how p4search perforce application installation process
Requirements to install p4search
- 4GB of RAM
- 20GB of Disk space
- At-least 2 core processor
- Working state perforce server
- Swarm application is optional (if you want search feature in swarm you can use it)
- Perforce Admin access account credentials
- Jetty8
- Apache Solr
- Java 8 Version or above
- JDK
- Tomcat7 is required
Step 1: Install Java and JDK packages as prerequisites
To install java8 packages, we have to setup the repository first then try to install. p4search perforce application installation
root@TechTutorials:/etc/apt/sources.list.d# add-apt-repository ppa:webupd8team/java Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK7 / JDK8 / JDK9). There are no actual Java files in this PPA. Press [ENTER] to continue or ctrl-c to cancel adding it gpg: keyring `/tmp/tmpnwudqesu/secring.gpg' created gpg: keyring `/tmp/tmpnwudqesu/pubring.gpg' created gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com gpg: /tmp/tmpnwudqesu/trustdb.gpg: trustdb created gpg: key EEA14886: public key "Launchpad VLC" imported gpg: no ultimately trusted keys found gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) OK root@TechTutorials:/etc/apt/sources.list.d# apt-get update root@TechTutorials:/etc/apt/sources.list.d# apt-get install oracle-java8-installer Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: gsfonts-x11 oracle-java8-set-default Suggested packages: binfmt-support visualvm ttf-baekmuk | ttf-unfonts | ttf-unfonts-core ttf-kochi-gothic | ttf-sazanami-gothic ttf-kochi-mincho | ttf-sazanami-mincho ttf-arphic-uming The following NEW packages will be installed: gsfonts-x11 oracle-java8-installer oracle-java8-set-default 0 upgraded, 3 newly installed, 0 to remove and 267 not upgraded. Need to get 36.4 kB of archives. After this operation, 209 kB of additional disk space will be used. Do you want to continue? [Y/n] y root@TechTutorials:/etc/apt/sources.list.d# apt-get install oracle-java8-set-default Reading package lists... Done Building dependency tree Reading state information... Done oracle-java8-set-default is already the newest version (8u111+8u111arm-1~webupd8~0). oracle-java8-set-default set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 267 not upgraded. root@TechTutorials:/etc/apt/sources.list.d# apt-get install default-jre root@TechTutorials:/etc/apt/sources.list.d# apt-get install default-jdk
Now required java packages has been installed, move forward to install tomcat. p4search perforce application installation
2 Step: Installation of tomcat
Along with the tomcat we have to run solr and jetty so it is required to install tomcat as we have to access p4 search from web interface.
root@TechTutorials:/etc/apt/sources.list.d# apt-get install tomcat7 Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: authbind libcommons-dbcp-java libecj-java libservlet3.0-java libtomcat7-java tomcat7-common Suggested packages: libcommons-dbcp-java-doc libgeronimo-jta-1.1-spec-java ecj ant libecj-java-gcj tomcat7-docs tomcat7-admin tomcat7-examples tomcat7-user libtcnative-1 The following NEW packages will be installed: authbind libcommons-dbcp-java libecj-java libservlet3.0-java libtomcat7-java tomcat7 tomcat7-common 0 upgraded, 7 newly installed, 0 to remove and 267 not upgraded. Need to get 6,128 kB of archives. After this operation, 7,391 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 libcommons-dbcp-java all 1.4-5ubuntu2 [148 kB] Get:2 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libecj-java all 3.10.1-2ubuntu1 [1,642 kB] Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 libservlet3.0-java all 7.0.68-1ubuntu0.1 [302 kB] Get:4 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 libtomcat7-java all 7.0.68-1ubuntu0.1 [3,715 kB] Get:5 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 tomcat7-common all 7.0.68-1ubuntu0.1 [266 kB] Get:6 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 tomcat7 all 7.0.68-1ubuntu0.1 [36.7 kB] Get:7 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 authbind amd64 2.1.1+nmu1 [17.6 kB] Fetched 6,128 kB in 13s (458 kB/s) Preconfiguring packages ... Selecting previously unselected package libcommons-dbcp-java. (Reading database ... 233203 files and directories currently installed.) Preparing to unpack .../libcommons-dbcp-java_1.4-5ubuntu2_all.deb ... Unpacking libcommons-dbcp-java (1.4-5ubuntu2) ... Selecting previously unselected package libecj-java. Preparing to unpack .../libecj-java_3.10.1-2ubuntu1_all.deb ... Unpacking libecj-java (3.10.1-2ubuntu1) ... Selecting previously unselected package libservlet3.0-java. Preparing to unpack .../libservlet3.0-java_7.0.68-1ubuntu0.1_all.deb ... Unpacking libservlet3.0-java (7.0.68-1ubuntu0.1) ... Selecting previously unselected package libtomcat7-java. Preparing to unpack .../libtomcat7-java_7.0.68-1ubuntu0.1_all.deb ... Unpacking libtomcat7-java (7.0.68-1ubuntu0.1) ... Selecting previously unselected package tomcat7-common. Preparing to unpack .../tomcat7-common_7.0.68-1ubuntu0.1_all.deb ... Unpacking tomcat7-common (7.0.68-1ubuntu0.1) ... Selecting previously unselected package tomcat7. Preparing to unpack .../tomcat7_7.0.68-1ubuntu0.1_all.deb ... Unpacking tomcat7 (7.0.68-1ubuntu0.1) ... Selecting previously unselected package authbind. Preparing to unpack .../authbind_2.1.1+nmu1_amd64.deb ... Unpacking authbind (2.1.1+nmu1) ... Processing triggers for systemd (229-4ubuntu10) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for man-db (2.7.5-1) ... Setting up libcommons-dbcp-java (1.4-5ubuntu2) ... Setting up libecj-java (3.10.1-2ubuntu1) ... Setting up libservlet3.0-java (7.0.68-1ubuntu0.1) ... Setting up libtomcat7-java (7.0.68-1ubuntu0.1) ... Setting up tomcat7-common (7.0.68-1ubuntu0.1) ... Setting up tomcat7 (7.0.68-1ubuntu0.1) ... Creating config file /etc/default/tomcat7 with new version Adding system user `tomcat7' (UID 125) ... Adding new user `tomcat7' (UID 125) with group `tomcat7' ... Not creating home directory `/usr/share/tomcat7'. Creating config file /etc/logrotate.d/tomcat7 with new version Setting up authbind (2.1.1+nmu1) ... Processing triggers for systemd (229-4ubuntu10) ... Processing triggers for ureadahead (0.100.0-19) ...
Do not start tomcat7 service as we control tomcat from p4search.
3 Step: Install Jetty 8.
Basically jetty8 is the application we used to host our p4search web UI.
root@TechTutorials:/etc/apt/sources.list.d# apt-get install jetty8
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libasm4-java libjakarta-taglibs-standard-java libjetty8-extra-java libjetty8-java libjstl1.1-java libmail-java libxalan2-java
Suggested packages:
libjetty8-java-doc libmail-java-doc libxalan2-java-doc libbsf-java libxsltc-java
The following NEW packages will be installed:
jetty8 libasm4-java libjakarta-taglibs-standard-java libjetty8-extra-java libjetty8-java libjstl1.1-java libmail-java libxalan2-java
0 upgraded, 8 newly installed, 0 to remove and 267 not upgraded.
Need to get 6,789 kB of archives.
After this operation, 10.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 libjetty8-java all 8.1.19-1 [1,571 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 libasm4-java all 5.0.4-1 [252 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 libmail-java all 1.5.5-1 [623 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 libxalan2-java all 2.7.1-9 [3,166 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 libjakarta-taglibs-standard-java all 1.1.2-4 [272 kB]
Get:6 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 libjstl1.1-java all 1.1.2-4 [17.7 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 libjetty8-extra-java all 8.1.19-1 [356 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 jetty8 all 8.1.19-1 [530 kB]
Fetched 6,789 kB in 22s (305 kB/s) p4search perforce application installation
Selecting previously unselected package libjetty8-java.
(Reading database ... 233496 files and directories currently installed.)
Preparing to unpack .../libjetty8-java_8.1.19-1_all.deb ...
Unpacking libjetty8-java (8.1.19-1) ...
Selecting previously unselected package libasm4-java.
Preparing to unpack .../libasm4-java_5.0.4-1_all.deb ...
Unpacking libasm4-java (5.0.4-1) ...
Selecting previously unselected package libmail-java.
Preparing to unpack .../libmail-java_1.5.5-1_all.deb ...
Unpacking libmail-java (1.5.5-1) ...
Selecting previously unselected package libxalan2-java.
Preparing to unpack .../libxalan2-java_2.7.1-9_all.deb ...
Unpacking libxalan2-java (2.7.1-9) ...
Selecting previously unselected package libjakarta-taglibs-standard-java.
Preparing to unpack .../libjakarta-taglibs-standard-java_1.1.2-4_all.deb ...
Unpacking libjakarta-taglibs-standard-java (1.1.2-4) ...
Selecting previously unselected package libjstl1.1-java.
Preparing to unpack .../libjstl1.1-java_1.1.2-4_all.deb ...
Unpacking libjstl1.1-java (1.1.2-4) ...
Selecting previously unselected package libjetty8-extra-java.
Preparing to unpack .../libjetty8-extra-java_8.1.19-1_all.deb ...
Unpacking libjetty8-extra-java (8.1.19-1) ...
Selecting previously unselected package jetty8.
Preparing to unpack .../jetty8_8.1.19-1_all.deb ...
Unpacking jetty8 (8.1.19-1) ...
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up libjetty8-java (8.1.19-1) ...
Setting up libasm4-java (5.0.4-1) ...
Setting up libmail-java (1.5.5-1) ...
Setting up libxalan2-java (2.7.1-9) ...
Setting up libjakarta-taglibs-standard-java (1.1.2-4) ...
Setting up libjstl1.1-java (1.1.2-4) ...
Setting up libjetty8-extra-java (8.1.19-1) ...
Setting up jetty8 (8.1.19-1) ...
Adding system user `jetty' (UID 126) ...
Adding new group `jetty' (GID 134) ...
Adding new user `jetty' (UID 126) with group `jetty' ...
Not creating home directory `/usr/share/jetty8'.
4 Step: Installing Apache solr
Apache solr is an powerful search engine based application, which is the main base for p4search working method. Apache solr packages are not available directly on ubuntu repository we have to download manually and install. Before installing solr, as a prerequisite install python tools.
root@TechTutorials:~# apt-get install python-software-properties
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
python-apt python-pycurl
Suggested packages:
python-apt-dbg python-apt-doc libcurl4-gnutls-dev python-pycurl-dbg python-pycurl-doc
The following NEW packages will be installed:
python-apt python-pycurl python-software-properties
0 upgraded, 3 newly installed, 0 to remove and 267 not upgraded.
1 not fully installed or removed.
Need to get 202 kB of archives.
After this operation, 929 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Download solr package from solr website
root@TechTutorials:~#wget http://www.us.apache.org/dist/lucene/solr/5.5.3/solr-5.5.3.tgz root@TechTutorials:~#tar -xvf solr-5.5.3.tgz root@TechTutorials:~#cd solr-5.5.3/ root@TechTutorials:~#./install_solr_service.sh ../../solr-5.5.3.tgz root@TechTutorials:~# service solr status
5 Step: Now it’s term to install helix-p4d
Helix p4d is required because we can’t manage it’s related things without p4 commands.
root@TechTutorials:~# apt-get install helix-p4d
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
helix-cli helix-cli-base helix-p4d-base helix-p4d-base-16.2 helix-p4dctl
The following NEW packages will be installed:
helix-cli helix-cli-base helix-p4d helix-p4d-base helix-p4d-base-16.2 helix-p4dctl
0 upgraded, 6 newly installed, 0 to remove and 267 not upgraded.
Need to get 6,722 kB of archives.
After this operation, 15.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
WARNING: The following packages cannot be authenticated!
helix-cli-base helix-cli helix-p4dctl helix-p4d-base-16.2 helix-p4d-base helix-p4d
Install these packages without verification? [y/N] y
Get:1 http://package.perforce.com/apt/ubuntu trusty/release amd64 helix-cli-base amd64 2016.2-1468155~trusty [1,968 kB]
Get:2 http://package.perforce.com/apt/ubuntu trusty/release amd64 helix-cli amd64 2016.2-1468155~trusty [7,144 B]
Get:3 http://package.perforce.com/apt/ubuntu trusty/release amd64 helix-p4dctl amd64 2016.2-1468155~trusty [1,396 kB]
Get:4 http://package.perforce.com/apt/ubuntu trusty/release amd64 helix-p4d-base-16.2 amd64 2016.2-1468155~trusty [3,328 kB]
Get:5 http://package.perforce.com/apt/ubuntu trusty/release amd64 helix-p4d-base amd64 2016.2-1468155~trusty [3,270 B]
Get:6 http://package.perforce.com/apt/ubuntu trusty/release amd64 helix-p4d amd64 2016.2-1468155~trusty [19.2 kB]
Fetched 6,722 kB in 29s (231 kB/s) p4search perforce application installation
Selecting previously unselected package helix-cli-base.
(Reading database ... 234160 files and directories currently installed.)
Preparing to unpack .../helix-cli-base_2016.2-1468155~trusty_amd64.deb ...
Unpacking helix-cli-base (2016.2-1468155~trusty) ...
Selecting previously unselected package helix-cli.
Preparing to unpack .../helix-cli_2016.2-1468155~trusty_amd64.deb ...
Unpacking helix-cli (2016.2-1468155~trusty) ...
Selecting previously unselected package helix-p4dctl.
Preparing to unpack .../helix-p4dctl_2016.2-1468155~trusty_amd64.deb ...
Unpacking helix-p4dctl (2016.2-1468155~trusty) ...
Selecting previously unselected package helix-p4d-base-16.2.
Preparing to unpack .../helix-p4d-base-16.2_2016.2-1468155~trusty_amd64.deb ...
Unpacking helix-p4d-base-16.2 (2016.2-1468155~trusty) ...
Selecting previously unselected package helix-p4d-base.
Preparing to unpack .../helix-p4d-base_2016.2-1468155~trusty_amd64.deb ...
Unpacking helix-p4d-base (2016.2-1468155~trusty) ...
Selecting previously unselected package helix-p4d.
Preparing to unpack .../helix-p4d_2016.2-1468155~trusty_amd64.deb ...
Unpacking helix-p4d (2016.2-1468155~trusty) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up helix-cli-base (2016.2-1468155~trusty) ...
Setting up helix-cli (2016.2-1468155~trusty) ...
linking /opt/perforce/bin/p4 to /usr/bin/p4
Setting up helix-p4dctl (2016.2-1468155~trusty) ...
Setting up helix-p4d-base-16.2 (2016.2-1468155~trusty) ...
update-alternatives: using /opt/perforce/sbin/p4d.16.2 to provide /opt/perforce/sbin/p4d (helix-p4d) in auto mode
Setting up helix-p4d-base (2016.2-1468155~trusty) ...
Setting up helix-p4d (2016.2-1468155~trusty) ...
linking /opt/perforce/sbin/p4d to /usr/sbin/p4d
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Thank you for choosing Perforce Helix
:: The following has been installed by the 'helix-p4d' package:
::
:: - The Helix Version Engine (p4d)
:: - A 'perforce' system user
:: - p4dctl, a tool for managing Perforce service instances
:: - The Helix Command-Line Client (p4)
::
:: The Helix Version Engine is now installed, but not yet configured.
:: You must run the following to configure p4d (as root):
::
:: sudo /opt/perforce/sbin/configure-helix-p4d.sh
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Started 0 services.
No services configured.
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for ureadahead (0.100.0-19) ...
6 Step: Download and install p4search utility
To download p4search utility use below link and copy to p4search server.
https://www.perforce.com/downloads/helix
root@TechTutorials:~# tar -xvf p4search.tgz p4search-2016.1.1384678/ p4search-2016.1.1384678/LICENSE p4search-2016.1.1384678/solr-config/
Install p4search application using install.sh script
root@TechTutorials:~# cd p4search-2016.1.1384678/ root@TechTutorials:~/p4search-2016.1.1384678# ls API.pdf conf INSTALL install.sh jetty jetty-distribution-8.1.14.v20131031.tar.gz LICENSE p4-search-2016.1.1384678.war p4searchnotes.txt README scripts solr-4.6.1.tgz solr-config root@TechTutorials:~/p4search-2016.1.1384678# ./install.sh Enter the Perforce Server hostname: 192.168.158.129 Enter the Perforce Server port: 1666 Enter the Perforce Server charset (leave empty for non-unicde servers): Enter the Perforce Server login: admin Enter the Perforce Server password:
Login is succeed then its good to go. Now start the application using ./install/start.sh script p4search perforce application installation
root@TechTutorials:~/p4search-2016.1.1384678# ./install/start.sh ~/p4search-2016.1.1384678/install ~/p4search-2016.1.1384678 Starting solr: OK ~/p4search-2016.1.1384678 Starting p4-search: .2016-12-04 22:46:08.958:INFO:oejs.Server:jetty-8.1.14.v20131031 2016-12-04 22:46:08.998:INFO:oejdp.ScanningAppProvider:Deployment monitor /home/administrator/p4search-2016.1.1384678/install/jetty-distribution-8.1.14.v20131031/webapps at interval 1 2016-12-04 22:46:09.005:INFO:oejdp.ScanningAppProvider:Deployment monitor /home/administrator/p4search-2016.1.1384678/install/jetty-distribution-8.1.14.v20131031/contexts at interval 1 2016-12-04 22:46:09.008:INFO:oejd.DeploymentManager:Deployable added: /home/administrator/p4search-2016.1.1384678/install/jetty-distribution-8.1.14.v20131031/contexts/p4-search.xml 2016-12-04 22:46:09.129:INFO:oejw.WebInfConfiguration:Extract jar:file:/home/administrator/p4search-2016.1.1384678/install/jetty-distribution-8.1.14.v20131031/webapps/p4-search.war!/ to /tmp/jetty-0.0.0.0-8088-p4-search.war-_-any-/webapp .....2016-12-04 22:46:13.277:INFO:/:Initializing Spring root WebApplicationContext java.lang.reflect.InvocationTargetException p4search perforce application installation at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.jetty.start.Main.invokeMain(Main.java:473) at org.eclipse.jetty.start.Main.start(Main.java:615) at org.eclipse.jetty.start.Main.main(Main.java:96) Caused by: java.net.BindException: Address already in use (Bind failed) at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387) at java.net.ServerSocket.bind(ServerSocket.java:375) at java.net.ServerSocket.<init>(ServerSocket.java:237) at org.eclipse.jetty.server.bio.SocketConnector.newServerSocket(SocketConnector.java:96) at org.eclipse.jetty.server.bio.SocketConnector.open(SocketConnector.java:85) at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316) at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:156) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.server.Server.doStart(Server.java:291) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1259) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1182) ... 7 more Usage: java -jar start.jar [options] [properties] [configs] java -jar start.jar --help # for more information .2016-12-04 22:46:14.808:INFO:/:Initializing Spring FrameworkServlet 'dispatcher' .2016-12-04 22:46:15.992:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8088 OK
Conclusion: p4search is an utility / tool to search perforce server repositories faster and more flexible way.
Related Articles
Review board code review software installation and configuration Guide
SEO Keywords : p4 search for file, p4 search changelist, p4 search history, p4 search changelist description, p4 search, p4 search api, p4 search depot, p4 search installation, p4 search swarm, p4 search string, p4 search for a file, p4 search by changelist, p4 command line search, p4 search description, p4 search for changelist, p4 search install, p4 label search, perforce p4 search, p4search perforce application installation, p4search perforce application installation, p4search perforce application installation
Thanks for your wonderful Support and Encouragement