---
title: 添加Solr到环境变量
description: "1. 打开配置文件。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengbds/ecosystemEnable/Solr/kunpengsolr_04_0012.html
sourcePath: /source/zh/kunpengbds/ecosystemEnable/Solr/kunpengsolr_04_0012.html
indexId: 766400f62fb0a2a668d8ba985dd862f0809acb8c29be43b122772fb3e578f4ad67
---
# 添加Solr到环境变量

1. 打开配置文件。
  1 vi /etc/profile

2. 按“i”进入编辑模式，添加Solr到环境变量。
  1 2 export SOLR_HOME=/usr/local/solrCloud export PATH=$SOLR_HOME/bin:$PATH

3. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
4. 使环境变量生效。
  1 source /etc/profile
