centos daemontools,centos安装软件命令
大家好,今天来为大家分享centos daemontools的一些知识点,和centos安装软件命令的问题解析,大家要是都明白,那么可以忽略,如果不太清楚的话可以看看本篇文章,相信很大概率可以解决您的问题,接下来我们就一起来看看吧!
如何给CentOS 安装Vmware Tools
第1步:在虚拟软件中选择“安装/重新安装VMware Tools(T)”:
第2步:安装VMwareTools功能增加包(请用root用户登陆系统):
创建/media/cdrom目录:
[root@linuxprobe~]# mkdir-p/media/cdrom
将光驱设备挂载到该目录上:
[root@linuxprobe~]# mount/dev/cdrom/media/cdrom
进入到该挂载目录:
[root@linuxprobe~]# cd/media/cdrom
将功能增强包复制到/home目录中:
[root@linuxprobe cdrom]# cp VMwareTools-9.9.0-2304977.tar.gz/home
进入到/home目录中:
[root@linuxprobe cdrom]# cd/home
解压功能增强包:
root@linuxprobe home]# tar xzvf VMwareTools-9.9.0-2304977.tar.gz
vmware-tools-distrib/
vmware-tools-distrib/FILES
vmware-tools-distrib/doc/
vmware-tools-distrib/doc/open_source_licenses.txt
vmware-tools-distrib/doc/INSTALL
vmware-tools-distrib/doc/README
vmware-tools-distrib/installer/
vmware-tools-distrib/installer/services.sh
vmware-tools-distrib/installer/guestproxy-ssl.conf
vmware-tools-distrib/installer/thinprint.sh
vmware-tools-distrib/installer/upstart-job.conf
………………此处省略解压过程细节………………
进入解压文件夹中:
[root@linuxprobe home]# cd vmware-tools-distrib/
运行安装脚本并加上参数-d,代表默认安装:
[root@linuxprobe vmware-tools-distrib]#./vmware-install.pl-d
The installer has detected an existing installation of open-vm-tools on this
system and will not attempt to remove and replace these user-space
applications. It is recommended to use the open-vm-tools packages provided by
the operating system. If you do not want to use the existing installation of
open-vm-tools and attempt to install VMware Tools, you must uninstall the
open-vm-tools packages and re-run this installer.
The installer will next check if there are any missing kernel drivers. Type yes
if you want to do this, otherwise type no [yes]
………………省略部分安装过程………………
当您看到这个字样后,重启后即可正常使用VmwareTools啦。
Creating a new initrd boot image for the kernel.
Starting Virtual Printing daemon: done
Starting vmware-tools(via systemctl): [ OK ]
The configuration of VMware Tools 9.9.0 build-2304977 for Linux for this
running kernel completed successfully.
Enjoy,
--the VMware team
第3步:重新启动系统后生效:
[root@linuxprobe~]# reboot
这里有详细安装步骤,请参考:
linux vm tools怎么安装
楼主那你肯定是在虚拟机上安装的Linux哦。VMware Tools是VMware虚拟机中自带的增强工具包,用于增强虚拟机显卡与硬盘性能、同步虚拟机与主机的时钟时间、最主要的是可以支持虚拟机与主机之间的文件拖拽传输。第1步:在虚拟软件中选择“安装/重新安装VMware Tools(T)”
第2步:安装VMwareTools功能增加包(请用root用户登陆系统):
创建/media/cdrom目录:
[root@centos~]# mkdir-p/media/cdrom
将光驱设备挂载到该目录上:
[root@centos~]# mount/dev/cdrom/media/cdrom
进入到该挂载目录:
[root@centos~]# cd/media/cdrom
将功能增强包复制到/home目录中:
[root@centos cdrom]# cp VMwareTools-9.9.0-2304977.tar.gz/home
进入到/home目录中:
[root@centos cdrom]# cd/home
解压功能增强包:
root@centos home]# tar xzvf VMwareTools-9.9.0-2304977.tar.gz
………………此处省略解压过程细节………………
进入解压文件夹中:
[root@centos home]# cd vmware-tools-distrib/
运行安装脚本并加上参数-d,代表默认安装:
[root@centos vmware-tools-distrib]#./vmware-install.pl-d
The installer has detected an existing installation of linuxprobe com/chapter-01 html open-vm-tools on this
………………省略部分安装过程………………
当您看到这个字样后,重启后即可正常使用VmwareTools啦。
Creating a new initrd boot image for the kernel.
Starting Virtual Printing daemon: done
Starting vmware-tools(via systemctl): [ OK ]
The configuration of VMware Tools 9.9.0 build-2304977 for Linux for this
running kernel completed successfully.
Enjoy,
--the VMware team
第3步:重新启动系统后生效
[root@centos~]# reboot
如何在CentOS 7上安装Elasticsearch,Logstash和Kibana
您的ELK服务器将需要的CPU,RAM和存储量取决于您要收集的日志的卷。在本教程中,我们将使用具有以下规格的VPS用于我们的ELK服务器:
OS: CentOS 7
RAM: 4GB
CPU: 2
注:根据自己的服务器资源分配各个节点的资源
安装 Java 8
Elasticsearch和Logstash需要Java,所以我们现在就安装它。我们将安装最新版本的Oracle Java 8,因为这是Elasticsearch推荐的版本。
注:建议本地下载完最新版的JDK,然后上传到服务器的/usr/local/src目录
# JDK下载地址:
123123
然后使用此yum命令安装RPM(如果您下载了不同的版本,请在此处替换文件名):
yum-y localinstall jdk-8u111-linux-x64.rpm
# or
rpm-ivh jdk-8u111-linux-x64.rpm123123
现在Java应该安装在/usr/java/jdk1.8.0_111/jre/bin/java,并从/usr/bin/java链接。
安装 Elasticsearch
Elasticsearch可以通过添加Elastic的软件包仓库与软件包管理器一起安装。
运行以下命令将Elasticsearch公共GPG密钥导入rpm:
#
rpm--import
在基于RedHat的发行版的/etc/yum.repos.d/目录中创建一个名为elasticsearch.repo的文件,其中包括:
echo'[elasticsearch-5.x]
name=Elasticsearch repository for 5.x packages
baseurl=
gpgcheck=1
gpgkey=
enabled=1
autorefresh=1
type=rpm-md
'| sudo tee/etc/yum.repos.d/elasticsearch.repo123456789123456789
Elasticsearch源创建完成之后,通过makecache查看源是否可用,然后通过yum安装Elasticsearch:
yum makecache
yum install elasticsearch-y1212
要将Elasticsearch配置为在系统引导时自动启动,请运行以下命令:
sudo/bin/systemctl daemon-reload
sudo/bin/systemctl enable elasticsearch.service1212
Elasticsearch可以按如下方式启动和停止:
sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service1212
这些命令不会提供有关Elasticsearch是否已成功启动的反馈。相反,此信息将写入位于/ var/ log/ elasticsearch/中的日志文件中。
默认情况下,Elasticsearch服务不会记录systemd日志中的信息。要启用journalctl日志记录,必须从elasticsearch中的ExecStart命令行中删除–quiet选项。服务文件。
#注释24行的--quiet\
vim/etc/systemd/system/multi-user.target.wants/elasticsearch.service1212
当启用systemd日志记录时,使用journalctl命令可以获得日志记录信息:
使用tail查看journal:
sudo journalctl-f11
要列出elasticsearch服务的日记帐分录:
sudo journalctl--unit elasticsearch11
要从给定时间开始列出elasticsearch服务的日记帐分录:
sudo journalctl--unit elasticsearch--since"2017-1-4 10:17:16"
# since表示指定时间之前的记录123123
使用man journalctl查看journalctl更多使用方法
检查Elasticsearch是否正在运行
您可以通过向localhost上的端口9200发送HTTP请求来测试Elasticsearch节点是否正在运行:
curl-XGET'localhost:9200/?pretty'
1212
我们能得到下面这样的回显:
{
"name":"De-LRNO",
"cluster_name":"elasticsearch",
"cluster_uuid":"DeJzplWhQQK5uGitXr8jjA",
"version":{
"number":"5.1.1",
"build_hash":"5395e21",
"build_date":"2016-12-06T12:36:15.409Z",
"build_snapshot": false,
"lucene_version":"6.3.0"
},
"tagline":"You Know, for Search"
}1234567891011121312345678910111213
配置 Elasticsearch
Elasticsearch从默认的/etc/elasticsearch/elasticsearch.yml加载配置文件,
配置文件的格式考:
[root@linuxprobe~]# egrep-v"^#|^$"/etc/elasticsearch/elasticsearch.yml
[root@linuxprobe~]# egrep-v"^#|^$"/etc/elasticsearch/elasticsearch.yml
node.name: node-1
path.data:/var/lib/elasticsearch
path.logs:/var/log/elasticsearch
network.host: 10.1.1.53#默认localhost,自定义为ip
http.port: 920012345671234567
RPM还具有系统配置文件(/etc/sysconfig/elasticsearch),允许您设置以下参数:
[root@linuxprobe elasticsearch]# egrep-v"^#|^$"/etc/sysconfig/elasticsearch
ES_HOME=/usr/share/elasticsearch
JAVA_HOME=/usr/java/jdk1.8.0_111
CONF_DIR=/etc/elasticsearch
DATA_DIR=/var/lib/elasticsearch
LOG_DIR=/var/log/elasticsearch
PID_DIR=/var/run/elasticsearch12345671234567
日志配置
Elasticsearch使用Log4j 2进行日志记录。 Log4j 2可以使用log4j2配置。属性文件。 Elasticsearch公开单个属性${sys:es。日志},可以在配置文件中引用以确定日志文件的位置;这将在运行时解析为Elasticsearch日志文件的前缀。
例如,如果您的日志目录是/var/log/elasticsearch并且您的集群名为production,那么${sys:es。 logs}将解析为/var/log/elasticsearch/production。
默认日志配置存在:/etc/elasticsearch/log4j2.properties
安装 Kibana
Kibana的RPM可以从ELK官网或从RPM存储库下载。它可用于在任何基于RPM的系统(如OpenSuSE,SLES,Centos,Red Hat和Oracle Enterprise)上安装Kibana。
导入Elastic PGP Key
我们使用弹性签名密钥(PGP密钥D88E42B4,可从)签名所有的包,指纹:
rpm--import
创建kibana源
echo'[kibana-5.x]
name=Kibana repository for 5.x packages
baseurl=
gpgcheck=1
gpgkey=
enabled=1
autorefresh=1
type=rpm-md
'| sudo tee/etc/yum.repos.d/kibana.repo123456789123456789
kibana源创建成功之后,makecache后使用yum安装kibana:
yum makecache&& yum install kibana-y11
使用systemd运行Kibana
要将Kibana配置为在系统引导时自动启动,请运行以下命令:
sudo/bin/systemctl daemon-reload
sudo/bin/systemctl enable kibana.service1212
Kibana可以如下启动和停止
sudo systemctl start kibana.service
sudo systemctl stop kibana.service1212
配置Kibana
Kibana默认从/etc/kibana/kibana.yml文件加载其配置。
参考:
注意:本实验教程把localhost都改成服务器IP,如果不更改localhost,需要设置反向代理才能访问到kibana。
在同一服务器上安装一个Nginx反向代理,以允许外部访问。
安装nginx
配置Kibana在localhost上监听,必须设置一个反向代理,允许外部访问它。本文使用Nginx来实现发向代理。
创建nginx官方源来安装nginx
#
echo'[nginx]
name=nginx repo
baseurl=$releasever/$basearch/
gpgcheck=0
enabled=1
'| sudo tee/etc/yum.repos.d/nginx.repo1234567812345678
使用yum安装nginx和httpd-tools
yum install nginx httpd-tools-y11
使用htpasswd创建一个名为“kibanaadmin”的管理员用户(可以使用其他名称),该用户可以访问Kibana Web界面:
[root@linuxprobe~]# htpasswd-c/etc/nginx/htpasswd.users kibanaadmin
New password:#自定义
Re-type new password:
Adding password for user kibanaadmin12341234
使用vim配置nginx配置文件
[root@linuxprobe~]# egrep-v"#|^$"/etc/nginx/conf.d/kibana.conf
server{
listen 80;
server_name kibana.aniu.co;
access_log/var/log/nginx/kibana.aniu.co.access.log main;
error_log/var/log/nginx/kibana.aniu.co.access.log;
auth_basic"Restricted Access";
auth_basic_user_file/etc/nginx/htpasswd.users;
location/{
proxy_pass ;
proxy_http_version 1.1;
proxy_set_header Upgrade$http_upgrade;
proxy_set_header Connection'upgrade';
proxy_set_header Host$host;
proxy_cache_bypass$http_upgrade;
}
}12345678910111213141516171234567891011121314151617