博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
RedHad 7.x服务器操作记录
阅读量:2389 次
发布时间:2019-05-10

本文共 5963 字,大约阅读时间需要 19 分钟。

(1)查看版本和内核

[root@master ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.3 (Maipo)[root@master ~]# uname -aLinux master 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux[root@master ~]#

(2)查看磁盘空间

[root@master ~]# df -hFilesystem                    Size  Used Avail Use% Mounted on/dev/mapper/VolGroup-lv_root   50G  7.9G   39G  17% /devtmpfs                      3.9G     0  3.9G   0% /devtmpfs                         3.9G   84K  3.9G   1% /dev/shmtmpfs                         3.9G  8.9M  3.9G   1% /runtmpfs                         3.9G     0  3.9G   0% /sys/fs/cgroup/dev/sda1                     477M  141M  307M  32% /boot/dev/mapper/datavg-lv_data   98G   61M   93G   1% /datatmpfs                         783M   16K  783M   1% /run/user/42tmpfs                         783M     0  783M   0% /run/user/0[root@master ~]# df -h /dataFilesystem                    Size  Used Avail Use% Mounted on/dev/mapper/datavg-lv_data   98G   61M   93G   1% /data[root@master ~]#

(3)查看内存信息

[root@master ~]# free              total        used        free      shared  buff/cache   availableMem:        8010812      296244     6499536        9164     1215032     7424964Swap:       8388604           0     8388604[root@master ~]# free -g              total        used        free      shared  buff/cache   availableMem:              7           0           6           0           1           7Swap:             7           0           7[root@master ~]# free -m              total        used        free      shared  buff/cache   availableMem:           7823         289        6346           8        1186        7250Swap:          8191           0        8191[root@master ~]#

(4)删除已安装JDK

[root@master ~]# rpm -qa|grep javatzdata-java-2016g-2.el7.noarchjava-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64python-javapackages-3.4.1-11.el7.noarchjava-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64javapackages-tools-3.4.1-11.el7.noarch[root@master ~]# rpm -qa|grep java|xargs rpm -e --nodeps[root@master ~]# rpm -qa|grep java[root@master ~]#

(5)从yum源中搜索软件包

[root@master ~]# yum search mariadbLoaded plugins: langpacks, product-id, search-disabled-repos, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast============================================================= N/S matched: mariadb ==============================================================mariadb-bench.x86_64 : MariaDB benchmark scripts and datamariadb-devel.i686 : Files for development of MariaDB/MySQL applicationsmariadb-devel.x86_64 : Files for development of MariaDB/MySQL applicationsmariadb-libs.i686 : The shared libraries required for MariaDB/MySQL clientsmariadb-libs.x86_64 : The shared libraries required for MariaDB/MySQL clientsmariadb-server.x86_64 : The MariaDB server and related filesmariadb.x86_64 : A community developed branch of MySQLmariadb-test.x86_64 : The test suite distributed with MariaD  Name and summary matches only, use "search all" for everything.[root@bigdata05-test ~]#

(6)创建用户和组

[root@master ~]# groupadd elastic[root@master ~]# useradd elastic -g elastic

需要单独设置密码(elastic)

[root@master ~]# passwd elasticChanging password for user elastic.New password: BAD PASSWORD: it is too simplistic/systematicBAD PASSWORD: is too simpleRetype new password: passwd: all authentication tokens updated successfully.

将用户加入sudoers文件

[root@master ~]# visudo

在root下添一行

## Allow root to run any commands anywhereroot    ALL=(ALL)       ALLelastic ALL=(ALL)       ALL

切换用户

[root@master ~]# su elastic[elastic@master root]$ sudo ls /root[sudo] password for elastic: anaconda-ks.cfg[elastic@master root]$

(7)更改目录宿主

[root@master ~]# chown -R elastic:elastic /opt/elasticsearch-6.2.3[root@master ~]# ll /opt/elasticsearch-6.2.3/total 236drwxr-xr-x  2 elastic elastic   4096 Apr  8 11:21 bindrwxr-xr-x  2 elastic elastic   4096 Mar 13 18:08 configdrwxr-xr-x  2 elastic elastic   4096 Mar 13 18:08 lib-rw-r--r--  1 elastic elastic  11358 Mar 13 18:02 LICENSE.txtdrwxr-xr-x  2 elastic elastic   4096 Mar 13 18:08 logsdrwxr-xr-x 16 elastic elastic   4096 Mar 13 18:08 modules-rw-r--r--  1 elastic elastic 191887 Mar 13 18:07 NOTICE.txtdrwxr-xr-x  2 elastic elastic   4096 Mar 13 18:08 plugins-rw-r--r--  1 elastic elastic   9268 Mar 13 18:02 README.textile[root@master ~]#[root@master ~]# ll /opt | grep elasticdrwxr-xr-x   8 elastic elastic 4096 Mar 13 18:08 elasticsearch-6.2.3[root@master ~]#
[root@master config]# vi elasticsearch.yml[root@master config]# mkdir /tpdata/elasticsearch[root@master config]# mkdir /var/log/elasticsearch [root@master config]# chown -R elastic:elastic /tpdata/elasticsearch[root@master config]# chown -R elastic:elastic /var/log/elasticsearch
[root@master ~]# tar -zxvf kibana-6.4.3-linux-x86_64.tar.gz -C /opt[root@master ~]# mv /opt/kibana-6.4.3-linux-x86_64/ /opt/kibana-6.4.3[root@master ~]# chown -R elastic:elastic /opt/kibana-6.4.3[root@master ~]# ll /opt/kibana-6.4.3/total 2288drwxr-xr-x    2 elastic elastic    4096 Oct 31 07:48 bindrwxrwxr-x    2 elastic elastic    4096 Oct 31 07:43 configdrwxrwxr-x    2 elastic elastic    4096 Oct 31 07:29 data-rw-rw-r--    1 elastic elastic   13675 Oct 31 07:32 LICENSE.txtdrwxrwxr-x    6 elastic elastic    4096 Oct 31 07:46 nodedrwxrwxr-x 1131 elastic elastic   36864 Oct 31 07:44 node_modules-rw-rw-r--    1 elastic elastic 1575254 Oct 31 07:31 NOTICE.txtdrwxrwxr-x    3 elastic elastic    4096 Oct 31 07:43 optimize-rw-rw-r--    1 elastic elastic     748 Oct 31 07:32 package.jsondrwxrwxr-x    2 elastic elastic    4096 Oct 31 07:29 plugins-rw-rw-r--    1 elastic elastic    5309 Oct 31 07:29 README.txtdrwxr-xr-x   15 elastic elastic    4096 Oct 31 07:43 srcdrwxr-xr-x    2 elastic elastic    4096 Oct 31 07:43 webpackShims-rw-r--r--    1 elastic elastic  666636 Oct 31 07:24 yarn.lock[root@master ~]#

转载地址:http://uhvab.baihongyu.com/

你可能感兴趣的文章
直接插入排序。。。
查看>>
POJ_2299(归并排序)
查看>>
10个经典的字符串hash函数的C代码实现
查看>>
POJ_2503(基本Hash)
查看>>
POJ_1458(最长公共子序列)
查看>>
最长公共子序列...
查看>>
POJ_1050(最大子矩阵和)
查看>>
第K大数的位置...
查看>>
第(前)k大数问题
查看>>
一道经典的面试题:如何从N个数中选出最大(小)的n个数?
查看>>
计算最少操作次数。。。
查看>>
判断一个数是不是2的n次幂...
查看>>
海量数据统计总结...
查看>>
判断数字是否出现在40亿个数中?
查看>>
makefile讲解...
查看>>
sscanf用法...
查看>>
随机数生成...
查看>>
数组元素的循环左移和右移...
查看>>
socket基础知识...
查看>>
socket的长连接与短连接
查看>>