Tag - linux

CentOS pem xshell linux    2017-07-19 22:17:37    869
1、需要用pem文件连接到centos系统中,
    xshell 使用pem文件登录:http://blog.csdn.net/gsying1474/article/details/50158817

2、修改root密码
    sudo passwd root

然后输入两次密码


3、修改centos登录方式为密码登录
    打开配置文件 /etc/ssh/sshd_config (ubuntu 为/etc/ssh/sshd-config),设置如下几个参数:
PermitRootLogin yes
PubkeyAuthentication no (也可用#号注释)
PasswordAuthentication yes
4、重启sshd服务
    /etc/init.d/sshd restart
 
 
 

 

by 刘迎光@萤火虫工作室 
OpenBI交流群:495266201 
MicroService 微服务交流群:217722918 
mail: liuyg#liuyingguang.cn 
博主首页(==防止爬虫==):http://blog.liuyingguang.cn

RedHat GCC linux    2017-07-19 22:16:35    894
rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm 
rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm 
rpm -ivh cpp-4.4.7-4.el6.x86_64.rpm 
rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm 
rpm -ivh gcc-4.4.7-4.el6.x86_64.rpm


 


安装包:http://pan.baidu.com/s/10ZdD0




 

by 刘迎光@萤火虫工作室 
OpenBI交流群:495266201 
MicroService 微服务交流群:217722918 
mail: liuyg#liuyingguang.cn 
博主首页(==防止爬虫==):http://blog.liuyingguang.cn

linux Forwarding    2017-07-19 21:25:06    829
参考文章:http://blog.csdn.net/maeom/article/details/6033927

但是依据此文章中的操作,重启network服务以后,还是没有配置成功,解决办法


# vi /etc/sysctl.conf
或者
# vi /usr/lib/sysctl.d/00-system.conf
添加如下代码:
    net.ipv4.ip_forward=1

重启network服务
# systemctl restart network

查看是否修改成功
# sysctl net.ipv4.ip_forward

如果返回为“net.ipv4.ip_forward = 1”则表示成功了
 

 

by 刘迎光@萤火虫工作室 
OpenBI交流群:495266201 
MicroService 微服务交流群:217722918 
mail: liuyg#liuyingguang.cn 
博主首页(==防止爬虫==):http://blog.liuyingguang.cn

elasticsearch linux Docker alpine    2017-07-19 20:31:27    849
在自己构建elasticsearch的Docker镜像的时候,使用最小化的linux系统alpine遇到不能用root用户启动的问题(也许对alpine不太熟悉,无法使用user相关命令),所以网上搜了些资料,记录及梳理自己的操作步奏

参考文章:http://stackoverflow.com/questions/34920801/how-to-run-elasticsearch-2-1-1-as-root-user-in-linux-machine

临时使用root账号启动
启动命令添加如下语句:
-Des.insecure.allow.root=true
bin/elasticsearch -Des.insecure.allow.root=true

默认以root账号启动
或者修改/bin/elasticsearch文件,修改如下语句:
exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" \
修改为:
exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -Des.insecure.allow.root=true -cp "$ES_CLASSPATH" \



 

by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(防止爬虫):http://blog.liuyingguang.cn
OpenBI问答社区:http://openbi.liuyingguang.cn/

alpine linux crontab BusyBox    2017-04-01 17:21:10    1544

首先alpine内嵌的是BusyBox,使用alpine的crontab实际就是使用BusyBox的crond服务,那么下来就简单介绍下如何使用吧,网上教程还是比较多的:

配置文件存放位置:

配置文件是在如下目录中的

  1. /var/spool/cron/crontabs/root

使用方式

  1. 向crontab的配置文件中添加配置
  1. vi /var/spool/cron/crontabs/root
  2. # 或者
  3. crontab -e
  4. # 填入如下内容,最后一行为我添加的测试任务
  5. # do daily/weekly/monthly maintenance
  6. # min hour day month weekday command
  7. */15 * * * * run-parts /etc/periodic/15min
  8. 0 * * * * run-parts /etc/periodic/hourly
  9. 0 2 * * * run-parts /etc/periodic/daily
  10. 0 3 * * 6 run-parts /etc/periodic/weekly
  11. 0 5 1 * * run-parts /etc/periodic/monthly
  12. * * * * * echo "test" >> /app/test.log
  1. 启动crond
  1. crond
  1. 查看状态
  1. ps
  2. PID USER TIME COMMAND
  3. ·····
  4. 82 root 0:00 crond
  5. 292 root 0:00 ps
  1. 查看/app/test.log是否有输入内容
  1. cat test.log
  2. test
  3. test
  4. test
  5. test
  6. test

OK,至此对于c

2/2