Configure P4 Search for the first time
When you install P4 Search you must set up an initial configuration. For Windows installations, you follow the prompts in the installation wizard. For Linux installations, you run a configuration script.
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.
If you choose to install P4 Search manually, you must create the users yourself. See Create users and tickets for external services.
Run the configuration script
-
Locate the etc/configure.sh script file in the installation directory.
-
At the command prompt, run the script.
-
Respond when prompted:
-
To accept the default values within [default], press Enter.
-
The [Y/n] option defaults to yes. You can press Enter to move on to the next configuration item.
-
Running the script updates the following configurables:
com.perforce.p4search.core.service.p4user
com.perforce.p4search.core.index.p4user
com.perforce.p4search.core.service.p4ticket
com.perforce.p4search.core.index.p4ticket
com.perforce.p4search.core.p4port
com.perforce.p4search.core.p4trust
com.perforce.p4search.service.external-url
com.perforce.p4search.elastic.hosts
com.perforce.p4search.elastic.user
com.perforce.p4search.elastic.pass
By choosing the default options during the running of the script:
-
Users are created:
p4search (admin permission, with your choice of a Standard user or a Service user at Security level 5 or higher)
p4index (super permission, Standard user)
-
Users are added to the group:
unlimited (with unlimited ticket Timeout)
-
Server specification is created for Security level 5 or above:
p4search (configuring the User, AllowedAddresses, and Address fields)
For a full list of P4 Search configurations, see P4 Search configuration reference.
Sample outputs
The following are sample 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 separated) [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
--------------------------------------------------------------------------------