CentOS安装openjdk
文章目录
一、yum
1.1search
powershell
yum search java | grep jdk

1.2安装openjdk
root@test \~\]# yum install java-1.8.0-openjdk -y 查看openjdk版本 \[root@test \~\]# java -version  ## 二、elasticsearch的启动和关闭 ### 2.1启动 切换到elasticsearch安装目录的bin目录下,执行如下命令即可 切换es的用户 ```powershell ./elasticsearch -d ```  ### 2.2关闭 查询java进程 ```powershell [elasticsearch@localhost bin]$ ps -ef|grep java ```  kill -9 进程号 即可关闭 ### 2.3添加服务 \[elasticsearch@localhost system\]$ pwd /etc/systemd/system vim es.service ```powershell [Unit] Description=es.service After=network.target [Service] LimitNOFILE=infinity User=elasticsearch Group=elasticsearch Type=forking ExecStart=/data/elasticsearch/bin/elasticsearch -d PrivateTmp=True [Install] WantedBy=multi-user.target ``` ```powershell 重载系统服务 systemctl daemon-reload 加入开机自启 systemctl enable es.service # 启动redis服务 systemctl start es.service # 停止redis服务 systemctl stop es.service # 查看redis服务状态 systemctl status es.service ``` 