Configure P4 Search for the first time

Part of the installation of P4 Search requires setting up an initial configuration. For Windows installations, this is taken care of in the installation wizard. For Linux installations, you need to run a configuration script.

After you have installed P4 Search, you can configure it further from the web UI or locally. See Configure P4 Search.

Configure P4 Search for Linux

To set up an initial configuration of P4 Search on Linux, you must run a script. This script configures users, groups, and the required permissions for P4 Server.

To learn how to set up users manually, see Create users and tickets for external services.

You must be a root user to run the configure.sh script.

Run the configuration script

  1. Locate the etc/configure.sh script file in the installation directory.

  2. Run the script in a command window.

  3. Respond when prompted:

    • To accept the default values within [default], press the Enter key.

    • The [Y/n] option defaults to yes. You can press the Enter key to move on to the next configuration item.

Example outputs

The following are example outputs from running the etc/configure.sh script. User responses are in bold:

$ ./configure.sh
Connecting to your Perforce Server... 
 Perforce Server [localhost:4000]: 
 Superuser account name [super]:
 Enter Password: ********
 OK

Configure the external URL for P4Search (used by the Perforce Server)...
 External URL [http://localhost:1601]: 
 OK

Configure CORs pattern.
 Access control allow origin.

Security level: 2

Configuring HelixCore index user account...
 Username [p4index]:
 Enter password for index: ********

User 'p4index' does not exist!
 Create user? [Y/n]: Y

Creating 'p4index' user account...
 OK

Setting 'p4index' password...
 OK

Configuring unlimited ticket group...
 Group name [unlimited]:

User p4index is not a member of unlimited!
 Add user to group? [Y/n]: Y

Adding p4index to group...
 OK

Checking 'p4index' permissions...

User p4index does not have 'super' access!
  Append 'super user p4index * //...' permission to protects? [Y/n]: Y

Adding permission...
  OK

Generating allhost 'p4index' ticket...
NOTE: in low security mode you can use the same Perforce user for both 'service' and 'index' users.

Configuring HelixCore service user account...
 Username [p4search]:
 Enter password for service: ********

Configuring unlimited ticket group...
 Group name [unlimited]:

Checking 'p4search' permissions...

User 'p4search' does not have 'admin' access!
Append 'admin user p4search * //...' permission to protects? [Y/n]: Y
 
Adding permission...
  OK

Generating local 'p4search' ticket...

Extensions depot does not exist!
  Create extension depot .p4extensions:

Creating extensions depot...
  OK

Connecting to your Elastic Server(s)...
 ElasticSearch host(s) (comma seperated) [http://localhost:9200]:
 Elastic username [elastic]:
 Elastic password: ********
 Connection OK

--------------------------------------------------------------------------------
Configuration finished.

After making configuration changes, you must restart the service:
  sudo systemctl restart p4search.service
--------------------------------------------------------------------------------