Hadoop2.6集群部署

上传hadoop和jdk安装包并解压

下载地址:

1
2
http://mirror.bit.edu.cn/apache/hadoop/common
http://www.oracle.com/technetwork/java/javase/downloads/

下载并解压

1
2
3
4
5
wget http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.1.tar.gz
tar zxf jdk-8u172-linux-x64.tar.gz
mv jdk1.8.0_172 /usr/local/
tar zxf hadoop-2.6.0.tar.gz
mv hadoop-2.6.0 /usr/local/

添加环境变量

vi ~/.bashrc

Otrs Api配置&&Curl测试

CMDB字段参考

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
    "ConfigItem": [
        {
            "CurInciState": "Operational", 
            "ConfigItemID": "1", 
            "InciStateType": "operational", 
            "CurInciStateType": "operational", 
            "Number": "4722000001", 
            "CreateBy": "1", 
            "CurDeplState": "Production", 
            "LastVersionID": "5", 
            "DeplState": "Production", 
            "CreateTime": "2018-06-01 02:53:44", 
            "DefinitionID": "1", 
            "VersionID": "5", 
            "DeplStateType": "productive", 
            "CIXMLData": {
                "SerialNumber": "ABC513VEFG", 
                "Ram": "16G", 
                "WarrantyExpirationDate": "2018-05-31", 
                "Vendor": "", 
                "CPU": [
                    "6核", 
                    ""
                ], 
                "Model": "ProLiant DL380 Gen9", 
                "Owner": "", 
                "NIC": {
                    "NIC": "10.0.0.1", 
                    "IPoverDHCP": "No"
                }, 
                "Type": "", 
                "HardDisk": {
                    "HardDisk": "200G", 
                    "Capacity": ""
                }, 
                "GraphicAdapter": "", 
                "FQDN": "", 
                "OperatingSystem": "", 
                "Description": ""
            }, 
            "Class": "Computer", 
            "InciState": "Operational", 
            "CurDeplStateType": "productive", 
            "Name": "yz-o12-10.0.0.1"
        }
    ]
}

工单字段参考

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
    "Ticket": [
        {
            "Age": 17572057, 
            "PriorityID": "3", 
            "ServiceID": "", 
            "Type": "Unclassified", 
            "Responsible": "root@localhost", 
            "StateID": "1", 
            "ResponsibleID": "1", 
            "ChangeBy": "1", 
            "EscalationTime": "0", 
            "Changed": "2018-05-31 23:33:25", 
            "OwnerID": "1", 
            "RealTillTimeNotUsed": "0", 
            "GroupID": "2", 
            "Owner": "root@localhost", 
            "CustomerID": "", 
            "TypeID": "1", 
            "Created": "2017-11-09 15:08:10", 
            "Priority": "3 normal", 
            "UntilTime": 0, 
            "EscalationUpdateTime": "0", 
            "Queue": "Raw", 
            "QueueID": "2", 
            "State": "new", 
            "Title": "testtest", 
            "CreateBy": "1", 
            "TicketID": "3", 
            "StateType": "new", 
            "UnlockTimeout": "0", 
            "EscalationResponseTime": "0", 
            "EscalationSolutionTime": "0", 
            "LockID": "1", 
            "ArchiveFlag": "n", 
            "TicketNumber": "2017110947000013", 
            "CreateTimeUnix": "1510211290", 
            "Lock": "unlock", 
            "SLAID": "", 
            "CustomerUserID": "it@mulinux.com"
        }
    ]
}

工单查询json参考

1
2
3
4
5
{
    "Ticket": {
        "Queues": "Postmaster"
    }
}

搜索扩展信息json参考

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "UserLogin": "root@localhost",
  "Password": "123456",
  "ConfigItem": {
		"Class":"应用",
		"CIXMLData":{
			"CODE":"226"
		}
	} 	
}

操作工单API

获取工单详细信息
1
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/3?UserLogin=root@localhost&Password=123456"
创建工单
1
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?UserLogin=root@localhost&Password=123456" -H "Content-Type: application/json" -d "{\"Ticket\":{\"Title\":\"REST Create Test\", \"Type\": \"Unclassified\", \"Queue\":\"Raw\",\"State\":\"open\",\"Priority\":\"3 normal\",\"CustomerUser\":\"customer\"},\"Article\":{\"Subject\":\"Rest Create Test\",\"Body\":\"This is only a test\",\"ContentType\":\"text/plain; charset=utf8\"}}"  -X POST
更新工单
1
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/3?UserLogin=root@localhost&Password=123456" -H "Content-Type: application/json" -d "{\"Ticket\":{\"Queue\":\"Postmaster\"}}"  -X PATCH
搜索工单
1
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?UserLogin=root@localhost&Password=123456&Queue=PostMaster"

操作CMDB API

获取CMDB详细信息
1
2
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/ConfigItem/1?UserLogin=root@localhost&Password=123456"
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/ConfigItem/1" -H "Content-Type: application/json" -d "{\"UserLogin\":\"root@localhost\",\"Password\":\"123456\"}" -X GET
创建CMDB
1
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/ConfigItem" -H "Content-Type: application/json" -d "{\"UserLogin\":\"root@localhost\",\"Password\":\"123456\",\"ConfigItem\":{\"Class\":\"Computer\",\"DeplState\":\"Production\",\"InciState\":\"Operational\",\"Name\":\"SH-TG-C4-FB13\",\"CIXMLData\":{\"SerialNumber\":\"6CU513VRKQ\",\"Ram\":\"16G\",\"Model\":\"ProLiant DL380 Gen9\",\"NIC\":{\"NIC\":\"192.168.1.1\",\"IPoverDHCP\":\"No\"}}}}"  -X POST
更新CMDB
1
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/ConfigItem/1" -H "Content-Type: application/json" -d "{\"UserLogin\":\"root@localhost\",\"Password\":\"123456\",\"ConfigItem\":{\"Class\":\"Computer\",\"DeplState\":\"Production\",\"InciState\":\"Operational\",\"Name\":\"SH-TG-C4-FB18\"}}"  -X PATCH
搜索CMDB
1
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/ConfigItem" -H "Content-Type: application/json" -d "{\"UserLogin\":\"root@localhost\",\"Password\":\"123456\",\"ConfigItem\":{\"Class\":\"Computer\"}}" -X GET

OpenVZ虚机Centos6.5安装gitlab报错

执行gitlab-ctl reconfigure后报错:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[execute] cat: error: permission denied on key 'net.bridge.bridge-nf-call-ip6tables'
              error: permission denied on key 'net.bridge.bridge-nf-call-iptables'
              error: permission denied on key 'net.bridge.bridge-nf-call-arptables'
              /etc/sysctl.d/*.conf: No such file or directory
              net.ipv4.ip_forward = 0
              net.ipv4.tcp_syncookies = 1
    
    ================================================================================
    Error executing action `run` on resource 'execute[load sysctl conf]'
    ================================================================================

解决方法

1
2
3
4
5
6
rm -f /sbin/modprobe  
ln -s /bin/true /sbin/modprobe

rm -f /sbin/sysctl  
ln -s /bin/true /sbin/sysctl 
/sbin/sysctl -p    #不用执行