CentOS7常用开发环境安装配置(记录篇)

1、RZ,SZ安装:

yum install lrzsz 

关于rz、sz:

lrzsz是一款在linux里可代替ftp上传和下载的程序。lrzsz是一个unix通信套件提供的X,Y,和ZModem文件传输协议。

centos服务器,可直接yum -y install lrzsz 程序会自动安装好,你要下载 sz [找到你要下载的文件];如果你要上传,rz 浏览找到你本机要上传的文件。需要注意的是这个命令无法在putty界面使用哦!

2、配置网卡

1)首先进到目录

cd /etc/sysconfig/network-scripts

2)编辑ifcfg-ens33(每台机器不同)

vi ifcfg-ens33

3)具体修改如下:

 ONBOOT=no

   改为

 ONBOOT=yes  # 自动开启网络连接

4)重启服务

service network restart

3、安装ifconfig

yum search ifconfig  //查询ifconfig相关包

yum install net-tools-X86_60  //根据上面的查询所在包名,安装相应包

4、安装JDK

//使用最简单的rpm安装
rpm -ivh jdk-8u261-linux-x64.rpm

//等待安装完成后,环境也配置好了
java -version

5、使用yum安装时可能会遇到

[root@localhost wangcheng]# yum install yumex Existing lock /var/run/yum.pid: 
another copy is running as pid 3807. 
Another app is currently holding the yum lock; 
waiting for it to exit... 
Another app is currently holding the yum lock; 
waiting for it to exit... 
Another app is currently holding the yum lock; 
waiting for it to exit... 

这是什么原因?
 /var/run/yum.pid我打开看了,只是一个数,其他的 可能是系统自动升级正在运行或其它安装没有正常结束,所以yum被锁定了。 
 可以通过执行
 rm -rf /var/run/yum.pid 
 来强行解除锁定,然后你的yum就可以运行了。

6、安装zookeeper

我下载的3.5.8版本的

要下3.5.8-bin这个文件,如果下载下面那个文件在运行时就会报错:

Could not find or load main class org.apache.zookeeper.server.quorum.

在解压目录下创建data目录和logs目录,修改conf/zoo.cfg文件(zoo.cfg由zoo_sample.cfg复制来)

# The number of milliseconds of each tick

# zookeeper 定义的基准时间间隔,单位:毫秒
tickTime=2000

# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
# dataDir=/tmp/zookeeper

# 数据文件夹
dataDir=/usr/local/zookeeper/data

# 日志文件夹
dataLogDir=/usr/local/zookeeper/logs

# the port at which the clients will connect
# 客户端访问 zookeeper 的端口号
clientPort=2181

# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

启动:bin/zkServer.sh start|status|restart|stop

加到自启动:

vim /etc/profile
在其尾部追加:

export ZOOKEEPER_HOME=/usr/local/zookeeper/ 

export PATH=$ZOOKEEPER_HOME/bin:$PATH

export PATH

使 /etc/ 目录下的 profile 文件即可生效:
source /etc/profile

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值